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: ansible.builtin.set_fact:
tunnel_service_name: tunnel tunnel_service_name: tunnel
- name: General | Tunnel | Block - name: General | Tunnel | runit
block: block:
- name: General | Tunnel | mkdir | /etc/sv - name: General | Tunnel | runit | mkdir | /etc/sv
ansible.builtin.file: ansible.builtin.file:
path: /etc/sv/{{ tunnel_service_name }}/log path: /etc/sv/{{ tunnel_service_name }}/log
state: directory state: directory
mode: "0755" mode: "0755"
- name: General | Tunnel | mkdir | /var/log - name: General | Tunnel | runit | mkdir | /var/log
ansible.builtin.file: ansible.builtin.file:
path: /var/log/{{ tunnel_service_name }} path: /var/log/{{ tunnel_service_name }}
state: directory state: directory
mode: "0755" mode: "0755"
- name: General | Tunnel | Script | Run - name: General | Tunnel | runit | Script | Run
ansible.builtin.copy: ansible.builtin.copy:
dest: /etc/sv/{{ tunnel_service_name }}/run dest: /etc/sv/{{ tunnel_service_name }}/run
content: | content: |
@@ -43,14 +43,14 @@
-p {{ tunnel_ssh_port }} {{ tunnel_remote_host }} -p {{ tunnel_ssh_port }} {{ tunnel_remote_host }}
mode: "0755" mode: "0755"
- name: General | Tunnel | Script | Finish - name: General | Tunnel | runit | Script | Finish
ansible.builtin.copy: ansible.builtin.copy:
dest: /etc/sv/{{ tunnel_service_name }}/finish dest: /etc/sv/{{ tunnel_service_name }}/finish
content: | content: |
{{ runit_finish_sleep }} {{ runit_finish_sleep }}
mode: "0755" mode: "0755"
- name: General | Tunnel | Script | Log - name: General | Tunnel | runit | Script | Log
ansible.builtin.copy: ansible.builtin.copy:
dest: /etc/sv/{{ tunnel_service_name }}/log/run dest: /etc/sv/{{ tunnel_service_name }}/log/run
content: | content: |
@@ -58,17 +58,17 @@
exec svlogd -tt /var/log/{{ tunnel_service_name }} exec svlogd -tt /var/log/{{ tunnel_service_name }}
mode: "0755" mode: "0755"
- name: General | Tunnel | Script | Log Config - name: General | Tunnel | runit | Script | Log Config
ansible.builtin.copy: ansible.builtin.copy:
dest: /var/log/{{ tunnel_service_name }}/config dest: /var/log/{{ tunnel_service_name }}/config
content: | content: |
{{ runit_log_config_10mb }} {{ runit_log_config_10mb }}
mode: "0755" 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 when: ansible_service_mgr == "runit"
ansible.builtin.service:
name: "{{ tunnel_service_name }}"
state: "{{ 'started' if tunnel_remote_host else 'stopped' }}"
enabled: "{{ true if tunnel_remote_host else false }}"