Manage customizations of /etc/hosts.
This commit is contained in:
parent
8a9e104b99
commit
a2a6f6ae2a
|
@ -18,6 +18,7 @@ grub_cmdline_additional_parameters: ""
|
|||
sysctl_custom_file: /etc/sysctl.d/90-custom-values.conf
|
||||
sysctl_opts_reload: yes
|
||||
sysctl_custom_file_state: present
|
||||
custom_etc_hosts_entries: ""
|
||||
|
||||
# Only name and value are mandatory. The others have defaults
|
||||
sysctl_custom_options: []
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
- name: etchosts-customizations | Add entries to /etc/hosts
|
||||
when: custom_etc_hosts_entries | length > 0
|
||||
tags:
|
||||
- etchosts
|
||||
block:
|
||||
- name: etchosts-customizations | Add custom entries to /etc/hosts
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/hosts
|
||||
marker_begin: 'ansible_etchosts_customizations_start'
|
||||
marker_end: 'ansible_etchosts_customizations_end'
|
||||
marker: "# {mark} Customization to bashrc installed via ansible"
|
||||
block: "{{ custom_etc_hosts_entries }}"
|
||||
state: present
|
||||
|
||||
- name: etchosts-customizations | Remove entries from /etc/hosts
|
||||
when: custom_etc_hosts_entries | length == 0
|
||||
tags:
|
||||
- etchosts
|
||||
block:
|
||||
- name: etchosts-customizations | Remove custom entries from /etc/hosts
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/hosts
|
||||
marker_begin: 'ansible_etchosts_customizations_start'
|
||||
marker_end: 'ansible_etchosts_customizations_end'
|
||||
marker: "# {mark} Customization to bashrc installed via ansible"
|
||||
block: "{{ custom_etc_hosts_entries }}"
|
||||
state: absent
|
|
@ -7,6 +7,8 @@
|
|||
ansible.builtin.import_tasks: locale.yml
|
||||
- name: Set the timezone
|
||||
ansible.builtin.import_tasks: timezone.yml
|
||||
- name: Manage customizations to the /etc/hosts file
|
||||
ansible.builtin.import_tasks: etchosts-customizations.yml
|
||||
- name: Sysctl kernel parameters
|
||||
ansible.builtin.import_tasks: sysctl.yml
|
||||
- name: Grub command line parameters
|
||||
|
|
Loading…
Reference in New Issue