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

28 lines
1.1 KiB
YAML
Raw Normal View History

2022-12-18 23:43:40 +01:00
---
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:
2023-07-08 10:04:37 +02:00
src: "./veth/interface"
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 }}"
2023-07-29 14:38:57 +02:00
services_service_iface_inet_address: "\
{{ services_host_services[services_service_name].inet_address }}"
services_service_iface_inet6_address: "\
{{ services_host_services[services_service_name].inet6_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"