|
|
@ -27,62 +27,65 @@ |
|
|
|
notify: Macvlan | restart network |
|
|
|
when: ansible_os_family in ["Debian"] |
|
|
|
|
|
|
|
- name: Macvlan | Install macvlan script on centos |
|
|
|
copy: |
|
|
|
src: "{{ item }}" |
|
|
|
dest: /etc/sysconfig/network-scripts/ |
|
|
|
owner: root |
|
|
|
group: root |
|
|
|
mode: "0755" |
|
|
|
with_fileglob: |
|
|
|
- block: |
|
|
|
- name: Macvlan | Install macvlan script on centos |
|
|
|
copy: |
|
|
|
src: "{{ item }}" |
|
|
|
dest: /etc/sysconfig/network-scripts/ |
|
|
|
owner: root |
|
|
|
group: root |
|
|
|
mode: "0755" |
|
|
|
with_fileglob: |
|
|
|
- files/* |
|
|
|
when: ansible_os_family == "RedHat" |
|
|
|
|
|
|
|
- name: Macvlan | Install post-up script on centos |
|
|
|
copy: |
|
|
|
src: "files/ifup-local" |
|
|
|
dest: /sbin/ |
|
|
|
owner: root |
|
|
|
group: root |
|
|
|
mode: "0755" |
|
|
|
when: ansible_os_family == "RedHat" and enable_nat_default_gateway |
|
|
|
- name: Macvlan | Install post-up script on centos |
|
|
|
copy: |
|
|
|
src: "files/ifup-local" |
|
|
|
dest: /sbin/ |
|
|
|
owner: root |
|
|
|
group: root |
|
|
|
mode: "0755" |
|
|
|
when: enable_nat_default_gateway |
|
|
|
|
|
|
|
- name: Macvlan | Install network gateway interface on centos |
|
|
|
template: |
|
|
|
src: "{{ item.src }}.j2" |
|
|
|
dest: "/etc/sysconfig/network-scripts/{{ item.dst }}" |
|
|
|
mode: 0644 |
|
|
|
with_items: |
|
|
|
- name: Macvlan | Install network gateway interface on centos |
|
|
|
template: |
|
|
|
src: "{{ item.src }}.j2" |
|
|
|
dest: "/etc/sysconfig/network-scripts/{{ item.dst }}" |
|
|
|
mode: 0644 |
|
|
|
with_items: |
|
|
|
- {src: centos-network-macvlan.cfg, dst: ifcfg-mac0 } |
|
|
|
- {src: centos-routes-macvlan.cfg, dst: route-mac0 } |
|
|
|
- {src: centos-postup-macvlan.cfg, dst: post-up-mac0 } |
|
|
|
notify: Macvlan | restart network |
|
|
|
notify: Macvlan | restart network |
|
|
|
|
|
|
|
when: ansible_os_family == "RedHat" |
|
|
|
|
|
|
|
- name: Macvlan | Install service nat via gateway on Flatcar Container Linux |
|
|
|
template: |
|
|
|
src: coreos-service-nat_ouside.j2 |
|
|
|
dest: /etc/systemd/system/enable_nat_ouside.service |
|
|
|
mode: 0644 |
|
|
|
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] and enable_nat_default_gateway |
|
|
|
- block: |
|
|
|
- name: Macvlan | Install service nat via gateway on Flatcar Container Linux |
|
|
|
template: |
|
|
|
src: coreos-service-nat_ouside.j2 |
|
|
|
dest: /etc/systemd/system/enable_nat_ouside.service |
|
|
|
mode: 0644 |
|
|
|
when: enable_nat_default_gateway |
|
|
|
|
|
|
|
- name: Macvlan | Enable service nat via gateway on Flatcar Container Linux |
|
|
|
command: "{{ item }}" |
|
|
|
with_items: |
|
|
|
- name: Macvlan | Enable service nat via gateway on Flatcar Container Linux |
|
|
|
command: "{{ item }}" |
|
|
|
with_items: |
|
|
|
- systemctl daemon-reload |
|
|
|
- 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 |
|
|
|
template: |
|
|
|
src: "{{ item.src }}.j2" |
|
|
|
dest: "/etc/systemd/network/{{ item.dst }}" |
|
|
|
mode: 0644 |
|
|
|
with_items: |
|
|
|
- name: Macvlan | Install network gateway interface on Flatcar Container Linux |
|
|
|
template: |
|
|
|
src: "{{ item.src }}.j2" |
|
|
|
dest: "/etc/systemd/network/{{ item.dst }}" |
|
|
|
mode: 0644 |
|
|
|
with_items: |
|
|
|
- {src: coreos-device-macvlan.cfg, dst: macvlan.netdev } |
|
|
|
- {src: coreos-interface-macvlan.cfg, dst: output.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"] |
|
|
|
|
|
|
|
- name: Macvlan | Install cni definition for Macvlan |
|
|
|