kostiantyn-nemchenko / ansible-role-patroni

:elephant: Ansible Role for Patroni
https://galaxy.ansible.com/kostiantyn-nemchenko/patroni
MIT License
68 stars 44 forks source link

First run get error in Add etcd systemd service #35

Closed patsevanton closed 5 years ago

patsevanton commented 5 years ago

I get error in Add etcd systemd service if first run playbook

TASK [retr0h.etcd : Add etcd systemd service] ***************************************************************************************************
fatal: [patroni1]: FAILED! => {
    "changed": false
}
MSG:
AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute u'ansible_lo'
fatal: [patroni2]: FAILED! => {
    "changed": false
}
MSG:
AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute u'ansible_lo'
patsevanton commented 5 years ago

And later

RUNNING HANDLER [retr0h.etcd : Restart etcd] ****************************************************************************************************
fatal: [patroni1]: FAILED! => {
    "changed": false
}

MSG:

Unable to start service etcd: Job for etcd.service failed because the control process exited with error code. See "systemctl status etcd.service" and "journalctl -xe" for details.

fatal: [patroni2]: FAILED! => {
    "changed": false
}

MSG:

Unable to start service etcd: Job for etcd.service failed because the control process exited with error code. See "systemctl status etcd.service" and "journalctl -xe" for details.

fatal: [patroni3]: FAILED! => {
    "changed": false
}

MSG:

Unable to start service etcd: Job for etcd.service failed because the control process exited with error code. See "systemctl status etcd.service" and "journalctl -xe" for details.
patsevanton commented 5 years ago
[patroni]
patroni1 ansible_host=192.168.88.215
patroni2 ansible_host=192.168.88.216
patroni3 ansible_host=192.168.88.235

[etcd]
patroni1 ansible_host=192.168.88.215
patroni2 ansible_host=192.168.88.216
patroni3 ansible_host=192.168.88.235
- hosts: patroni
  become: yes
  roles:
    - kostiantyn-nemchenko.patroni
kostiantyn-nemchenko commented 5 years ago

Sorry for not replying sooner. I'll take a closer look at your reported issues and submitted PRs this weekend.

kostiantyn-nemchenko commented 5 years ago

You should set the correct interface for this variable depending on your environment. But seems like that role is no longer maintained. I will find a similar one in the near future.

patsevanton commented 5 years ago

i try role 'andrewrothstein.etcd-cluster' with fix https://github.com/andrewrothstein/ansible-etcd-cluster/pull/5