summaryrefslogtreecommitdiffstats
path: root/roles/network/tasks/install-debian.yml
blob: 7263bc84d794530e4eb2c0af3451563bda6bb67a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- name: "Ensure network_packages are installed"
  become: true
  ansible.builtin.apt:
    pkg: "{{ network_packages }}"
    state: "present"
    update_cache: true
  tags: [required_for_boot]

- name: "Set network_default_services facts"
  ansible.builtin.set_fact:
    network_default_services:
      - "dhcpcd"
      - "networking"
      - "wpa_supplicant"
  tags: [required_for_boot]

- name: "Disable conflicting services"
  become: true
  ansible.builtin.systemd_service:
    name: "{{ item }}"
    enabled: false
    state: "stopped"
  with_items: "{{ network_default_services }}"
  when: not ansible_is_chroot
  tags: [required_for_boot]

- name: "(chroot): Disable conflicting services"
  ansible.builtin.command:
    cmd: "systemctl disable {{ network_default_services | join(' ') }}"
  changed_when: true
  when: ansible_is_chroot
  # noqa: command-instead-of-module module doesn't work inside chroot
  tags: [required_for_boot]