tunnel, move service task to block and change block to be for runit.

This commit is contained in:
me committed 2026-10-21 09:45:14 -07:00
1 parent 472f7921e7
commit a47d5fd129
1 file changed
+13 -13
+13 -13
View File
@@ -17,22 +17,22 @@
ansible.builtin.set_fact:
tunnel_service_name: tunnel
- name: General | Tunnel | Block
- name: General | Tunnel | runit
block:
- name: General | Tunnel | mkdir | /etc/sv
- name: General | Tunnel | runit | mkdir | /etc/sv
ansible.builtin.file:
path: /etc/sv/{{ tunnel_service_name }}/log
state: directory
mode: "0755"
- name: General | Tunnel | mkdir | /var/log
- name: General | Tunnel | runit | mkdir | /var/log
ansible.builtin.file:
path: /var/log/{{ tunnel_service_name }}
state: directory
mode: "0755"
- name: General | Tunnel | Script | Run
- name: General | Tunnel | runit | Script | Run
ansible.builtin.copy:
dest: /etc/sv/{{ tunnel_service_name }}/run
content: |
@@ -43,14 +43,14 @@
-p {{ tunnel_ssh_port }} {{ tunnel_remote_host }}
mode: "0755"
- name: General | Tunnel | Script | Finish
- name: General | Tunnel | runit | Script | Finish
ansible.builtin.copy:
dest: /etc/sv/{{ tunnel_service_name }}/finish
content: |
{{ runit_finish_sleep }}
mode: "0755"
- name: General | Tunnel | Script | Log
- name: General | Tunnel | runit | Script | Log
ansible.builtin.copy:
dest: /etc/sv/{{ tunnel_service_name }}/log/run
content: |
@@ -58,17 +58,17 @@
exec svlogd -tt /var/log/{{ tunnel_service_name }}
mode: "0755"
- name: General | Tunnel | Script | Log Config
- name: General | Tunnel | runit | Script | Log Config
ansible.builtin.copy:
dest: /var/log/{{ tunnel_service_name }}/config
content: |
{{ runit_log_config_10mb }}
mode: "0755"
when: tunnel_remote_host != "false"
- name: General | Tunnel | runit | Service | Enable
ansible.builtin.service:
name: "{{ tunnel_service_name }}"
state: "{{ 'started' if tunnel_remote_host else 'stopped' }}"
enabled: "{{ true if tunnel_remote_host else false }}"
- name: General | Tunnel | Service | Enable
ansible.builtin.service:
name: "{{ tunnel_service_name }}"
state: "{{ 'started' if tunnel_remote_host else 'stopped' }}"
enabled: "{{ true if tunnel_remote_host else false }}"
when: ansible_service_mgr == "runit"