install.fairie/home/dot_local/share/ansible/tasks/qubes/tcp-port-bind.yml
2023-07-16 01:40:26 -04:00

29 lines
797 B
YAML

---
- name: 'Create {{ service.name }}.socket systemd file'
become: true
copy:
content: |
[Unit]
Description={{ service.name }}
[Socket]
ListenStream=127.0.0.1:{{ service.port }}
Accept=true
[Install]
WantedBy=sockets.target
dest: '/lib/systemd/system/{{ service.name }}.socket'
loop: '{{ systemd_services | default([]) }}'
loop_control:
loop_var: service
- name: Create service_name@.service systemd file
become: true
copy:
content: |
[Unit]
Description={{ item.name }}
[Service]
ExecStart=qrexec-client-vm '' qubes.ConnectTCP+{{ item.port }}
StandardInput=socket
StandardOutput=inherit
dest: /lib/systemd/system/{{ item.name }}@.service
loop: '{{ systemd_services | default([]) }}'