From 12df029a7bb4fbbdf64ac29eb056ef15eaeb2750 Mon Sep 17 00:00:00 2001 From: hbaxter Date: Fri, 4 Jul 2025 11:25:09 +0100 Subject: [PATCH] Refactor: Tidy Ansible folder --- ANSIBLE/icinga.yml | 1 - ANSIBLE/roles/icinga2/tasks/icinga2-ido.yml | 7 +++---- {ANSIBLE => Cleanup}/httpd.yml | 0 {ANSIBLE => Cleanup}/templates/index.html.j2 | 0 {ANSIBLE => Cleanup}/templates/vhost.conf.j2 | 0 5 files changed, 3 insertions(+), 5 deletions(-) rename {ANSIBLE => Cleanup}/httpd.yml (100%) rename {ANSIBLE => Cleanup}/templates/index.html.j2 (100%) rename {ANSIBLE => Cleanup}/templates/vhost.conf.j2 (100%) diff --git a/ANSIBLE/icinga.yml b/ANSIBLE/icinga.yml index f98e71e..6102ec9 100644 --- a/ANSIBLE/icinga.yml +++ b/ANSIBLE/icinga.yml @@ -1,5 +1,4 @@ --- -#- import_playbook: httpd.yml - name: Install php and icinga2 web hosts: monitor diff --git a/ANSIBLE/roles/icinga2/tasks/icinga2-ido.yml b/ANSIBLE/roles/icinga2/tasks/icinga2-ido.yml index a65e052..312c779 100644 --- a/ANSIBLE/roles/icinga2/tasks/icinga2-ido.yml +++ b/ANSIBLE/roles/icinga2/tasks/icinga2-ido.yml @@ -18,18 +18,17 @@ column_case_sensitive: true - name: Check if IDO schema has already been imported - stat: + ansible.builtin.stat: path: /var/lib/icinga2/ido_schema_imported.flag register: ido_schema_marker - name: Import IDO schema - shell: | + ansible.builtin.shell: | mysql -u root -p'{{ mariadb_root_password }}' {{ icinga_db_name }} < /usr/share/icinga2-ido-mysql/schema/mysql.sql when: not ido_schema_marker.stat.exists - name: Mark IDO schema as imported - file: + ansible.builtin.file: path: /var/lib/icinga2/ido_schema_imported.flag state: touch when: not ido_schema_marker.stat.exists - diff --git a/ANSIBLE/httpd.yml b/Cleanup/httpd.yml similarity index 100% rename from ANSIBLE/httpd.yml rename to Cleanup/httpd.yml diff --git a/ANSIBLE/templates/index.html.j2 b/Cleanup/templates/index.html.j2 similarity index 100% rename from ANSIBLE/templates/index.html.j2 rename to Cleanup/templates/index.html.j2 diff --git a/ANSIBLE/templates/vhost.conf.j2 b/Cleanup/templates/vhost.conf.j2 similarity index 100% rename from ANSIBLE/templates/vhost.conf.j2 rename to Cleanup/templates/vhost.conf.j2