Closed bahchis closed 8 years ago
Hi @bahchis
Ansible now provides ansible_service_mgr
fact which tells whether it is systemd or init.
Current release is 0.15.0 and minimum Ansible version is 1.6. It should be safe to upgrade up to 0.12.0, since 0.13.0 (https://github.com/AnsibleShipyard/ansible-zookeeper/releases/tag/v0.13.0) systemd unit had changed location to /lib/systemd/system/zookeeper.service
.
Hi @ernestas-poskus Thanks for the reply.
In the meantime, I was able to try the 0.15.0 which works as expected and the deploy tag is no longer an issue. At first, I just installed using the ansible-galaxy, which installed the 0.9.2 with the issue described above. Installing the latest version from git, resolves the issue.
Thanks!
I use the 0.9.2 version installed with ansible-galaxy.
I am trying to create an image with Packer and then run deploy stage when deploying servers. I skip the deploy tag when creating the image and run deploy tag only when running servers. Running deploy tag results in the following error:
FAILED! => {"failed": true, "msg": "The conditional check 'etc_init.stat.exists == true' failed. The error was: error while evaluating conditional (etc_init.stat.exists == true): 'etc_init' is undefined\n\nThe error appears to have been in '/etc/ansible/roles/AnsibleShipyard.ansible-zookeeper/tasks/RedHat.yml': line 37, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Upstart script.\n ^ here\n"}
I checked, the reason for that is the etc_init task is not tagged with deploy, so it does not get executed when running with deploy tag only. I changed it locally and the problem was gone. I had to add the tag to two tasks (I link to the release I am using): https://github.com/AnsibleShipyard/ansible-zookeeper/blob/v0.9.2/tasks/RedHat.yml#L33 https://github.com/AnsibleShipyard/ansible-zookeeper/blob/v0.9.2/tasks/RedHat.yml#L44
I have noticed that newer version does not perform that check for systemd, so I think it could be a good idea to remove that check for upstart as well, since in upstart case, I think the error will remain in the newer versions as well.