Switch from using tags to variables
Signed-off-by: Radovan Sroka <rsroka@redhat.com>
This commit is contained in:
committed by
Sergei Petrosian
parent
82cb4bbf35
commit
7826ac05c6
@@ -0,0 +1,16 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
---
|
||||
- name: Get file
|
||||
slurp:
|
||||
path: "{{ __file }}"
|
||||
register: __content
|
||||
when: not __file_content is defined
|
||||
|
||||
- name: Check for presence of ansible managed header, fingerprint
|
||||
assert:
|
||||
that:
|
||||
- ansible_managed not in content
|
||||
- __fingerprint not in content
|
||||
vars:
|
||||
content: "{{ (__file_content | d(__content)).content | b64decode }}"
|
||||
ansible_managed: "{{ lookup('template', 'get_ansible_managed.j2') }}"
|
||||
@@ -7,7 +7,7 @@
|
||||
- linux-system-roles.aide
|
||||
tasks:
|
||||
- name: Check header for ansible_managed, fingerprint
|
||||
include_tasks: tasks/check_header.yml
|
||||
include_tasks: tasks/check_not_present_header.yml
|
||||
vars:
|
||||
__file: /etc/aide.conf
|
||||
__fingerprint: system_role:aide
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
---
|
||||
- name: Ensure that the role runs with default parameters
|
||||
hosts: all
|
||||
gather_facts: false # test that role works in this case
|
||||
roles:
|
||||
- role: linux-system-roles.aide
|
||||
vars:
|
||||
aide_install: true
|
||||
aide_generate_config: true
|
||||
aide_init: true
|
||||
tasks:
|
||||
- name: Check header for ansible_managed, fingerprint
|
||||
include_tasks: tasks/check_header.yml
|
||||
vars:
|
||||
__file: /etc/aide.conf
|
||||
__fingerprint: system_role:aide
|
||||
Reference in New Issue
Block a user