28 lines
1.1 KiB
YAML
28 lines
1.1 KiB
YAML
---
|
|
- name: "{{ services_service_name }} : veth : configure interface"
|
|
ansible.builtin.template:
|
|
src: "./veth/interface"
|
|
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_inet_address: "\
|
|
{{ services_host_services[services_service_name].inet_address }}"
|
|
services_service_iface_inet6_address: "\
|
|
{{ services_host_services[services_service_name].inet6_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"
|