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
Tags 2.7.0
No related merge requests found
Pipeline #23910 passed
......@@ -45,7 +45,7 @@
# Note this removes remote nodes from the list
- name: Set an array of all configured Icinga agent nodes for Ansible >= 2.13
ansible.builtin.set_fact:
icinga_hosts_existing: "{{ icinga_hosts | default([]) + [ host.host_name ] }}"
icinga_hosts_existing: "{{ icinga_hosts | default([]) + [host.host_name] }}"
when:
- ansible_version.full is version('2.13.0', '>=')
- host.host_name not in groups['icinga_remote_nodes']
......@@ -76,12 +76,12 @@
- name: Print Icinga agent nodes that need to be configured
ansible.builtin.debug:
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:
- ( icinga_which_icingacli.rc == 0 )
- ( 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'] )
- (icinga_which_icingacli.rc == 0)
- (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'])
tags:
- icinga
...
......@@ -14,34 +14,34 @@
ansible.builtin.debug:
msg: "{{ groups['icinga_agent_nodes'] }}"
verbosity: 2
when: ( groups['icinga_agent_nodes'] is defined )
when: (groups['icinga_agent_nodes'] is defined)
- name: Debug groups['icinga_remote_nodes']
ansible.builtin.debug:
msg: "{{ groups['icinga_remote_nodes'] }}"
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
ansible.builtin.set_fact:
icinga_agent_node_hosts_required: "{{ groups['icinga_remote_nodes'] }}"
when:
- ( 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_agent_nodes'] is not defined) or (groups['icinga_agent_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
ansible.builtin.set_fact:
icinga_agent_node_hosts_required: "{{ groups['icinga_agent_nodes'] }}"
when:
- ( 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_agent_nodes'] is defined) and (groups['icinga_agent_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
ansible.builtin.set_fact:
icinga_agent_node_hosts_required: "{{ groups['icinga_agent_nodes'] + groups['icinga_remote_nodes'] }}"
when:
- ( groups['icinga_agent_nodes'] is defined ) and ( groups['icinga_agent_nodes'] != [] )
- ( groups['icinga_remote_nodes'] is defined ) and ( groups['icinga_remote_nodes'] != [] )
- (groups['icinga_agent_nodes'] is defined) and (groups['icinga_agent_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
ansible.builtin.debug:
......@@ -71,7 +71,7 @@
- name: Generate a list of all Icinga node hostnames on the master node for Ansible < 2.13
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_control:
loop_var: file
......@@ -80,7 +80,7 @@
- name: Generate a list of all Icinga node hostnames on the master node for Ansible >= 2.13
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_control:
loop_var: file
......@@ -111,8 +111,8 @@
label: "{{ host }}"
when:
- ( icinga_agent_node_host_files is defined )
- ( icinga_agent_node_host_files.matched > 0 )
- (icinga_agent_node_host_files is defined)
- (icinga_agent_node_host_files.matched > 0)
tags:
- icinga
......@@ -128,8 +128,8 @@
# - name: Check that agent node hosts are connected
when:
- ( 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'] )
- (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'])
tags:
- icinga
...
......@@ -64,7 +64,7 @@
- name: Generate an array of all Icinga API user files for Ansible < 2.13
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_control:
loop_var: file
......@@ -73,7 +73,7 @@
- name: Generate an array of all Icinga API user files for Ansible >= 2.13
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_control:
loop_var: file
......@@ -104,8 +104,8 @@
label: "{{ user }}"
when:
- ( icinga_api_user_files is defined )
- ( icinga_api_user_files.matched > 0 )
- (icinga_api_user_files is defined)
- (icinga_api_user_files.matched > 0)
tags:
- icinga
......@@ -117,9 +117,9 @@
label: "{{ user.key }}"
when:
- ( icinga_api_users is defined )
- ( 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'] )
- (icinga_api_users is defined)
- (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'])
tags:
- 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