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
service:
ansible.builtin.service:
name: icinga2
state: reloaded
- name: restart icinga2
service:
ansible.builtin.service:
name: icinga2
state: restarted

View file

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

View file

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

View file

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

View file

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

View file

@ -1,13 +1,13 @@
---
- name: remove old config files
file:
ansible.builtin.file:
path: /etc/icinga2/conf.d/apt.conf
state: absent
notify: reload icinga2
tags: icinga2
- name: copy config files
template:
ansible.builtin.template:
src: '{{ item }}.conf.j2'
dest: '/etc/icinga2/conf.d/{{ item }}.conf'
owner: root
@ -26,7 +26,7 @@
tags: icinga2
- name: copy zones config files
template:
ansible.builtin.template:
src: zones.conf.j2
dest: /etc/icinga2/zones.conf
owner: root
@ -36,7 +36,7 @@
tags: icinga2
- name: copy ido config file
template:
ansible.builtin.template:
src: ido-db.conf.j2
dest: /etc/icinga2/conf.d/ido-db.conf
owner: root
@ -46,7 +46,7 @@
tags: icinga2
- name: copy api SSL key
copy:
ansible.builtin.copy:
content: '{{ icinga2_api_ssl_node_key }}'
dest: '/var/lib/icinga2/certs/{{ inventory_hostname }}.key'
owner: root
@ -57,7 +57,7 @@
tags: icinga2
- name: copy api SSL certificate
copy:
ansible.builtin.copy:
content: '{{ icinga2_api_ssl_node_crt }}'
dest: '/var/lib/icinga2/certs/{{ inventory_hostname }}.crt'
owner: root
@ -68,7 +68,7 @@
tags: icinga2
- name: copy api SSL ca certifiacte
copy:
ansible.builtin.copy:
content: '{{ icinga2_api_ssl_ca_crt }}'
dest: '{{ item }}/ca.crt'
owner: root
@ -82,7 +82,7 @@
tags: icinga2
- name: copy api SSL ca key
copy:
ansible.builtin.copy:
content: '{{ icinga2_api_ssl_ca_key }}'
dest: /etc/icinga2/pki/ca.key
owner: root
@ -93,7 +93,7 @@
tags: icinga2
- name: copy feature config files
template:
ansible.builtin.template:
src: feature.conf.j2
dest: '/etc/icinga2/features-available/{{ item.key }}.conf'
owner: root
@ -106,7 +106,7 @@
tags: icinga2
- name: manage features
icinga2_feature:
community.general.icinga2_feature:
name: '{{ item.key }}'
state: '{{ item.state|default("present") }}'
loop: '{{ icinga2_features|dict2items }}'

View file

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