kayobe/ansible/roles/veth/tasks/main.yml
Raimund Hook 6df6277096 Updating Jinja filters to conform to Ansible 2.5+
Since Ansible 2.5, the use of jinja tests as filters has been deprecated.

I've run the script provided by the ansible team to 'fix' the jinja filters
to conform to the newer syntax.

This fixes the deprecation warnings.

Change-Id: I775c849c944f82bdfc779c8c530346e7ebedbd2a
2019-06-28 16:34:24 +01:00

44 lines
1.1 KiB
YAML

---
- name: Ensure veth sysconfig network control scripts exist
copy:
src: "{{ item }}"
dest: "{{ network_scripts_dir }}/{{ item }}"
owner: root
group: root
mode: 0755
with_items:
- "ifup-veth"
- "ifdown-veth"
become: True
register: ctl_result
- name: Ensure veth sysconfig network interface files exist
template:
src: ifcfg-veth.j2
dest: "{{ network_scripts_dir }}/ifcfg-{{ item.device }}"
owner: root
group: root
mode: 0644
with_items: "{{ veth_interfaces }}"
become: True
register: veth_result
- name: Ensure veth peer sysconfig network interface files exist
template:
src: ifcfg-peer.j2
dest: "{{ network_scripts_dir }}/ifcfg-{{ item.peer_device }}"
owner: root
group: root
mode: 0644
with_items: "{{ veth_interfaces }}"
become: True
register: peer_result
- name: Bounce veth interfaces
shell: ifdown {{ item[0].item.device }} ; ifup {{ item[0].item.device }}
with_together:
- "{{ veth_result.results }}"
- "{{ peer_result.results }}"
when: ctl_result is changed or item[0] is changed or item[1] is changed
become: True