feat: removed become from role
All checks were successful
test / Linting (push) Successful in 17s
test / Molecule tests (default, debian11) (push) Successful in 58s
test / Molecule tests (default, debian12) (push) Successful in 38s
test / Molecule tests (default, ubuntu2204) (push) Successful in 43s
test / Molecule tests (default, ubuntu2004) (push) Successful in 1m20s
test / Molecule tests (with_custom_ca, debian12) (push) Successful in 45s
test / Molecule tests (with_custom_ca, debian11) (push) Successful in 1m2s
test / Molecule tests (with_custom_ca, ubuntu2204) (push) Successful in 48s
test / Molecule tests (with_custom_ca, ubuntu2004) (push) Successful in 1m7s

This commit is contained in:
Bertrand Lanson 2023-12-03 17:27:02 +01:00
parent 2ae5d8826d
commit 33941ed34a
10 changed files with 10 additions and 34 deletions

View File

@ -3,5 +3,4 @@
- name: "Update the trust store" - name: "Update the trust store"
ansible.builtin.command: update-ca-certificates ansible.builtin.command: update-ca-certificates
changed_when: false changed_when: false
become: true
listen: "update-ca-certificates" listen: "update-ca-certificates"

View File

@ -1,6 +1,7 @@
--- ---
- name: Converge - name: Converge
hosts: all hosts: all
become: true
tasks: tasks:
- name: "Include ednxzu.import_vault_root_ca" - name: "Include ednxzu.import_vault_root_ca"
ansible.builtin.include_role: ansible.builtin.include_role:

View File

@ -1,23 +1,9 @@
--- ---
- name: Verify - name: Verify
hosts: all hosts: all
gather_facts: false gather_facts: true
become: true
tasks: tasks:
- name: "Test: file /etc/hosts"
block:
- name: "Stat file /etc/hosts"
ansible.builtin.stat:
path: "/etc/hosts"
register: stat_etc_hosts
- name: "Verify file /etc/hosts"
ansible.builtin.assert:
that:
- stat_etc_hosts.stat.exists
- stat_etc_hosts.stat.isreg
- stat_etc_hosts.stat.pw_name == 'root'
- stat_etc_hosts.stat.gr_name == 'root'
- name: "Test: directory /usr/local/share/ca-certificates" - name: "Test: directory /usr/local/share/ca-certificates"
block: block:
- name: "Stat directory /usr/local/share/ca-certificates" - name: "Stat directory /usr/local/share/ca-certificates"

View File

@ -1,6 +1,7 @@
--- ---
- name: Converge - name: Converge
hosts: all hosts: all
become: true
tasks: tasks:
- name: "Include ednxzu.import_vault_root_ca" - name: "Include ednxzu.import_vault_root_ca"
ansible.builtin.include_role: ansible.builtin.include_role:

View File

@ -2,6 +2,7 @@
- name: Verify - name: Verify
hosts: all hosts: all
gather_facts: true gather_facts: true
become: true
tasks: tasks:
- name: "Test: directory /usr/local/share/ca-certificates" - name: "Test: directory /usr/local/share/ca-certificates"
block: block:

View File

@ -1,6 +1,7 @@
--- ---
- name: Converge - name: Converge
hosts: all hosts: all
become: true
tasks: tasks:
- name: "Include ednxzu.import_vault_root_ca" - name: "Include ednxzu.import_vault_root_ca"
ansible.builtin.include_role: ansible.builtin.include_role:

View File

@ -1,23 +1,9 @@
--- ---
- name: Verify - name: Verify
hosts: all hosts: all
gather_facts: false gather_facts: true
become: true
tasks: tasks:
- name: "Test: file /etc/hosts"
block:
- name: "Stat file /etc/hosts"
ansible.builtin.stat:
path: "/etc/hosts"
register: stat_etc_hosts
- name: "Verify file /etc/hosts"
ansible.builtin.assert:
that:
- stat_etc_hosts.stat.exists
- stat_etc_hosts.stat.isreg
- stat_etc_hosts.stat.pw_name == 'root'
- stat_etc_hosts.stat.gr_name == 'root'
- name: "Test: directory /usr/local/share/ca-certificates" - name: "Test: directory /usr/local/share/ca-certificates"
block: block:
- name: "Stat directory /usr/local/share/ca-certificates" - name: "Stat directory /usr/local/share/ca-certificates"

View File

@ -1,6 +1,7 @@
--- ---
- name: Converge - name: Converge
hosts: all hosts: all
become: true
tasks: tasks:
- name: "Include ednxzu.import_vault_root_ca" - name: "Include ednxzu.import_vault_root_ca"
ansible.builtin.include_role: ansible.builtin.include_role:

View File

@ -2,6 +2,7 @@
- name: Verify - name: Verify
hosts: all hosts: all
gather_facts: true gather_facts: true
become: true
tasks: tasks:
- name: "Test: directory /usr/local/share/ca-certificates" - name: "Test: directory /usr/local/share/ca-certificates"
block: block:

View File

@ -23,6 +23,5 @@
cmd: openssl x509 -inform {{ 'PEM' if item.rc == 0 else 'DER' }} -in {{ item.item.dest }} -out {{ import_vault_root_ca_cert_dir }}/{{ item.item.item.cert_name }}.crt -outform pem cmd: openssl x509 -inform {{ 'PEM' if item.rc == 0 else 'DER' }} -in {{ item.item.dest }} -out {{ import_vault_root_ca_cert_dir }}/{{ item.item.item.cert_name }}.crt -outform pem
creates: "{{ import_vault_root_ca_cert_dir }}/{{ item.item.item.cert_name }}.crt" creates: "{{ import_vault_root_ca_cert_dir }}/{{ item.item.item.cert_name }}.crt"
loop: "{{ cert_format_results.results }}" loop: "{{ cert_format_results.results }}"
become: true
notify: notify:
- update-ca-certificates - update-ca-certificates