You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run a molecule test on my vagrant box using ansible local. Just as it is possible to have the below command in a Vagrantfile which runs ansible and all playbooks in the remote machine.
user.vm.provision "ansible_local" do |ans|
ans.compatibility_mode = "2.0"
ans.inventory_path = "path/to/directory/on/remote/machine"
ans.playbook = "path/to/directory/on/remote/machine"
ans.verbose = "v"
end
The molecule file I am using for the deployment is below but I am getting error.
I got the error below after executing molecule converge in the molecule directory. I would like to ask if molecule provides a way of achieving the same purpose as vagrant ansible _local.
Traceback (most recent call last):
File "/home/mykali/.local/bin/molecule", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mykali/.local/lib/python3.11/site-packages/molecule/command/converge.py", line 60, in converge
base.execute_cmdline_scenarios(scenario_name, args, command_args, ansible_args)
File "/home/mykali/.local/lib/python3.11/site-packages/molecule/command/base.py", line 99, in execute_cmdline_scenarios
get_configs(args, command_args, ansible_args, glob_str),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mykali/.local/lib/python3.11/site-packages/molecule/command/base.py", line 221, in get_configs
configs = [
^
File "/home/mykali/.local/lib/python3.11/site-packages/molecule/command/base.py", line 222, in <listcomp>
config.Config(
File "/home/mykali/.local/lib/python3.11/site-packages/molecule/config.py", line 68, in __call__
obj.after_init()
File "/home/mykali/.local/lib/python3.11/site-packages/molecule/config.py", line 121, in after_init
self.config = self._reget_config()
^^^^^^^^^^^^^^^^^^^^
File "/home/mykali/.local/lib/python3.11/site-packages/molecule/config.py", line 318, in _reget_config
env = util.merge_dicts(os.environ, self.env)
^^^^^^^^
File "/home/mykali/.local/lib/python3.11/site-packages/molecule/config.py", line 207, in env
"MOLECULE_INVENTORY_FILE": self.provisioner.inventory_file,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'inventory_file'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to run a molecule test on my vagrant box using ansible local. Just as it is possible to have the below command in a Vagrantfile which runs ansible and all playbooks in the remote machine.
The molecule file I am using for the deployment is below but I am getting error.
I got the error below after executing
molecule converge
in the molecule directory. I would like to ask if molecule provides a way of achieving the same purpose as vagrant ansible _local.Beta Was this translation helpful? Give feedback.
All reactions