summaryrefslogtreecommitdiff
blob: 5aaaeff5cfdcd353ef4385a34941dfdb98a0d845 (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
---
#- name: plop netplan
#  copy:
#    src: "{{ inventory_hostname }}.yaml"
#    dest: "/etc/netplan/20-customNetworking.yaml"
#  register: netplanCopy
#
#- name: generate netplan
#  command: netplan generate
#  register: netplanGenerated
#  when: netplanCopy.changed
#
#- name: apply netplan
#  command: netplan apply
#  when: netplanGenerated.changed

- name: configure public network link through systemd directly
  template:
    src: network/custom.link
    dest: "/etc/systemd/network/custom-{{ network.ethernets.interface }}.link"
  register: networkUpdated

- name: configure public network address through systemd directly
  template:
    src: network/custom.network
    dest: "/etc/systemd/network/custom-{{ network.ethernets.interface }}.network"
  register: networkUpdated

- name: reload network since configuration changed
  command: systemctl restart systemd-networkd
  when: networkUpdated.changed

- name: re-query ansible facts since system changed
  setup:
    gather_subset:
      - "!all"
      - "!min"
      - network
  when: networkUpdated.changed
Powered by cgit v1.2.3 (git 2.41.0)