ansible-edda/plays/services/roles/setup_user/tasks/include/veth.yml

24 lines
940 B
YAML
Raw Normal View History

2022-12-12 23:49:20 +01:00
- name: "{{ services_service_name }} : veth : configure interface"
2022-12-11 00:41:50 +01:00
ansible.builtin.template:
2022-12-12 23:49:20 +01:00
src: "./veth/interface.j2"
2022-12-11 00:41:50 +01:00
dest: "/etc/network/interfaces.d/{{ services_service_iface_name }}"
mode: 0644
validate: >
bash -c
'export NEWIF=%s;
if ! diff ${NEWIF} /etc/network/interfaces.d/{{ services_service_iface_name }} &&
ip link show dev {{ services_service_iface_name }} ;
then
ifdown {{ services_service_iface_name }} &&
ifup -i ${NEWIF} {{ services_service_iface_name }} ;
fi'
vars:
services_service_iface_name: "veth-{{ services_service_name }}"
services_service_iface_address: "{{ services_host_services[services_service_name].address }}"
2022-12-11 00:41:50 +01:00
2022-12-12 23:49:20 +01:00
- name: "{{ services_service_name }} : veth : enable the path trigger"
2022-12-11 00:41:50 +01:00
ansible.builtin.systemd:
name: "connect-pod-service@{{ services_service_name }}.path"
enabled: true
state: "started"