chore: fix syntax for ansible lint
This commit is contained in:
parent
8aa3a9cbaa
commit
118d86bfe0
5 changed files with 69 additions and 72 deletions
|
@ -1,10 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: reload icinga2
|
- name: Reload icinga2
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: icinga2
|
name: icinga2
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
||||||
- name: restart icinga2
|
- name: Restart icinga2
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: icinga2
|
name: icinga2
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
---
|
---
|
||||||
- name: install dependencies packages
|
- name: Install dependencies packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
- gpg
|
- gpg
|
||||||
retries: 2
|
|
||||||
register: result
|
|
||||||
until: result is succeeded
|
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: Add repository key
|
- name: Add repository key
|
||||||
|
@ -15,7 +12,7 @@
|
||||||
dest: /etc/apt/keyrings/icinga.asc
|
dest: /etc/apt/keyrings/icinga.asc
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: "0644"
|
||||||
checksum: sha256:be677e07972ed57b99ffc2fd211379ac11b9c6a7c8d9460086b447b96b0a82bb
|
checksum: sha256:be677e07972ed57b99ffc2fd211379ac11b9c6a7c8d9460086b447b96b0a82bb
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
|
@ -27,24 +24,21 @@
|
||||||
filename: icinga
|
filename: icinga
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: install packages
|
- name: Install packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- icinga2
|
- icinga2
|
||||||
- 'icinga2-ido-{{ icinga2_db_type }}'
|
- "icinga2-ido-{{ icinga2_db_type }}"
|
||||||
- icingacli
|
- icingacli
|
||||||
- monitoring-plugins
|
- monitoring-plugins
|
||||||
- nagios-nrpe-plugin
|
- nagios-nrpe-plugin
|
||||||
retries: 2
|
|
||||||
register: result
|
|
||||||
until: result is succeeded
|
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: create certs directory
|
- name: Create certs directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /var/lib/icinga2/certs
|
path: /var/lib/icinga2/certs
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0750
|
mode: "0750"
|
||||||
state: directory
|
state: directory
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
108
tasks/config.yml
108
tasks/config.yml
|
@ -1,30 +1,30 @@
|
||||||
---
|
---
|
||||||
- name: remove old config files
|
- name: Remove old config files
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /etc/icinga2/conf.d/apt.conf
|
path: /etc/icinga2/conf.d/apt.conf
|
||||||
state: absent
|
state: absent
|
||||||
notify: reload icinga2
|
notify: Reload icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy scripts
|
- name: Copy scripts
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
content: '{{ item.value }}'
|
content: "{{ item.value }}"
|
||||||
dest: '/etc/icinga2/scripts/{{ item.key }}'
|
dest: "/etc/icinga2/scripts/{{ item.key }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0750
|
mode: "0750"
|
||||||
loop: '{{ icinga2_scripts | dict2items }}'
|
loop: "{{ icinga2_scripts | dict2items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: '{{ item.key }}'
|
label: "{{ item.key }}"
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy config files
|
- name: Copy config files
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: '{{ item }}.conf.j2'
|
src: "{{ item }}.conf.j2"
|
||||||
dest: '/etc/icinga2/conf.d/{{ item }}.conf'
|
dest: "/etc/icinga2/conf.d/{{ item }}.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
loop:
|
loop:
|
||||||
- check_commands
|
- check_commands
|
||||||
- commands
|
- commands
|
||||||
|
@ -36,95 +36,95 @@
|
||||||
- templates
|
- templates
|
||||||
- timeperiods
|
- timeperiods
|
||||||
- users
|
- users
|
||||||
notify: reload icinga2
|
notify: Reload icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy zones config files
|
- name: Copy zones config files
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: zones.conf.j2
|
src: zones.conf.j2
|
||||||
dest: /etc/icinga2/zones.conf
|
dest: /etc/icinga2/zones.conf
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
notify: reload icinga2
|
notify: Reload icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy ido config file
|
- name: Copy ido config file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: ido-db.conf.j2
|
src: ido-db.conf.j2
|
||||||
dest: /etc/icinga2/conf.d/ido-db.conf
|
dest: /etc/icinga2/conf.d/ido-db.conf
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
notify: restart icinga2
|
notify: Restart icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy api SSL key
|
- name: Copy api SSL key
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
content: '{{ icinga2_api_ssl_node_key }}'
|
content: "{{ icinga2_api_ssl_node_key }}"
|
||||||
dest: '/var/lib/icinga2/certs/{{ inventory_hostname }}.key'
|
dest: "/var/lib/icinga2/certs/{{ inventory_hostname }}.key"
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
when: '"api" in icinga2_features'
|
when: "'api' in icinga2_features"
|
||||||
notify: restart icinga2
|
notify: Restart icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy api SSL certificate
|
- name: Copy api SSL certificate
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
content: '{{ icinga2_api_ssl_node_crt }}'
|
content: "{{ icinga2_api_ssl_node_crt }}"
|
||||||
dest: '/var/lib/icinga2/certs/{{ inventory_hostname }}.crt'
|
dest: "/var/lib/icinga2/certs/{{ inventory_hostname }}.crt"
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
when: '"api" in icinga2_features'
|
when: "'api' in icinga2_features"
|
||||||
notify: restart icinga2
|
notify: Restart icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy api SSL ca certifiacte
|
- name: Copy api SSL ca certifiacte
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
content: '{{ icinga2_api_ssl_ca_crt }}'
|
content: "{{ icinga2_api_ssl_ca_crt }}"
|
||||||
dest: '{{ item }}/ca.crt'
|
dest: "{{ item }}/ca.crt"
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
when: '"api" in icinga2_features'
|
when: "'api' in icinga2_features"
|
||||||
loop:
|
loop:
|
||||||
- /var/lib/icinga2/certs
|
- /var/lib/icinga2/certs
|
||||||
- /etc/icinga2/pki
|
- /etc/icinga2/pki
|
||||||
notify: restart icinga2
|
notify: Restart icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy api SSL ca key
|
- name: Copy api SSL ca key
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
content: '{{ icinga2_api_ssl_ca_key }}'
|
content: "{{ icinga2_api_ssl_ca_key }}"
|
||||||
dest: /etc/icinga2/pki/ca.key
|
dest: /etc/icinga2/pki/ca.key
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
when: '"api" in icinga2_features and icinga2_master'
|
when: "'api' in icinga2_features and icinga2_master"
|
||||||
notify: restart icinga2
|
notify: Restart icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: copy feature config files
|
- name: Copy feature config files
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: feature.conf.j2
|
src: feature.conf.j2
|
||||||
dest: '/etc/icinga2/features-available/{{ item.key }}.conf'
|
dest: "/etc/icinga2/features-available/{{ item.key }}.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: nagios
|
group: nagios
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
loop: '{{ icinga2_features | dict2items }}'
|
loop: "{{ icinga2_features | dict2items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: '{{ item.key }}'
|
label: "{{ item.key }}"
|
||||||
notify: restart icinga2
|
notify: Restart icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
||||||
- name: manage features
|
- name: Manage features
|
||||||
community.general.icinga2_feature:
|
community.general.icinga2_feature:
|
||||||
name: '{{ item.key }}'
|
name: "{{ item.key }}"
|
||||||
state: '{{ item.state | default("present") }}'
|
state: "{{ item.state | default('present') }}"
|
||||||
loop: '{{ icinga2_features | dict2items }}'
|
loop: "{{ icinga2_features | dict2items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: '{{ item.key }}'
|
label: "{{ item.key }}"
|
||||||
notify: restart icinga2
|
notify: Restart icinga2
|
||||||
tags: icinga2
|
tags: icinga2
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
---
|
---
|
||||||
- import_tasks: base.yml
|
- name: Import base
|
||||||
- import_tasks: config.yml
|
ansible.builtin.import_tasks: base.yml
|
||||||
- import_tasks: service.yml
|
- name: Import config
|
||||||
|
ansible.builtin.import_tasks: config.yml
|
||||||
|
- name: Import service
|
||||||
|
ansible.builtin.import_tasks: service.yml
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: enable and start service
|
- name: Enable and start service
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: icinga2
|
name: icinga2
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
Loading…
Reference in a new issue