Copied from the environment repository's roles and scrubbed for the Collection: galaxy namespace mortis, molecule scenarios call the roles by their FQCN and take their paths from the workflow, README examples use mortis.kamino.* and documentation addresses, repository-local references (issue numbers, ADRs, inventory paths) are dropped. network_interfaces loses its Legacy name guard and the molecule play that tested it: the guard only protected the in-repo rename, and a new consumer never had the old names. mock_roles in .ansible-lint lists both FQCNs. Not verified locally: the molecule scenarios (they run on the kamino-molecule runner in CI) and ansible-test sanity. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
34 lines
936 B
YAML
34 lines
936 B
YAML
---
|
|
- name: Apply network configuration safely
|
|
become: true
|
|
when: network_interfaces_changed
|
|
block:
|
|
- name: Backup current interfaces file
|
|
ansible.builtin.copy:
|
|
src: "{{ network_interfaces_file }}"
|
|
dest: "{{ network_interfaces_backup }}"
|
|
remote_src: true
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
|
|
- name: Write new interfaces configuration
|
|
ansible.builtin.copy:
|
|
content: "{{ network_interfaces_rendered }}"
|
|
dest: "{{ network_interfaces_file }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify: Reload Interfaces
|
|
|
|
- name: Validate network configuration
|
|
ansible.builtin.command: "{{ network_interfaces_validate_command }}"
|
|
changed_when: false
|
|
|
|
- name: Trigger network reload
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
rescue:
|
|
- name: Revert interfaces
|
|
ansible.builtin.import_tasks: revert.yml
|