21 lines
729 B
YAML
21 lines
729 B
YAML
- name: Configure veth interface for user {{ service_user_name }}
|
|
template:
|
|
src: "./filesystem/common/etc/network/interfaces.d/veth-_service.j2"
|
|
dest: "/etc/network/interfaces.d/{{ service_iface_name }}"
|
|
mode: 0644
|
|
validate: >
|
|
bash -c
|
|
'export NEWIF=%s;
|
|
if ! diff ${NEWIF} /etc/network/interfaces.d/{{ service_iface_name }} &&
|
|
ip link show dev {{ service_iface_name }} ;
|
|
then
|
|
ifdown {{ service_iface_name }} && ifup -i ${NEWIF} {{ service_iface_name }} ;
|
|
fi'
|
|
register: veth_service_intf
|
|
|
|
- name: Enable the path trigger service for {{ service_name }}
|
|
systemd:
|
|
name: "connect-pod-service@{{ service_name }}.path"
|
|
enabled: yes
|
|
state: started
|