mirror of
https://github.com/roles-ansible/ansible_role_resolvconf.git
synced 2024-08-16 10:09:52 +02:00
try to improve deployment...
This commit is contained in:
parent
071e0773d0
commit
7de4a0596f
2 changed files with 28 additions and 10 deletions
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
- ansible.builtin.include_tasks: versioncheck.yml
|
||||
- name: run versionscheck
|
||||
ansible.builtin.include_tasks: versioncheck.yml
|
||||
when: submodules_versioncheck|bool
|
||||
|
||||
- name: resolv.conf is ino longer immutable.
|
||||
|
@ -11,14 +12,31 @@
|
|||
changed_when: "resolv_file.changed and not resolveconf__immutable"
|
||||
ignore_errors: true
|
||||
|
||||
- name: "Configure resolv.conf"
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: 'templates/resolv.conf.j2'
|
||||
dest: '/etc/resolv.conf'
|
||||
mode: "{{ resolvconf__mode }}"
|
||||
owner: root
|
||||
group: root
|
||||
- name: deploy resolv.conf
|
||||
block:
|
||||
- name: "Configure resolv.conf"
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: 'templates/resolv.conf.j2'
|
||||
dest: '/etc/resolv.conf'
|
||||
mode: "{{ resolvconf__mode }}"
|
||||
owner: root
|
||||
group: root
|
||||
rescue:
|
||||
- name: Remove /etc/resolv.conf
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: '/etc/resolv.conf'
|
||||
state: absent
|
||||
|
||||
- name: "try to deplpy resolv.conf again"
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: 'templates/resolv.conf.j2'
|
||||
dest: '/etc/resolv.conf'
|
||||
mode: "{{ resolvconf__mode }}"
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Ensure resolv.conf is immutable.
|
||||
become: true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
---
|
||||
# versionscheck
|
||||
playbook_version_number: 5 # should be a integer
|
||||
playbook_version_number: 6 # should be a integer
|
||||
playbook_version_path: 'do1jlr.resolvconf.version'
|
||||
|
|
Loading…
Reference in a new issue