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

24 lines
945 B
YAML
Raw Normal View History

2022-12-11 00:41:50 +01:00
- name: "user : {{ services_service_name }} : veth : configure interface"
ansible.builtin.template:
src: "./user/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[services_service_name].address }}"
- name: "user : {{ services_service_name }} : veth : enable the path trigger"
ansible.builtin.systemd:
name: "connect-pod-service@{{ services_service_name }}.path"
enabled: true
state: "started"