Use blocks for macvlan tasks for each distribution (#8918)
For the code readability, this adds blocks for each distribution.pull/8937/head
parent
14c0f368b6
commit
814760ba25
|
@ -27,6 +27,7 @@
|
||||||
notify: Macvlan | restart network
|
notify: Macvlan | restart network
|
||||||
when: ansible_os_family in ["Debian"]
|
when: ansible_os_family in ["Debian"]
|
||||||
|
|
||||||
|
- block:
|
||||||
- name: Macvlan | Install macvlan script on centos
|
- name: Macvlan | Install macvlan script on centos
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
|
@ -36,7 +37,6 @@
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
- files/*
|
- files/*
|
||||||
when: ansible_os_family == "RedHat"
|
|
||||||
|
|
||||||
- name: Macvlan | Install post-up script on centos
|
- name: Macvlan | Install post-up script on centos
|
||||||
copy:
|
copy:
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
when: ansible_os_family == "RedHat" and enable_nat_default_gateway
|
when: enable_nat_default_gateway
|
||||||
|
|
||||||
- name: Macvlan | Install network gateway interface on centos
|
- name: Macvlan | Install network gateway interface on centos
|
||||||
template:
|
template:
|
||||||
|
@ -57,21 +57,23 @@
|
||||||
- {src: centos-routes-macvlan.cfg, dst: route-mac0 }
|
- {src: centos-routes-macvlan.cfg, dst: route-mac0 }
|
||||||
- {src: centos-postup-macvlan.cfg, dst: post-up-mac0 }
|
- {src: centos-postup-macvlan.cfg, dst: post-up-mac0 }
|
||||||
notify: Macvlan | restart network
|
notify: Macvlan | restart network
|
||||||
|
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
|
|
||||||
|
- block:
|
||||||
- name: Macvlan | Install service nat via gateway on Flatcar Container Linux
|
- name: Macvlan | Install service nat via gateway on Flatcar Container Linux
|
||||||
template:
|
template:
|
||||||
src: coreos-service-nat_ouside.j2
|
src: coreos-service-nat_ouside.j2
|
||||||
dest: /etc/systemd/system/enable_nat_ouside.service
|
dest: /etc/systemd/system/enable_nat_ouside.service
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] and enable_nat_default_gateway
|
when: enable_nat_default_gateway
|
||||||
|
|
||||||
- name: Macvlan | Enable service nat via gateway on Flatcar Container Linux
|
- name: Macvlan | Enable service nat via gateway on Flatcar Container Linux
|
||||||
command: "{{ item }}"
|
command: "{{ item }}"
|
||||||
with_items:
|
with_items:
|
||||||
- systemctl daemon-reload
|
- systemctl daemon-reload
|
||||||
- systemctl enable enable_nat_ouside.service
|
- systemctl enable enable_nat_ouside.service
|
||||||
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] and enable_nat_default_gateway
|
when: enable_nat_default_gateway
|
||||||
|
|
||||||
- name: Macvlan | Install network gateway interface on Flatcar Container Linux
|
- name: Macvlan | Install network gateway interface on Flatcar Container Linux
|
||||||
template:
|
template:
|
||||||
|
@ -83,6 +85,7 @@
|
||||||
- {src: coreos-interface-macvlan.cfg, dst: output.network }
|
- {src: coreos-interface-macvlan.cfg, dst: output.network }
|
||||||
- {src: coreos-network-macvlan.cfg, dst: macvlan.network }
|
- {src: coreos-network-macvlan.cfg, dst: macvlan.network }
|
||||||
notify: Macvlan | restart network
|
notify: Macvlan | restart network
|
||||||
|
|
||||||
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
||||||
|
|
||||||
- name: Macvlan | Install cni definition for Macvlan
|
- name: Macvlan | Install cni definition for Macvlan
|
||||||
|
|
Loading…
Reference in New Issue