feat: remove become from role
All checks were successful
test / Linting (push) Successful in 18s
test / Molecule tests (default, debian11) (push) Successful in 47s
test / Molecule tests (default, debian12) (push) Successful in 53s
test / Molecule tests (default, ubuntu2204) (push) Successful in 49s
test / Molecule tests (default, ubuntu2004) (push) Successful in 1m21s
test / Molecule tests (with_custom_config, debian11) (push) Successful in 45s
test / Molecule tests (with_custom_config, debian12) (push) Successful in 49s
test / Molecule tests (with_custom_config, ubuntu2004) (push) Successful in 51s
test / Molecule tests (with_custom_config, ubuntu2204) (push) Successful in 46s

This commit is contained in:
Bertrand Lanson 2023-12-03 17:48:46 +01:00
parent a6f3132957
commit 30ce327d55
12 changed files with 10 additions and 8 deletions

View File

@ -3,7 +3,6 @@
- name: "Generate netplan configuration"
ansible.builtin.command: netplan generate
changed_when: false
become: true
listen: "netplan-generate"
- name: "Apply netplan configuration"
@ -11,4 +10,3 @@
listen: "netplan-apply"
changed_when: false
when: manage_netplan_apply
become: true

View File

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

View File

@ -1,7 +1,8 @@
---
- name: Verify
hosts: all
gather_facts: false
gather_facts: true
become: true
tasks:
- name: "Test: file /etc/hosts"
block:

View File

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

View File

@ -2,6 +2,7 @@
- name: Verify
hosts: all
gather_facts: true
become: true
tasks:
- name: "Test: file /etc/hosts"
block:

View File

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

View File

@ -1,7 +1,8 @@
---
- name: Verify
hosts: all
gather_facts: false
gather_facts: true
become: true
tasks:
- name: "Test: file /etc/hosts"
block:

View File

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

View File

@ -2,6 +2,7 @@
- name: Verify
hosts: all
gather_facts: true
become: true
tasks:
- name: "Test: file /etc/hosts"
block:

View File

@ -9,7 +9,6 @@
group: root
backup: true
when: manage_netplan_configuration != []
become: true
notify:
- "netplan-generate"
- "netplan-apply"

View File

@ -20,4 +20,3 @@
owner: "root"
group: "root"
mode: '0755'
become: true

View File

@ -5,7 +5,6 @@
paths: /etc/netplan
patterns: "*.yml,*.yaml"
register: _netplan_configs
become: true
- name: "Removing existing configurations"
ansible.builtin.file:
@ -14,4 +13,3 @@
loop: "{{ _netplan_configs['files'] }}"
when: item['path'] != manage_netplan_config_file
and manage_netplan_configuration != []
become: true