Skip to content
Snippets Groups Projects
Commit 3446cc44 authored by Chris Croome's avatar Chris Croome
Browse files

whitespace tweaks

parent 9ecf3daf
No related branches found
No related tags found
No related merge requests found
Pipeline #23910 passed
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
# Note this removes remote nodes from the list # Note this removes remote nodes from the list
- name: Set an array of all configured Icinga agent nodes for Ansible >= 2.13 - name: Set an array of all configured Icinga agent nodes for Ansible >= 2.13
ansible.builtin.set_fact: ansible.builtin.set_fact:
icinga_hosts_existing: "{{ icinga_hosts | default([]) + [ host.host_name ] }}" icinga_hosts_existing: "{{ icinga_hosts | default([]) + [host.host_name] }}"
when: when:
- ansible_version.full is version('2.13.0', '>=') - ansible_version.full is version('2.13.0', '>=')
- host.host_name not in groups['icinga_remote_nodes'] - host.host_name not in groups['icinga_remote_nodes']
...@@ -76,12 +76,12 @@ ...@@ -76,12 +76,12 @@
- name: Print Icinga agent nodes that need to be configured - name: Print Icinga agent nodes that need to be configured
ansible.builtin.debug: ansible.builtin.debug:
var: icinga_hosts_missing var: icinga_hosts_missing
when: ( icinga_hosts_missing is defined ) and ( icinga_hosts_missing | length > 0 ) when: (icinga_hosts_missing is defined) and (icinga_hosts_missing | length > 0)
when: when:
- ( icinga_which_icingacli.rc == 0 ) - (icinga_which_icingacli.rc == 0)
- ( groups['icinga_master_nodes'] is defined ) and ( groups['icinga_agent_nodes'] is defined ) - (groups['icinga_master_nodes'] is defined) and (groups['icinga_agent_nodes'] is defined)
- ( inventory_hostname in groups['icinga_master_nodes'] ) or ( inventory_hostname in groups['icinga_agent_nodes'] ) - (inventory_hostname in groups['icinga_master_nodes']) or (inventory_hostname in groups['icinga_agent_nodes'])
tags: tags:
- icinga - icinga
... ...
...@@ -14,34 +14,34 @@ ...@@ -14,34 +14,34 @@
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ groups['icinga_agent_nodes'] }}" msg: "{{ groups['icinga_agent_nodes'] }}"
verbosity: 2 verbosity: 2
when: ( groups['icinga_agent_nodes'] is defined ) when: (groups['icinga_agent_nodes'] is defined)
- name: Debug groups['icinga_remote_nodes'] - name: Debug groups['icinga_remote_nodes']
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ groups['icinga_remote_nodes'] }}" msg: "{{ groups['icinga_remote_nodes'] }}"
verbosity: 2 verbosity: 2
when: ( groups['icinga_remote_nodes'] is defined ) when: (groups['icinga_remote_nodes'] is defined)
- name: Set a fact for the list of the node hosts required on the master node when there are only remote nodes - name: Set a fact for the list of the node hosts required on the master node when there are only remote nodes
ansible.builtin.set_fact: ansible.builtin.set_fact:
icinga_agent_node_hosts_required: "{{ groups['icinga_remote_nodes'] }}" icinga_agent_node_hosts_required: "{{ groups['icinga_remote_nodes'] }}"
when: when:
- ( groups['icinga_agent_nodes'] is not defined ) or ( groups['icinga_agent_nodes'] == [] ) - (groups['icinga_agent_nodes'] is not defined) or (groups['icinga_agent_nodes'] == [])
- ( groups['icinga_remote_nodes'] is defined ) and ( groups['icinga_remote_nodes'] != [] ) - (groups['icinga_remote_nodes'] is defined) and (groups['icinga_remote_nodes'] != [])
- name: Set a fact for the list of the node hosts required on the master node when there are only agent nodes - name: Set a fact for the list of the node hosts required on the master node when there are only agent nodes
ansible.builtin.set_fact: ansible.builtin.set_fact:
icinga_agent_node_hosts_required: "{{ groups['icinga_agent_nodes'] }}" icinga_agent_node_hosts_required: "{{ groups['icinga_agent_nodes'] }}"
when: when:
- ( groups['icinga_agent_nodes'] is defined ) and ( groups['icinga_agent_nodes'] != [] ) - (groups['icinga_agent_nodes'] is defined) and (groups['icinga_agent_nodes'] != [])
- ( groups['icinga_remote_nodes'] is not defined ) or ( groups['icinga_remote_nodes'] == [] ) - (groups['icinga_remote_nodes'] is not defined) or (groups['icinga_remote_nodes'] == [])
- name: Set a fact for the list of the node hosts required on the master node when there are both remote nodes and agent nodes - name: Set a fact for the list of the node hosts required on the master node when there are both remote nodes and agent nodes
ansible.builtin.set_fact: ansible.builtin.set_fact:
icinga_agent_node_hosts_required: "{{ groups['icinga_agent_nodes'] + groups['icinga_remote_nodes'] }}" icinga_agent_node_hosts_required: "{{ groups['icinga_agent_nodes'] + groups['icinga_remote_nodes'] }}"
when: when:
- ( groups['icinga_agent_nodes'] is defined ) and ( groups['icinga_agent_nodes'] != [] ) - (groups['icinga_agent_nodes'] is defined) and (groups['icinga_agent_nodes'] != [])
- ( groups['icinga_remote_nodes'] is defined ) and ( groups['icinga_remote_nodes'] != [] ) - (groups['icinga_remote_nodes'] is defined) and (groups['icinga_remote_nodes'] != [])
- name: Print the list of agent node hosts required on the master node - name: Print the list of agent node hosts required on the master node
ansible.builtin.debug: ansible.builtin.debug:
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
- name: Generate a list of all Icinga node hostnames on the master node for Ansible < 2.13 - name: Generate a list of all Icinga node hostnames on the master node for Ansible < 2.13
ansible.builtin.set_fact: ansible.builtin.set_fact:
icinga_agent_node_hosts_present: "{{ icinga_agent_node_hosts_present | default ([]) }} + [ '{{ file.path | basename | regex_replace('[.]conf$') }}' ]" icinga_agent_node_hosts_present: "{{ icinga_agent_node_hosts_present | default ([]) }} + ['{{ file.path | basename | regex_replace('[.]conf$') }}']"
loop: "{{ icinga_agent_node_host_files.files }}" loop: "{{ icinga_agent_node_host_files.files }}"
loop_control: loop_control:
loop_var: file loop_var: file
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
- name: Generate a list of all Icinga node hostnames on the master node for Ansible >= 2.13 - name: Generate a list of all Icinga node hostnames on the master node for Ansible >= 2.13
ansible.builtin.set_fact: ansible.builtin.set_fact:
icinga_agent_node_hosts_present: "{{ icinga_agent_node_hosts_present | default ([]) + [ file.path | basename | regex_replace('[.]conf$') ] }}" icinga_agent_node_hosts_present: "{{ icinga_agent_node_hosts_present | default ([]) + [file.path | basename | regex_replace('[.]conf$')] }}"
loop: "{{ icinga_agent_node_host_files.files }}" loop: "{{ icinga_agent_node_host_files.files }}"
loop_control: loop_control:
loop_var: file loop_var: file
...@@ -111,8 +111,8 @@ ...@@ -111,8 +111,8 @@
label: "{{ host }}" label: "{{ host }}"
when: when:
- ( icinga_agent_node_host_files is defined ) - (icinga_agent_node_host_files is defined)
- ( icinga_agent_node_host_files.matched > 0 ) - (icinga_agent_node_host_files.matched > 0)
tags: tags:
- icinga - icinga
...@@ -128,8 +128,8 @@ ...@@ -128,8 +128,8 @@
# - name: Check that agent node hosts are connected # - name: Check that agent node hosts are connected
when: when:
- ( icinga_master_node is defined ) and ( inventory_hostname == icinga_master_node ) - (icinga_master_node is defined) and (inventory_hostname == icinga_master_node)
- ( groups['icinga_master_nodes'] is defined ) and ( inventory_hostname in groups['icinga_master_nodes'] ) - (groups['icinga_master_nodes'] is defined) and (inventory_hostname in groups['icinga_master_nodes'])
tags: tags:
- icinga - icinga
... ...
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
- name: Generate an array of all Icinga API user files for Ansible < 2.13 - name: Generate an array of all Icinga API user files for Ansible < 2.13
ansible.builtin.set_fact: ansible.builtin.set_fact:
icinga_api_users_present: "{{ icinga_api_users_present | default ([]) }} + [ '{{ file.path | basename | regex_replace('[.]conf$') }}' ]" icinga_api_users_present: "{{ icinga_api_users_present | default ([]) }} + ['{{ file.path | basename | regex_replace('[.]conf$') }}']"
loop: "{{ icinga_api_user_files.files }}" loop: "{{ icinga_api_user_files.files }}"
loop_control: loop_control:
loop_var: file loop_var: file
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
- name: Generate an array of all Icinga API user files for Ansible >= 2.13 - name: Generate an array of all Icinga API user files for Ansible >= 2.13
ansible.builtin.set_fact: ansible.builtin.set_fact:
icinga_api_users_present: "{{ icinga_api_users_present | default ([]) + [ file.path | basename | regex_replace('[.]conf$') ] }}" icinga_api_users_present: "{{ icinga_api_users_present | default ([]) + [file.path | basename | regex_replace('[.]conf$')] }}"
loop: "{{ icinga_api_user_files.files }}" loop: "{{ icinga_api_user_files.files }}"
loop_control: loop_control:
loop_var: file loop_var: file
...@@ -104,8 +104,8 @@ ...@@ -104,8 +104,8 @@
label: "{{ user }}" label: "{{ user }}"
when: when:
- ( icinga_api_user_files is defined ) - (icinga_api_user_files is defined)
- ( icinga_api_user_files.matched > 0 ) - (icinga_api_user_files.matched > 0)
tags: tags:
- icinga - icinga
...@@ -117,9 +117,9 @@ ...@@ -117,9 +117,9 @@
label: "{{ user.key }}" label: "{{ user.key }}"
when: when:
- ( icinga_api_users is defined ) - (icinga_api_users is defined)
- ( icinga_master_node is defined ) and ( inventory_hostname == icinga_master_node ) - (icinga_master_node is defined) and (inventory_hostname == icinga_master_node)
- ( groups['icinga_master_nodes'] is defined ) and ( inventory_hostname in groups['icinga_master_nodes'] ) - (groups['icinga_master_nodes'] is defined) and (inventory_hostname in groups['icinga_master_nodes'])
tags: tags:
- icinga - icinga
... ...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment