ansible-role-patroni
ansible-role-patroni copied to clipboard
AnsibleUndefinedVariable dict object has no attribute etcd
I dont know how fix it.
TASK [retr0h.etcd : Add etcd systemd service] ***************************************************************************************************
fatal: [ubuntu1]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute u'etcd'"}
fatal: [ubuntu2]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute u'etcd'"}
fatal: [ubuntu3]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute u'etcd'"}
cat patroni.yml
- hosts: patroni
become: yes
roles:
- kostiantyn-nemchenko.patroni
Can i use another role for etcd ? For example: https://galaxy.ansible.com/andrewrothstein/etcd-cluster
fatal: [ubuntu1]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute u'etcd'"
Seems like you don't have etcd
group in your inventory file for ansible.
Please, add something like the following:
[etcd]
ubuntu1 ansible_host=XXX.XXX.XXX.XXX
ubuntu2 ansible_host=XXX.XXX.XXX.XXX
ubuntu3 ansible_host=XXX.XXX.XXX.XXX
Can i use another role for etcd ?
Sure, just set patroni_dcs_exists
to true
and provide the correct values for etcd related settings.
OMG. May be add
[etcd]
ubuntu1 ansible_host=XXX.XXX.XXX.XXX
ubuntu2 ansible_host=XXX.XXX.XXX.XXX
ubuntu3 ansible_host=XXX.XXX.XXX.XXX
to readme?
It makes sense. But respective groups for zookeeper and consul should be added as well.