chore: use FQCN for module name

This commit is contained in:
Adrien Waksberg 2021-08-15 18:15:12 +02:00 committed by Adrien Waksberg
parent fbe581d54e
commit 123156f412
7 changed files with 23 additions and 21 deletions

View file

@ -1,10 +1,10 @@
--- ---
- name: reload icinga2 - name: reload icinga2
service: ansible.builtin.service:
name: icinga2 name: icinga2
state: reloaded state: reloaded
- name: restart icinga2 - name: restart icinga2
service: ansible.builtin.service:
name: icinga2 name: icinga2
state: restarted state: restarted

View file

@ -1,5 +1,6 @@
--- ---
galaxy_info: galaxy_info:
role_name: icinga2
author: Adrien Waksberg author: Adrien Waksberg
company: Adrien Waksberg company: Adrien Waksberg
description: Install and configure Icinga2 description: Install and configure Icinga2

View file

@ -5,7 +5,7 @@
- ansible-role-icinga2 - ansible-role-icinga2
pre_tasks: pre_tasks:
- name: update apt cache - name: update apt cache
apt: ansible.builtin.apt:
update_cache: true update_cache: true
vars: vars:
icinga2_ido_host: 127.0.0.1 icinga2_ido_host: 127.0.0.1

View file

@ -13,6 +13,6 @@ platforms:
lint: | lint: |
set -e set -e
yamllint . yamllint .
ansible-lint ansible-lint .
verifier: verifier:
name: testinfra name: testinfra

View file

@ -1,14 +1,15 @@
--- ---
- name: install dependencies packages - name: install dependencies packages
package: ansible.builtin.package:
name: apt-transport-https name:
- apt-transport-https
retries: 2 retries: 2
register: result register: result
until: result is succeeded until: result is succeeded
tags: icinga2 tags: icinga2
- name: add key repository - name: add key repository
apt_key: ansible.builtin.apt_key:
url: https://packages.icinga.com/icinga.key url: https://packages.icinga.com/icinga.key
retries: 2 retries: 2
register: result register: result
@ -16,7 +17,7 @@
tags: icinga2 tags: icinga2
- name: add repository - name: add repository
apt_repository: ansible.builtin.apt_repository:
repo: 'deb https://packages.icinga.com/debian icinga-{{ ansible_distribution_release }} main' repo: 'deb https://packages.icinga.com/debian icinga-{{ ansible_distribution_release }} main'
retries: 2 retries: 2
register: result register: result
@ -24,7 +25,7 @@
tags: icinga2 tags: icinga2
- name: install packages - name: install packages
package: ansible.builtin.package:
name: name:
- icinga2 - icinga2
- 'icinga2-ido-{{ icinga2_db_type }}' - 'icinga2-ido-{{ icinga2_db_type }}'
@ -36,7 +37,7 @@
tags: icinga2 tags: icinga2
- name: create certs directory - name: create certs directory
file: ansible.builtin.file:
path: /var/lib/icinga2/certs path: /var/lib/icinga2/certs
owner: root owner: root
group: nagios group: nagios

View file

@ -1,13 +1,13 @@
--- ---
- name: remove old config files - name: remove old config files
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 config files - name: copy config files
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
@ -26,7 +26,7 @@
tags: icinga2 tags: icinga2
- name: copy zones config files - name: copy zones config files
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
@ -36,7 +36,7 @@
tags: icinga2 tags: icinga2
- name: copy ido config file - name: copy ido config file
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
@ -46,7 +46,7 @@
tags: icinga2 tags: icinga2
- name: copy api SSL key - name: copy api SSL key
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
@ -57,7 +57,7 @@
tags: icinga2 tags: icinga2
- name: copy api SSL certificate - name: copy api SSL certificate
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
@ -68,7 +68,7 @@
tags: icinga2 tags: icinga2
- name: copy api SSL ca certifiacte - name: copy api SSL ca certifiacte
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
@ -82,7 +82,7 @@
tags: icinga2 tags: icinga2
- name: copy api SSL ca key - name: copy api SSL ca key
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
@ -93,7 +93,7 @@
tags: icinga2 tags: icinga2
- name: copy feature config files - name: copy feature config files
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
@ -106,7 +106,7 @@
tags: icinga2 tags: icinga2
- name: manage features - name: manage features
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 }}'

View file

@ -1,6 +1,6 @@
--- ---
- name: enable and start service - name: enable and start service
service: ansible.builtin.service:
name: icinga2 name: icinga2
enabled: true enabled: true
state: started state: started