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
1e393676
Verified
Commit
1e393676
authored
11 months ago
by
Chris Croome
Browse files
Options
Downloads
Patches
Plain Diff
updates
parent
6e1fbadd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#33158
passed
11 months ago
Stage: bookworm
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.pre-commit-config.yaml
+3
-3
3 additions, 3 deletions
.pre-commit-config.yaml
tasks/check.yml
+3
-3
3 additions, 3 deletions
tasks/check.yml
templates/host.conf.j2
+18
-14
18 additions, 14 deletions
templates/host.conf.j2
with
24 additions
and
20 deletions
.pre-commit-config.yaml
+
3
−
3
View file @
1e393676
...
...
@@ -25,7 +25,7 @@ repos:
-
templates
# https://github.com/jackdewinter/pymarkdown/releases
-
repo
:
https://github.com/jackdewinter/pymarkdown.git
rev
:
0.9.1
6
rev
:
v
0.9.1
8
hooks
:
-
id
:
pymarkdown
name
:
Markdown Lint
...
...
@@ -34,14 +34,14 @@ repos:
-
README.md
# https://github.com/ansible/ansible-lint/releases
-
repo
:
https://github.com/ansible/ansible-lint.git
rev
:
v24.2.
0
rev
:
v24.2.
2
hooks
:
-
id
:
ansible-lint
name
:
Ansible Lint
language
:
python
additional_dependencies
:
# https://github.com/kellyjonbrazil/jc/releases
-
jc==1.25.
0
-
jc==1.25.
2
# https://github.com/jmespath/jmespath.py/tags
-
jmespath==1.0.1
...
This diff is collapsed.
Click to expand it.
tasks/check.yml
+
3
−
3
View file @
1e393676
...
...
@@ -20,12 +20,12 @@
-
name
:
"
Ensure
that
ansible_host
is
defined
for
the
icinga_master_nodes"
ansible.builtin.assert
:
that
:
-
hostvars[icinga_master_node].ansible_host is defined
-
hostvars[icinga_master_node].ansible_host is ansible.utils.ip
-
hostvars[icinga_master_node
_item
].ansible_host is defined
-
hostvars[icinga_master_node
_item
].ansible_host is ansible.utils.ip
quiet
:
"
{%
if
ansible_verbosity
==
0
%}true{%
else
%}false{%
endif
%}"
loop
:
"
{{
groups['icinga_master_nodes']
}}"
loop_control
:
loop_var
:
icinga_master_node
loop_var
:
icinga_master_node
_item
when
:
-
groups['icinga_master_nodes'] is defined
-
groups['icinga_master_nodes'] | length >
0
...
...
This diff is collapsed.
Click to expand it.
templates/host.conf.j2
+
18
−
14
View file @
1e393676
...
...
@@ -8,7 +8,7 @@ object Host "{{ icinga_host }}" {
vars.agent_endpoint = name
{% endif %}
{% if icinga_remote_node is defined and not icinga_remote_node %}
{% if icinga_remote_node is defined and not icinga_remote_node
| bool
%}
{% if hostvars[icinga_host]['ansible_system'] is defined %}
vars.os = "{{ hostvars[icinga_host]['ansible_system'] }}"
{% endif %}
...
...
@@ -17,28 +17,32 @@ object Host "{{ icinga_host }}" {
{% endif %}
{% endif %}
{% for
check,
config in icinga_host_checks.items() %}
vars.checks["{{ check }}"] = {
{% if config.command is defined %}
"command" = "{{ config.command }}",
{% for
icinga_check, icinga_
config in icinga_host_checks.items() %}
vars.checks["{{
icinga_
check }}"] = {
{% if
icinga_
config.command is defined %}
"command" = "{{
icinga_
config.command }}",
{% else %}
"command" = "{{ check }}",
"command" = "{{
icinga_
check }}",
{% endif %}
{% if config.remote is defined %}
"remote" = {
%
i
f
config.remote |
bool %}true{% else %}false{% endif %
},
{% elif check is regex('^dns|http|ping|ssh$') %}
{% if
icinga_
config.remote is defined
and icinga_config.remote | ansible.builtin.type_debug == "bool"
%}
"remote" = {
{
i
cinga_
config.remote |
lower }
},
{% elif
icinga_
check is regex('^dns|http|ping|ssh$') %}
{# run dns, http, ping and ssh checks from the master #}
"remote" = false,
{% elif config.command is defined and config.command is regex('^dns|http|ping|ssh$') %}
{% elif
icinga_
config.command is defined and
icinga_
config.command is regex('^dns|http|ping|ssh$') %}
{# run dns, http, ping and ssh checks from the master #}
"remote" = false,
{% else %}
{# default to running checks on the agent #}
"remote" = true,
{% endif %}
{% if config.args is defined %}
{% for key, value in config.args.items() %}
args["{{ key }}"] = "{{ value }}",
{% if icinga_config.args is defined %}
{% for icinga_config_key, icinga_config_value in icinga_config.args.items() %}
{% if icinga_config_value | ansible.builtin.type_debug == "bool" %}
args["{{ icinga_config_key }}"] = "{{ icinga_config_value | lower }}",
{% else %}
args["{{ icinga_config_key }}"] = "{{ icinga_config_value }}",
{% endif %}
{% endfor %}
{% endif %}
}
...
...
@@ -50,4 +54,4 @@ object Host "{{ icinga_host }}" {
}
# vim: set syntax=icinga2
#
{# vim: set syntax=jinja2 #}
vim: set syntax=icinga2
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