Merge "Fix postup/postdown on RedHat/CentOS hosts"

This commit is contained in:
Jenkins 2016-09-30 02:43:33 +00:00 committed by Gerrit Code Review
commit 01121f7acd
3 changed files with 15 additions and 2 deletions

View File

@ -76,9 +76,10 @@
- name: Put down post-up script for veth-peer interfaces (RedHat)
template:
src: "network_interfaces/redhat_interface_{{ item[0] | default('default') }}.cfg.j2"
dest: "/etc/sysconfig/network-scripts/{{ item[0] }}-{{ item[1].name | default('br-mgmt') }}-2-{{ item[1].veth_peer | default('eth1') }}.sh"
dest: "/etc/sysconfig/network-scripts/{{ item[0] }}-veth-{{ item[1].name | default('br-mgmt') }}-2-{{ item[1].veth_peer | default('eth1') }}"
mode: "0755"
with_nested:
- [ "postdown-veth", "postup-veth" ]
- [ "ifup-post", "ifdown-post" ]
- "{{ bridges }}"
when:
- item[1].veth_peer is defined
@ -93,6 +94,18 @@
tags:
- networking-interfaces-load
- name: Ensure the postup/postdown scripts are loaded (RedHat)
lineinfile:
dest: "/etc/sysconfig/network-scripts/{{ item[0] }}"
line: ". /etc/sysconfig/network-scripts/{{ item[0] }}-veth-{{ item[1].name | default('br-mgmt') }}-2-{{ item[1].veth_peer | default('eth1') }}"
insertbefore: "^exit 0"
with_nested:
- [ "ifup-post", "ifdown-post" ]
- "{{ bridges }}"
when:
- item[1].veth_peer is defined
- ansible_pkg_mgr == 'yum'
- name: Shut down the network interfaces
command: "ifdown {{ item.name | default('br-mgmt') }}"
when: