Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
icinga
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
webarch
icinga
Commits
3446cc44
Commit
3446cc44
authored
2 years ago
by
Chris Croome
Browse files
Options
Downloads
Patches
Plain Diff
whitespace tweaks
parent
9ecf3daf
No related branches found
Branches containing commit
Tags
2.7.0
Tags containing commit
No related merge requests found
Pipeline
#23910
passed
2 years ago
Stage: lint
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tasks/agent_check.yml
+5
-5
5 additions, 5 deletions
tasks/agent_check.yml
tasks/master_agents.yml
+14
-14
14 additions, 14 deletions
tasks/master_agents.yml
tasks/master_api.yml
+7
-7
7 additions, 7 deletions
tasks/master_api.yml
with
26 additions
and
26 deletions
tasks/agent_check.yml
+
5
−
5
View file @
3446cc44
...
...
@@ -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
...
This diff is collapsed.
Click to expand it.
tasks/master_agents.yml
+
14
−
14
View file @
3446cc44
...
...
@@ -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
...
This diff is collapsed.
Click to expand it.
tasks/master_api.yml
+
7
−
7
View file @
3446cc44
...
...
@@ -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
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment