runner

Ansible role that deployes services on my runner machine

4.5 KBYML
main.yml
4.5 KB163 lines • yaml
1---
2# Runner Services Role - Main Tasks
3
4- name: Check if runner role is enabled
5  fail:
6    msg: "Runner role is disabled. Set runner_enabled: true to enable."
7  when: not runner_enabled
8  tags: always
9
10- name: Display runner role start message
11  debug:
12    msg: "Starting Runner Services deployment with {{ ansible_play_hosts | length }} host(s)"
13  tags: always
14
15# Prerequisites and system setup
16- name: Include prerequisites tasks
17  include_tasks: prerequisites.yml
18  tags:
19    - runner
20    - prerequisites
21    - setup
22
23# Fix existing directory permissions
24- name: Include permission fixing tasks
25  include_tasks: fix-permissions.yml
26  tags:
27    - runner
28    - permissions
29    - fix
30
31# Performance tuning
32- name: Include performance tuning tasks
33  include_tasks: performance.yml
34  when: runner_performance_tuning_enabled
35  tags:
36    - runner
37    - performance
38    - tuning
39
40# NFS mount configuration  
41- name: Include NFS mount tasks
42  include_tasks: nfs-mounts.yml
43  when: runner_nfs_enabled
44  tags:
45    - runner
46    - nfs
47    - mounts
48
49# Docker network setup
50- name: Include docker network tasks
51  include_tasks: docker-network.yml
52  tags:
53    - runner
54    - docker
55    - network
56
57# Service deployments
58- name: Include Frigate deployment
59  import_tasks: frigate.yml
60  when: frigate_enabled
61  tags:
62    - frigate
63
64- name: Include Immich deployment
65  import_tasks: immich.yml
66  when: immich_enabled
67  tags:
68    - immich
69
70- name: Include Forgejo deployment
71  import_tasks: forgejo.yml
72  when: forgejo_enabled
73  tags:
74    - forgejo
75
76- name: Include Stirling-PDF deployment
77  import_tasks: stirling-pdf.yml
78  when: stirling_pdf_enabled
79  tags:
80    - stirling-pdf
81
82- name: Include Tandoor deployment
83  import_tasks: tandoor.yml
84  when: tandoor_enabled
85  tags:
86    - tandoor
87
88- name: Include Ghost CMS deployment
89  import_tasks: ghost.yml
90  when: ghost_enabled
91  tags:
92    - ghost
93
94- name: Include CVAT deployment
95  import_tasks: cvat.yml
96  when: cvat_enabled
97  tags:
98    - cvat
99
100- name: Include Harbor deployment
101  import_tasks: harbor.yml
102  when: harbor_enabled
103  tags:
104    - harbor
105
106- name: Display runner deployment summary
107  debug:
108    msg: |
109      Runner Services deployment completed successfully!
110      
111      Services Status:
112      - Frigate (CCTV): {{ 'Enabled' if frigate_enabled else 'Disabled' }}
113      - Immich (Photos): {{ 'Enabled' if immich_enabled else 'Disabled' }}
114      - Forgejo (Git): {{ 'Enabled' if forgejo_enabled else 'Disabled' }}
115      - Harbor (Registry): {{ 'Enabled' if harbor_enabled else 'Disabled' }}
116      - Stirling-PDF: {{ 'Enabled' if stirling_pdf_enabled else 'Disabled' }}
117      - Tandoor (Recipes): {{ 'Enabled' if tandoor_enabled else 'Disabled' }}
118      - Ghost CMS: {{ 'Enabled' if ghost_enabled else 'Disabled' }}
119      - CVAT: {{ 'Enabled' if cvat_enabled else 'Disabled' }}
120      
121      Access Information:
122      {% if frigate_enabled %}
123      - Frigate: http://{{ ansible_default_ipv4.address }}:{{ frigate_port }}
124      {% endif %}
125      {% if immich_enabled %}
126      - Immich: http://{{ ansible_default_ipv4.address }}:{{ immich_server_port }}
127      {% endif %}
128      {% if forgejo_enabled %}
129      - Forgejo: http://{{ ansible_default_ipv4.address }}:{{ forgejo_http_port }}
130      - Forgejo SSH: ssh://git@{{ ansible_default_ipv4.address }}:{{ forgejo_ssh_port }}
131      {% endif %}
132      {% if harbor_enabled %}
133      - Harbor Registry: http://{{ ansible_default_ipv4.address }}:{{ harbor_http_port | default(8080) }}
134      - Harbor Admin: admin/{{ harbor_admin_password | default('Harbor12345') }}
135      {% endif %}
136      {% if stirling_pdf_enabled %}
137      - Stirling-PDF: http://{{ ansible_default_ipv4.address }}:{{ stirling_pdf_port }}
138      {% endif %}
139      {% if tandoor_enabled %}
140      - Tandoor: http://{{ ansible_default_ipv4.address }}:{{ tandoor_port }}
141      {% endif %}
142      {% if ghost_enabled %}
143      - Ghost CMS: http://{{ ansible_default_ipv4.address }}:{{ ghost_port }}
144      {% endif %}
145      {% if cvat_enabled %}
146      - CVAT: http://{{ cvat_domain }}
147      {% endif %}
148      
149      Management Scripts: /usr/local/bin/runner-*
150      
151      Service Directories (Consolidated Structure):
152      - Frigate: {{ frigate_config_dir }}
153      - Immich: {{ immich_config_dir }}
154      - Forgejo: {{ forgejo_config_dir }}
155      - Harbor: {{ harbor_config_dir }}
156      - Stirling-PDF: {{ stirling_pdf_config_dir }}
157      - Tandoor: {{ tandoor_config_dir }}
158      - Ghost: {{ ghost_config_dir }}
159      - CVAT: {{ cvat_config_dir }}
160      
161      NFS Mounts: {{ runner_nfs_mount_dir }}
162  tags: always
163