Merge pull request #87 from laurent-indermuehle/lie_add_tags_support_for_included_tasks

fix: tags support for included tasks
This commit is contained in:
gardar 2023-05-03 12:03:55 +00:00 committed by GitHub
commit 927ec4ede4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 85 additions and 7 deletions

View file

@ -1,6 +1,12 @@
--- ---
- name: Preflight - name: Preflight
ansible.builtin.include_tasks: preflight.yml ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- alertmanager_install
- alertmanager_configure
- alertmanager_run
tags: tags:
- alertmanager_install - alertmanager_install
- alertmanager_configure - alertmanager_configure
@ -13,12 +19,16 @@
become: true become: true
tags: tags:
- alertmanager_install - alertmanager_install
tags:
- alertmanager_install
- name: SELinux - name: SELinux
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: selinux.yml file: selinux.yml
apply: apply:
become: true become: true
tags:
- alertmanager_configure
when: ansible_selinux.status == "enabled" when: ansible_selinux.status == "enabled"
tags: tags:
- alertmanager_configure - alertmanager_configure
@ -30,6 +40,8 @@
become: true become: true
tags: tags:
- alertmanager_configure - alertmanager_configure
tags:
- alertmanager_configure
- name: Ensure alertmanager service is started and enabled - name: Ensure alertmanager service is started and enabled
become: true become: true

View file

@ -1,6 +1,12 @@
--- ---
- name: Preflight - name: Preflight
ansible.builtin.include_tasks: preflight.yml ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- blackbox_exporter_install
- blackbox_exporter_configure
- blackbox_exporter_run
tags: tags:
- blackbox_exporter_install - blackbox_exporter_install
- blackbox_exporter_configure - blackbox_exporter_configure
@ -13,6 +19,8 @@
become: true become: true
tags: tags:
- blackbox_exporter_install - blackbox_exporter_install
tags:
- blackbox_exporter_install
- name: Configure - name: Configure
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
@ -21,6 +29,8 @@
become: true become: true
tags: tags:
- blackbox_exporter_configure - blackbox_exporter_configure
tags:
- blackbox_exporter_configure
- name: Ensure blackbox_exporter service is started and enabled - name: Ensure blackbox_exporter service is started and enabled
become: true become: true

View file

@ -1,6 +1,12 @@
--- ---
- name: Preflight - name: Preflight
ansible.builtin.include_tasks: preflight.yml ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- mysqld_exporter_install
- mysqld_exporter_configure
- mysqld_exporter_run
tags: tags:
- mysqld_exporter_install - mysqld_exporter_install
- mysqld_exporter_configure - mysqld_exporter_configure
@ -11,6 +17,8 @@
file: install.yml file: install.yml
apply: apply:
become: true become: true
tags:
- mysqld_exporter_install
when: when:
( not __mysqld_exporter_is_installed.stat.exists ) or ( not __mysqld_exporter_is_installed.stat.exists ) or
( (__mysqld_exporter_current_version_output.stderr_lines | length > 0) ( (__mysqld_exporter_current_version_output.stderr_lines | length > 0)
@ -26,6 +34,8 @@
file: selinux.yml file: selinux.yml
apply: apply:
become: true become: true
tags:
- mysqld_exporter_configure
when: ansible_selinux.status == "enabled" when: ansible_selinux.status == "enabled"
tags: tags:
- mysqld_exporter_configure - mysqld_exporter_configure
@ -37,6 +47,8 @@
become: true become: true
tags: tags:
- mysqld_exporter_configure - mysqld_exporter_configure
tags:
- mysqld_exporter_configure
- name: Ensure MySQLd Exporter is enabled on boot - name: Ensure MySQLd Exporter is enabled on boot
become: true become: true

View file

@ -1,6 +1,12 @@
--- ---
- name: Preflight - name: Preflight
ansible.builtin.include_tasks: preflight.yml ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- node_exporter_install
- node_exporter_configure
- node_exporter_run
tags: tags:
- node_exporter_install - node_exporter_install
- node_exporter_configure - node_exporter_configure
@ -11,6 +17,8 @@
file: install.yml file: install.yml
apply: apply:
become: true become: true
tags:
- node_exporter_install
when: when:
( not __node_exporter_is_installed.stat.exists ) or ( not __node_exporter_is_installed.stat.exists ) or
( (__node_exporter_current_version_output.stderr_lines | length > 0) ( (__node_exporter_current_version_output.stderr_lines | length > 0)
@ -26,6 +34,8 @@
file: selinux.yml file: selinux.yml
apply: apply:
become: true become: true
tags:
- node_exporter_configure
when: ansible_selinux.status == "enabled" when: ansible_selinux.status == "enabled"
tags: tags:
- node_exporter_configure - node_exporter_configure
@ -37,6 +47,8 @@
become: true become: true
tags: tags:
- node_exporter_configure - node_exporter_configure
tags:
- node_exporter_configure
- name: Ensure Node Exporter is enabled on boot - name: Ensure Node Exporter is enabled on boot
become: true become: true

View file

@ -1,6 +1,12 @@
--- ---
- name: Preflight - name: Preflight
ansible.builtin.include_tasks: preflight.yml ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- prometheus_configure
- prometheus_install
- prometheus_run
tags: tags:
- prometheus_configure - prometheus_configure
- prometheus_install - prometheus_install
@ -13,6 +19,8 @@
become: true become: true
tags: tags:
- prometheus_install - prometheus_install
tags:
- prometheus_install
- name: Configure - name: Configure
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
@ -21,6 +29,8 @@
become: true become: true
tags: tags:
- prometheus_configure - prometheus_configure
tags:
- prometheus_configure
- name: Ensure prometheus service is started and enabled - name: Ensure prometheus service is started and enabled
become: true become: true

View file

@ -1,6 +1,12 @@
--- ---
- name: Preflight - name: Preflight
ansible.builtin.include_tasks: preflight.yml ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- snmp_exporter_install
- snmp_exporter_configure
- snmp_exporter_run
tags: tags:
- snmp_exporter_install - snmp_exporter_install
- snmp_exporter_configure - snmp_exporter_configure
@ -13,6 +19,8 @@
become: true become: true
tags: tags:
- snmp_exporter_install - snmp_exporter_install
tags:
- snmp_exporter_install
- name: Configure - name: Configure
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
@ -21,6 +29,8 @@
become: true become: true
tags: tags:
- snmp_exporter_configure - snmp_exporter_configure
tags:
- snmp_exporter_configure
- name: Ensure snmp_exporter service is started and enabled - name: Ensure snmp_exporter service is started and enabled
become: true become: true

View file

@ -1,6 +1,12 @@
--- ---
- name: Preflight - name: Preflight
ansible.builtin.include_tasks: preflight.yml ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- systemd_exporter_install
- systemd_exporter_configure
- systemd_exporter_run
tags: tags:
- systemd_exporter_install - systemd_exporter_install
- systemd_exporter_configure - systemd_exporter_configure
@ -11,6 +17,8 @@
file: install.yml file: install.yml
apply: apply:
become: true become: true
tags:
- systemd_exporter_install
when: when:
( not __systemd_exporter_is_installed.stat.exists ) or ( not __systemd_exporter_is_installed.stat.exists ) or
( __systemd_exporter_current_version_output.stderr_lines[0].split(" ")[2] != systemd_exporter_version ) or ( __systemd_exporter_current_version_output.stderr_lines[0].split(" ")[2] != systemd_exporter_version ) or
@ -23,6 +31,8 @@
file: selinux.yml file: selinux.yml
apply: apply:
become: true become: true
tags:
- systemd_exporter_configure
when: ansible_selinux.status == "enabled" when: ansible_selinux.status == "enabled"
tags: tags:
- systemd_exporter_configure - systemd_exporter_configure
@ -34,6 +44,8 @@
become: true become: true
tags: tags:
- systemd_exporter_configure - systemd_exporter_configure
tags:
- systemd_exporter_configure
- name: Ensure systemd exporter is enabled on boot - name: Ensure systemd exporter is enabled on boot
become: true become: true