Additional custom /etc/hosts entries.
This commit is contained in:
parent
b9aff40306
commit
3c8db06b4f
|
|
@ -19,6 +19,7 @@ sysctl_custom_file: /etc/sysctl.d/90-custom-values.conf
|
||||||
sysctl_opts_reload: yes
|
sysctl_opts_reload: yes
|
||||||
sysctl_custom_file_state: present
|
sysctl_custom_file_state: present
|
||||||
custom_etc_hosts_entries: ""
|
custom_etc_hosts_entries: ""
|
||||||
|
custom_etc_hosts_entries_adjunct: ""
|
||||||
|
|
||||||
# Only name and value are mandatory. The others have defaults
|
# Only name and value are mandatory. The others have defaults
|
||||||
sysctl_custom_options: []
|
sysctl_custom_options: []
|
||||||
|
|
|
||||||
|
|
@ -26,3 +26,32 @@
|
||||||
marker: "# {mark} hosts entries managed by ansible"
|
marker: "# {mark} hosts entries managed by ansible"
|
||||||
block: "{{ custom_etc_hosts_entries }}"
|
block: "{{ custom_etc_hosts_entries }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: etchosts-customizations | Additional custom entries to /etc/hosts
|
||||||
|
when: custom_etc_hosts_entries_adjunct | length > 0
|
||||||
|
tags:
|
||||||
|
- etchosts
|
||||||
|
block:
|
||||||
|
- name: etchosts-customizations | Additional custom entries to /etc/hosts
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: /etc/hosts
|
||||||
|
marker_begin: 'ansible_etchosts_adjunct_start'
|
||||||
|
marker_end: 'ansible_etchosts_adjunct_end'
|
||||||
|
marker: "# {mark} additional hosts entries managed by ansible"
|
||||||
|
block: "{{ custom_etc_hosts_entries_adjunct }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: etchosts-customizations | Remove entries from /etc/hosts
|
||||||
|
when: custom_etc_hosts_entries_adjunct | length == 0
|
||||||
|
tags:
|
||||||
|
- etchosts
|
||||||
|
block:
|
||||||
|
- name: etchosts-customizations | Remove the additional custom entries from /etc/hosts
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: /etc/hosts
|
||||||
|
marker_begin: 'ansible_etchosts_adjunct_start'
|
||||||
|
marker_end: 'ansible_etchosts_adjunct_end'
|
||||||
|
marker: "# {mark} additional hosts entries managed by ansible"
|
||||||
|
block: "{{ custom_etc_hosts_entries_adjunct }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue