40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
---
|
|
- include_vars: vars/os-creds.yml
|
|
|
|
- name: OS configure
|
|
block:
|
|
- name: Add SSH keys for root
|
|
authorized_key:
|
|
user: "{{ item.username }}"
|
|
state: present
|
|
# exclusive: true
|
|
key: "{{ item.ssh_key }}"
|
|
loop: "{{ os_user_root_sshkeys }}"
|
|
no_log: true
|
|
- name: Set root password = '*'
|
|
ansible.builtin.user:
|
|
name: root
|
|
password: '*'
|
|
when: (ansible_os_family == "Debian" and ansible_distribution_major_version == "12")
|
|
|
|
- name: OS configure
|
|
block:
|
|
- name: Change DNS setting /etc/resolv.conf INSIDE
|
|
ansible.builtin.copy:
|
|
src: files/debian12/resolv_inside.conf
|
|
dest: /etc/resolv.conf
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
when: (ansible_os_family == "Debian" and ansible_distribution_major_version == "12") and ansible_default_ipv4.broadcast.split('.')[1] != "11"
|
|
- name: OS configure
|
|
block:
|
|
- name: Change DNS setting /etc/resolv.conf DMZ
|
|
ansible.builtin.copy:
|
|
src: files/debian12/resolv_dmz.conf
|
|
dest: /etc/resolv.conf
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
when: (ansible_os_family == "Debian" and ansible_distribution_major_version == "12") and ansible_default_ipv4.broadcast.split('.')[1] == "11"
|