summaryrefslogtreecommitdiff
path: root/roles/elevate/media/tasks/network.yml
blob: da7dd1db49b94e300a5325152dcd68216aa107c4 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
- name: create netplan conf-available directory
  file:
    path: /etc/netplan/conf-available
    state: directory

- name: install netplan configs
  template:
    src: "netplan/{{ item }}.yaml.j2"
    dest: "/etc/netplan/conf-available/{{ item }}.yaml"
  with_items:
    - lan-only
    - r3
    - r3-with-lan
    - elevate-festival
    - elevate-office
  notify: netplan apply

- name: install firewall scripts
  template:
    src: "firewall/{{ item }}.sh.j2"
    dest: "/etc/saswall/{{ item }}.sh"
    mode: 0755
  with_items:
    - lan-only
    - r3
    - r3-with-lan
    - elevate-festival
    - elevate-office
  notify: firewall restart

- name: remove default netplan config
  file:
    path: /etc/netplan/01-netcfg.yaml
    state: absent
  notify: netplan apply

- name: set active netwok setup
  with_items:
    - dest: /etc/netplan/01-active.yaml
      src: "conf-available/{{ network_setup }}.yaml"
    - dest: /etc/saswall/rules.sh
      src: "{{ network_setup }}.sh"
  file:
    state: link
    dest: "{{ item.dest }}"
    src: "{{ item.src }}"
  notify:
    - netplan apply
    - firewall restart

- name: make sure network config has been applied
  meta: flush_handlers