install.fairie/home/dot_local/share/ansible/tasks/qubes/tcp-port-bind.yml

30 lines
797 B
YAML
Raw Normal View History

2023-07-15 22:40:26 -07:00
---
- 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([]) }}'