Closed p3l1 closed 3 years ago
Make sure your molecule file contains these config lines: https://github.com/geerlingguy/ansible-role-nginx/blob/master/molecule/default/molecule.yml#L9-L13
If not, then systemd can't start correctly in the container.
Yeah, this was the issue. I forgot adding command: ${MOLECULE_DOCKER_COMMAND:-""}
.
Thank you very much for your quick answer!
Hey there,
I am quite new to Molecule and currently developing an Ansible Role to install Zabbix Agent on Ubuntu, Debian and CentOS. After installation i want to ensure the service is up and running with the following task:
When running
molecule converge
the step fails for all three docker images and i can't figure out why.fatal: [ubuntu]: FAILED! => {"changed": false, "msg": "Service is in unknown state", "status": {}}
The Agent is installed via .deb packages which are provided by Zabbix for each distribution. The error also occures when I try starting other services. So this shouldn't be a Zabbix related problem.
I also (try) to verify the service is running after applying the role with the following assertion in my
verify.yml
:...which currently is failing.
I did some research on Google and I looked at some of your Ansible Roles like ansible-role-nginx but can not locate my problem here. The nginx service is started exactly the same. When inside the container i can start the service manually by running:
service zabbix-agent start
. When running this command through Ansible's command module, the service is also started, but i would rather use the existing systemd or service module of Ansible because the command will not work like this on CentOS. Any ideas why it is not working? Do I have to adjust/extend the docker image?This is probably an issue on my hand, but maybe you can point me into the right direction.
Thanks in advance!