Private
Public Access
2
0

Main target is now Debian 13 instead of Ubuntu 24.04

This commit is contained in:
2026-03-18 09:53:24 +03:00
parent 5199567bda
commit 63ed305852
14 changed files with 114 additions and 26 deletions

View File

@@ -0,0 +1,25 @@
- name: Check if /etc/cloud/cloud.cfg exists
ansible.builtin.stat:
path: "/etc/cloud/cloud.cfg"
register: common_out_cloud_cfg
- name: Disable /etc/hosts management by cloud-init
when: "common_out_cloud_cfg.stat.exists"
block:
- name: Disable /etc/hosts management by cloud-init (manage_etc_hosts)
ansible.builtin.lineinfile:
path: "/etc/cloud/cloud.cfg"
search_string: 'manage_etc_hosts:'
line: "manage_etc_hosts: false"
insertafter: "preserve_hostname:"
- name: Disable /etc/hosts management by cloud-init (update_etc_hosts)
ansible.builtin.replace:
path: "/etc/cloud/cloud.cfg"
regexp: '^([^#]*update_etc_hosts.*)$'
replace: '# \\1'
- name: Configure /etc/hosts file
ansible.builtin.template:
src: "templates/hosts"
dest: "/etc/hosts"
mode: "0644"