vm/network: ubuntu bionic uses netplan...
[noc.git] / ansible / roles / vm / network / tasks / main.yml
1 ---
2 - name: install classic network config
3   import_tasks: classic.yml
4   when: ansible_distribution == "Debian" or (ansible_distribution == "Ubuntu" and (ansible_distribution_major_version | int) < 18)
5
6 - name: install basic netplan config
7   import_tasks: netplan.yml
8   when:  ansible_distribution == "Ubuntu" and (ansible_distribution_major_version | int) >= 18
9
10 - name: remove resolvconf package
11   apt:
12     name: resolvconf
13     state: absent
14     purge: yes
15
16 - name: generate resolv.conf
17   template:
18     src: resolv.conf.j2
19     dest: /etc/resolv.conf