-
-
Notifications
You must be signed in to change notification settings - Fork 537
Drop delegate_to for SSH jump host compatibility #1033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Drop delegate_to for SSH jump host compatibility #1033
Conversation
| - /etc/confd/conf.d/haproxy.toml | ||
| - /etc/confd/templates/haproxy.tmpl | ||
| delegate_to: "{{ groups.balancers[0] }}" | ||
| when: "'balancers' in group_names" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, there will be an error because there will be a new haproxy node in the group that we are adding.
It is necessary to get files from the first node of the group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the first node in the group will be a new node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this?
when:
- 'balancers' in group_names
- not new_node | bool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the first node in the group will be a new node?
it is assumed that the user has read the documentation
all necessary configuration files will be copied from the first server listed in the "balancers" group in the inventory file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this?
I think it will work.
| flat: true | ||
| notify: "restart haproxy" | ||
| delegate_to: "{{ groups.balancers[0] }}" | ||
| when: "'balancers' in group_names" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is necessary to fetch files from the first node of the group.
| validate_checksum: true | ||
| flat: true | ||
| delegate_to: "{{ groups.balancers[0] }}" | ||
| when: "'balancers' in group_names" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also - first node in the group.
| validate_checksum: true | ||
| flat: true | ||
| delegate_to: "{{ groups.balancers[0] }}" | ||
| when: "'balancers' in group_names" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| when: "'balancers' in group_names" | |
| when: "'balancers' in group_names and inventory_hostname == groups['balancers'][0]" |
| run_once: true | ||
| ansible.builtin.command: "pgbackrest --stanza={{ pgbackrest_stanza }} --no-online stanza-create" | ||
| register: stanza_create_result | ||
| when: "'pgbackrest' in group_names" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition will not work because only the postgres_cluster group is declared in PLAY.
- name: vitabaks.autobase.deploy_pgcluster | PostgreSQL Cluster Deployment
hosts: postgres_clusterIn this case, you need a separate PLAY for the pgbackest group.
| when: not pgbouncer_auth_user|bool | ||
| when: | ||
| - not pgbouncer_auth_user|bool | ||
| - when: "'master' in group_names" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug :)
| - when: "'master' in group_names" | |
| - "'master' in group_names" |
| until: update_pgbackrest_package is success | ||
| delay: 5 | ||
| retries: 3 | ||
| when: "'pgbackrest' in group_names" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition will not work because only the "primary:secondary" groups is declared in PLAY.
- name: "(1/4) PRE-UPDATE: Perform pre-update tasks"
hosts: "primary:secondary"In this case, you need a separate PLAY for the pgbackest group.
| when: pg_path_count.stdout | int > 0 and pgbackrest_stanza_upgrade | bool | ||
| when: | ||
| - pg_path_count.stdout | int > 0 and pgbackrest_stanza_upgrade | bool | ||
| - "'pgbackrest' in group_names" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition will not work because only the "primary:secondary" groups is declared in PLAY.
- name: "(6/6) POST-UPGRADE: Analyze a PostgreSQL database (update optimizer statistics) and Post-Upgrade tasks"
hosts: "primary:secondary"
...
- name: Running Post-Upgrade tasks
ansible.builtin.include_role:
name: vitabaks.autobase.upgrade
tasks_from: post_upgradeFor this reason, delegate_to was used.
fix #1032