summaryrefslogtreecommitdiff
path: root/roles/elevate/media/tasks/network.yml
blob: 17e82097abe90d986417be458ce129832eb18ba6 (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
  loop:
    - lan-only
    - r3
    - r3-with-lan
    - elevate-festival
    - elevate-office
  template:
    src: "netplan/{{ item }}.yaml.j2"
    dest: "/etc/netplan/conf-available/{{ item }}.yaml"
  notify: netplan apply

- name: install firewall scripts
  loop:
    - lan-only
    - r3
    - r3-with-lan
    - elevate-festival
    - elevate-office
  template:
    src: "firewall/{{ item }}.sh.j2"
    dest: "/etc/saswall/{{ item }}.sh"
    mode: 0755
  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
  loop:
    - 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