fix(security,common)!: moved sysctl and resolvconf tasks from common to security role to fix DNS resolution fail due to firewall rules
This commit is contained in:
parent
b7ba39bce9
commit
3701ea6276
13 changed files with 57 additions and 55 deletions
|
@ -1,35 +1,4 @@
|
|||
---
|
||||
- name: '[system] setup DNS server'
|
||||
block:
|
||||
- name: disable resolv.conf updates from dhclient
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate
|
||||
content: |
|
||||
#!/bin/sh
|
||||
make_resolv_conf(){
|
||||
:
|
||||
}
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
- name: update resolv.conf
|
||||
ansible.builtin.template:
|
||||
src: ../templates/system/resolv.conf.j2
|
||||
dest: /etc/resolv.conf
|
||||
mode: '0644'
|
||||
owner: root
|
||||
group: root
|
||||
become: true
|
||||
when: common_configure_resolve_conf is truthy
|
||||
|
||||
- name: '[system] re-allow DHCP client to setup DNS resolvers'
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate
|
||||
state: absent
|
||||
failed_when: false
|
||||
when : common_configure_resolve_conf is falsy
|
||||
|
||||
- name: '[apt] verify components of default sources'
|
||||
become: true
|
||||
block:
|
||||
|
@ -135,18 +104,6 @@
|
|||
cmds:
|
||||
- dpkg -i {asset_dirname}/{asset_filename}
|
||||
|
||||
- name: '[system] add sysctl tweaks'
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: ../templates/system/sysctld.local.conf.j2
|
||||
dest: /etc/sysctl.d/local.conf
|
||||
mode: '0644'
|
||||
when: common_sysctl_configuration is truthy
|
||||
vars:
|
||||
sysctl_values: "{{ common_sysctl_configuration }}"
|
||||
notify:
|
||||
- 'common : [system] reload sysctl configuration'
|
||||
|
||||
- name: '[apt] install custom packages'
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue