-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this drops the following parameters: - monitor_address_block - monitor_interface - monitor_address The monitor address will be automatically set from `public_network` parameter. Signed-off-by: Guillaume Abrioux <[email protected]>
- Loading branch information
Showing
71 changed files
with
58 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,14 @@ | ||
--- | ||
- name: Set_fact _monitor_addresses to monitor_address_block ipv4 | ||
- name: Set_fact _monitor_addresses - ipv4 | ||
ansible.builtin.set_fact: | ||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{'name': item, 'addr': hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(hostvars[item]['monitor_address_block'].split(',')) | first}] }}" | ||
_monitor_addresses: "{{ _monitor_addresses | default({}) | combine({item: hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(hostvars[item]['public_network'].split(',')) | first}) }}" | ||
with_items: "{{ groups.get(mon_group_name, []) }}" | ||
when: | ||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list" | ||
- hostvars[item]['monitor_address_block'] is defined | ||
- hostvars[item]['monitor_address_block'] != 'subnet' | ||
- ip_version == 'ipv4' | ||
|
||
- name: Set_fact _monitor_addresses to monitor_address_block ipv6 | ||
- name: Set_fact _monitor_addresses - ipv6 | ||
ansible.builtin.set_fact: | ||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{'name': item, 'addr': hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[item]['monitor_address_block'].split(',')) | last | ansible.utils.ipwrap}] }}" | ||
_monitor_addresses: "{{ _monitor_addresses | default({}) | combine({item: hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[item]['public_network'].split(',')) | last | ansible.utils.ipwrap}) }}" | ||
with_items: "{{ groups.get(mon_group_name, []) }}" | ||
when: | ||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list" | ||
- hostvars[item]['monitor_address_block'] is defined | ||
- hostvars[item]['monitor_address_block'] != 'subnet' | ||
- ip_version == 'ipv6' | ||
|
||
- name: Set_fact _monitor_addresses to monitor_address | ||
ansible.builtin.set_fact: | ||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{'name': item, 'addr': hostvars[item]['monitor_address'] | ansible.utils.ipwrap}] }}" | ||
with_items: "{{ groups.get(mon_group_name, []) }}" | ||
when: | ||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list" | ||
- hostvars[item]['monitor_address'] is defined | ||
- hostvars[item]['monitor_address'] != 'x.x.x.x' | ||
|
||
- name: Set_fact _monitor_addresses to monitor_interface - ipv4 | ||
ansible.builtin.set_fact: | ||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{'name': item, 'addr': hostvars[item]['ansible_facts'][(hostvars[item]['monitor_interface'] | replace('-', '_'))][ip_version]['address'] | ansible.utils.ipwrap}] }}" | ||
with_items: "{{ groups.get(mon_group_name, []) }}" | ||
when: | ||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list" | ||
- ip_version == 'ipv4' | ||
- hostvars[item]['monitor_address_block'] | default('subnet') == 'subnet' | ||
- hostvars[item]['monitor_address'] | default('x.x.x.x') == 'x.x.x.x' | ||
- hostvars[item]['monitor_interface'] | default('interface') != 'interface' | ||
|
||
- name: Set_fact _monitor_addresses to monitor_interface - ipv6 | ||
ansible.builtin.set_fact: | ||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{'name': item, 'addr': hostvars[item]['ansible_facts'][(hostvars[item]['monitor_interface'] | replace('-', '_'))][ip_version][0]['address'] | ansible.utils.ipwrap}] }}" | ||
with_items: "{{ groups.get(mon_group_name, []) }}" | ||
when: | ||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list" | ||
- ip_version == 'ipv6' | ||
- hostvars[item]['monitor_address_block'] | default('subnet') == 'subnet' | ||
- hostvars[item]['monitor_address'] | default('x.x.x.x') == 'x.x.x.x' | ||
- hostvars[item]['monitor_interface'] | default('interface') != 'interface' | ||
|
||
- name: Set_fact _current_monitor_address | ||
ansible.builtin.set_fact: | ||
_current_monitor_address: "{{ item.addr }}" | ||
with_items: "{{ _monitor_addresses }}" | ||
when: | ||
- (inventory_hostname == item.name and not rolling_update | default(False) | bool) | ||
or (rolling_update | default(False) | bool and item.name == groups.get(mon_group_name, [])[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
- name: Check if network interface has an IP address in `monitor_address_block` | ||
- name: Check if network interface has an IP address in public_network | ||
ansible.builtin.fail: | ||
msg: "{{ inventory_hostname }} does not have any {{ ip_version }} address on {{ monitor_address_block }}" | ||
when: hostvars[inventory_hostname]['ansible_facts']['all_' + ip_version + '_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['monitor_address_block'].split(',')) | length == 0 | ||
msg: "{{ inventory_hostname }} does not have any {{ ip_version }} address on {{ public_network }}" | ||
when: hostvars[inventory_hostname]['ansible_facts']['all_' + ip_version + '_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['public_network'].split(',')) | length == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.