devgateway / ansible-role-pacemaker Goto Github PK
View Code? Open in Web Editor NEWAnsible role to deploy Pacemaker HA clusters
Ansible role to deploy Pacemaker HA clusters
hello
i get this error and the play stops
TASK [styopa.pacemaker : Install Pacemaker Configuration System package] *******
task path: /home/dimtheo/my-roles/styopa.pacemaker/tasks/main.yml:6
fatal: [debian3]: FAILED! => {"failed": true, "msg": "'pacemaker' is undefined"}
fatal: [debian4]: FAILED! => {"failed": true, "msg": "'pacemaker' is undefined"}
can you help?
I am getting the following error when running the play book with the following included.
_pacemaker_private_interface: |
{% for interface in ansible_interfaces %}
{% if 'docker' in interface or 'lo' in interface %}{% continue %}{% endif %}
{% set int = 'ansible%s' | format(interface) %}
{% if _int in hostvars[inventory_hostname] and 'ipv4' in hostvars[inventory_hostname][_int] and hostvars[inventory_hostname][_int]['ipv4']['address'] is defined %}
{% if hostvars[inventory_hostname][_int]['ipv4']['address'] | ipaddr('private') %}
{{ interface|trim}}
{% break %}{% endif %}
{% endif %}
{% endfor %}
pacemaker_private_interface: "{{ _pacemaker_private_interface | trim }}"
pacemaker_corosync_ring_interface: "{{ pacemaker_private_interface }}"
here is the error;
TASK [weldpua2008.pacemaker : Creates corosync config] **************************************************
fatal: [intblade03]: FAILED! => {"changed": false, "msg": "AnsibleError: {{ pacemaker_private_interface }}: {{ _pacemaker_private_interface | trim }}: {% for interface in ansible_interfaces %}\n{% if 'docker' in interface or 'lo' in interface %}{% continue %}{% endif %}\n{% set int = 'ansible%s' | format(interface) %}\n{% if _int in hostvars[inventory_hostname] and 'ipv4' in hostvars[inventory_hostname][_int] and hostvars[inventory_hostname][_int]['ipv4']['address'] is defined %}\n {% if hostvars[inventory_hostname][_int]['ipv4']['address'] | ipaddr('private') %}\n {{ interface|trim}}\n {% break %}{% endif %}\n{% endif %}\n{% endfor %}\n: template error while templating string: Encountered unknown tag 'continue'. Jinja was looking for the following tags: 'elif' or 'else' or 'endif'. The innermost block that needs to be closed is 'if'.. String: {% for interface in ansible_interfaces %}\n{% if 'docker' in interface or 'lo' in interface %}{% continue %}{% endif %}\n{% set int = 'ansible%s' | format(interface) %}\n{% if _int in hostvars[inventory_hostname] and 'ipv4' in hostvars[inventory_hostname][_int] and hostvars[inventory_hostname][_int]['ipv4']['address'] is defined %}\n {% if hostvars[inventory_hostname][_int]['ipv4']['address'] | ipaddr('private') %}\n {{ interface|trim}}\n {% break %}{% endif %}\n{% endif %}\n{% endfor %}\n"}
fatal: [intblade04]: FAILED! => {"changed": false, "msg": "AnsibleError: {{ pacemaker_private_interface }}: {{ _pacemaker_private_interface | trim }}: {% for interface in ansible_interfaces %}\n{% if 'docker' in interface or 'lo' in interface %}{% continue %}{% endif %}\n{% set int = 'ansible%s' | format(interface) %}\n{% if _int in hostvars[inventory_hostname] and 'ipv4' in hostvars[inventory_hostname][_int] and hostvars[inventory_hostname][_int]['ipv4']['address'] is defined %}\n {% if hostvars[inventory_hostname][_int]['ipv4']['address'] | ipaddr('private') %}\n {{ interface|trim}}\n {% break %}{% endif %}\n{% endif %}\n{% endfor %}\n: template error while templating string: Encountered unknown tag 'continue'. Jinja was looking for the following tags: 'elif' or 'else' or 'endif'. The innermost block that needs to be closed is 'if'.. String: {% for interface in ansible_interfaces %}\n{% if 'docker' in interface or 'lo' in interface %}{% continue %}{% endif %}\n{% set int = 'ansible%s' | format(interface) %}\n{% if _int in hostvars[inventory_hostname] and 'ipv4' in hostvars[inventory_hostname][_int] and hostvars[inventory_hostname][_int]['ipv4']['address'] is defined %}\n {% if hostvars[inventory_hostname][_int]['ipv4']['address'] | ipaddr('private') %}\n {{ interface|trim}}\n {% break %}{% endif %}\n{% endif %}\n{% endfor %}\n"}
Hello
This is from your example playbook
pacemaker_resources:
- id: dns-ip
type: "ocf:heartbeat:IPaddr2"
options:
ip: 10.0.0.1
cidr_netmask: 8
Do i have to enter a virtual/floating IP in ip:?
thank you
I try to configure advanced resource with meta and I get error "'dict object' has no attribute 'name'".
Probably the cause is nvpair.name in loop_control.labal. Should be nvpair.key.
https://github.com/devgateway/ansible-role-pacemaker/blob/master/tasks/advanced-resource.yml#L22
Hi! If, in a playbook, I first say tasks_from: group, it works perfectly. However, if I, after that, in another task, say tasks_from: constraint, it fails, e.g.: "The target XML source '/tmp/ansible.Vme64f.xml' does not exist." The 'post' task included in group.yml removes the temporary config file, whereas constraint.yml doesn't include the pre.yml (or post.yml) files. And if I run the 'constraint' task first, I get the error that 'pcmk_config' is undefined, which it is, since it never gets defined. Suggested solution: add include_tasks: pre.yml and include_tasks: post.yml to the constraint.yml file, as it is in group.yml, resource.yml and advanced_resource.yml.
Hi
i have finnaly ported your role to Debian 9 . Everything works except the part that you have to create corosync-keygen , i did that manually. I still need to figure out how to do it with ansible.
For debian8 the role fails miserably . You have to use jessie backports but even then packages don;t install for some reason.
I can share the edited role with you if you are interested
the other 2 issues still remain open ..
The following error is observed in ansible 2.9.x:
fatal: [myhost]: FAILED! => {"changed": false, "msg": "The target XML source '/tmp/ansible.xwl9wmkg.xml' does not exist."}
This output is observed even if prior include_role calls had created the temp file already. Apparently ansible cleans up tempfiles faster than it used to.
I have submitted a patch in PR #16
?
hi
i get stuck here
it craps out with a message saying it can not create the above dir
can you give some help please?
fatal: [debian3]: FAILED! => {"changed": false, "cmd": "pcs cluster auth debian3 debian4 -u hacluster -p secret", "failed": true, "invocation": {"module_args": {"_raw_params": "pcs cluster auth debian3 debian4 -u hacluster -p secret", "_uses_shell": false, "chdir": null, "creates": "/var/lib/pcsd/tokens", "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "msg": "[Errno 2] No such file or directory", "rc": 2}
hi
i got it go past the previous error but now i am stuck here
TASK [styopa.pacemaker : Authenticate all nodes] *******************************
task path: /home/dimtheo/my-roles/styopa.pacemaker/tasks/main.yml:18
fatal: [debian3]: FAILED! => {"failed": true, "msg": "'cloud' is undefined"}
in vars/main i have these:
pacemaker_package: pacemaker
pacemaker_user: hacluster
pacemaker_ansible_group: cloud
i have defined "cloud". Any ideas why it complains ?
thank you
It looks to me that there is nothing in the code https://github.com/styopa/ansible-pacemaker/blob/1ed86d75da60828ef1758f0b44c08cc4839f9283/tasks/main.yml#L50 to prevent from trying to create already defined pacemaker_resources on the cluster.
Take the following 2-node scenario:
Hi,
Thank you so much for the Anisble role. It's really helpful.
I'm trying to setup Pacemaker cluster on Debian 10 and with little tweaks it's working fine.
We would like to add 2 Virtual IPs and a service for squid. I followed the taks_from: group but post tasks - Verify cluster configuration is failing with CIB did not pass DTD/schema validation.
We trying to setup something like http://wiki.stocksy.co.uk/wiki/High_Availability_IP_Addresses_in_Debian
Could you please guide how to configure our requirement please?
Hi,
I've created my cluster manually. Nothing special.
Then i wanted to test ansible book for it. But when i run it i get this error
TASK: [styopa.pacemaker | Ensure the password for the cluster user] ***********
failed: [20cent] => {"failed": true}
msg: this module requires key=value arguments (['name={#', 'pacemaker_user', '#}', 'password={#', 'pacemaker_password', '|', 'password_hash(sha512,', 'ansible_hostname)', '#}'])
failed: [10cent] => {"failed": true}
msg: this module requires key=value arguments (['name={#', 'pacemaker_user', '#}', 'password={#', 'pacemaker_password', '|', 'password_hash(sha512,', 'ansible_hostname)', '#}'])
FATAL: all hosts have already failed -- aborting
And my playbook looks like this
hosts: mycluster
roles:
- id: dns-ip
type: "ocf:heartbeat:IPaddr2"
options:
ip: 16.53.125.50
cidr_netmask: 8
op:
- action: monitor
options:
interval: 5s
Here are the variables
pacemaker_package: pcs
pacemaker_user: hacluster
can you please explain in your playbook the - id: dns-ip and dns-server ?
are these just hostnames reflecting your set up ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.