fix: issue with debian when migrate to resolved-systemd
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
vincent 2023-10-24 22:43:19 +02:00
parent 8c5e4a266b
commit 6c2ddb35a6
3 changed files with 39 additions and 6 deletions

View File

@ -1,6 +1,6 @@
--- ---
- name: Ensure dhcpcd is instaled - name: Ensure dhcpcd is instaled
community.general.pacman: ansible.builtin.package:
name: dhcpcd name: dhcpcd
state: present state: present
become: true become: true
@ -11,3 +11,19 @@
line: "hostname" line: "hostname"
state: present state: present
become: true become: true
- name: start and enable dhcpcd
ansible.builtin.service:
name: dhcpcd
state: started
enabled: true
become: true
when: ansible_os_family == "Debian"
- name: stop and disable networking
ansible.builtin.service:
name: networking
state: stopped
enabled: false
become: true
when: ansible_os_family == "Debian"

View File

@ -9,15 +9,15 @@
ansible.builtin.include_tasks: hostname.yml ansible.builtin.include_tasks: hostname.yml
- name: Include hosts - name: Include hosts
ansible.builtin.include_tasks: hosts.yml ansible.builtin.include_tasks: hosts.yml
- name: Inclide systemd-resolved
ansible.builtin.include_tasks: systemd-resolved.yml
- name: Include tasks.sysctl - name: Include tasks.sysctl
ansible.builtin.include_tasks: tasks.sysctl.yml ansible.builtin.include_tasks: tasks.sysctl.yml
- name: Include wol - name: Include wol
ansible.builtin.include_tasks: wol.yml ansible.builtin.include_tasks: wol.yml
- name: Include dhcpcd - name: Include dhcpcd
ansible.builtin.include_tasks: dhcpcd.yml ansible.builtin.include_tasks: dhcpcd.yml
when: ansible_os_family == "Archlinux" when: ansible_os_family == "Archlinux" or ansible_os_family == "Debian"
- name: Inclide systemd-resolved
ansible.builtin.include_tasks: systemd-resolved.yml
- name: Include locales - name: Include locales
ansible.builtin.include_tasks: locales.yml ansible.builtin.include_tasks: locales.yml
when: ansible_os_family == "Archlinux" when: ansible_os_family == "Archlinux"

View File

@ -6,14 +6,31 @@
become: true become: true
when: ansible_os_family == "RedHat" or ansible_os_family == "Debian" when: ansible_os_family == "RedHat" or ansible_os_family == "Debian"
- name: install systemd-resolvconf - name: Install systemd-resolvconf
ansible.builtin.package: ansible.builtin.package:
name: systemd-resolvconf name: systemd-resolvconf
state: present state: present
when: ansible_os_family == "Archlinux" when: ansible_os_family == "Archlinux"
- name: enable Systemd-resolved become: true
- name: Enable Systemd-resolved
ansible.builtin.service: ansible.builtin.service:
name: systemd-resolved name: systemd-resolved
state: started state: started
enabled: true enabled: true
become: true become: true
- name: Restart Systemd-resolved
ansible.builtin.service:
name: systemd-resolved
state: restarted
become: true
when: ansible_os_family == "Debian"
- name: Restart Systemd-resolved
ansible.builtin.service:
name: dhcpcd
state: restarted
become: true
when: ansible_os_family == "Debian"