ansible-edda/playbooks/services/roles/setup/user/tasks/include/veth.yml

24 lines
940 B
YAML

- name: "{{ services_service_name }} : veth : configure interface"
ansible.builtin.template:
src: "./veth/interface.j2"
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 }}"
- name: "{{ services_service_name }} : veth : enable the path trigger"
ansible.builtin.systemd:
name: "connect-pod-service@{{ services_service_name }}.path"
enabled: true
state: "started"