Gitea updated for the right host and to work with caddy.
This commit is contained in:
1 parent
b727fa7c00
commit
399f5c7a6a
10 files changed
+51
-55
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
# Handlers for Caddy role
|
||||
- name: Reload Caddy configuration
|
||||
ansible.builtin.command: "docker exec -w /etc/caddy {{ caddy_container }} caddy reload"
|
||||
listen: "Reload Caddy"
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: Read current Caddyfile
|
||||
ansible.builtin.slurp:
|
||||
path: "{{ caddyfile_path }}"
|
||||
register: caddyfile_raw
|
||||
|
||||
- name: Decode Caddyfile content
|
||||
set_fact:
|
||||
caddyfile_content: "{{ caddyfile_raw['content'] | b64decode }}"
|
||||
|
||||
- name: Check if snippet already exists
|
||||
set_fact:
|
||||
snippet_present: "{{ snippet_block in caddyfile_content }}"
|
||||
|
||||
- name: Add snippet if missing
|
||||
ansible.builtin.blockinfile:
|
||||
path: "{{ caddyfile_path }}"
|
||||
marker: "# {mark} Ansible managed Caddy snippet for {{ http_host }}"
|
||||
block: "{{ snippet_block }}"
|
||||
create: yes
|
||||
when: not snippet_present
|
||||
notify: "Reload Caddy"
|
||||
@@ -22,8 +22,8 @@
|
||||
memory: "512M"
|
||||
memory_swap: "512M"
|
||||
env:
|
||||
USER_UID: "{{ getent_passwd[user][1] }}"
|
||||
USER_GID: "{{ getent_passwd[user][2] }}"
|
||||
USER_UID: "{{ ansible_facts['getent_passwd'][user][1] }}"
|
||||
USER_GID: "{{ ansible_facts['getent_passwd'][user][2] }}"
|
||||
published_ports:
|
||||
- "127.0.0.1:3000:3000"
|
||||
- "127.0.0.1:2222:22"
|
||||
@@ -32,3 +32,5 @@
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- "/home/{{ user }}/.ssh/:/data/git/.ssh"
|
||||
networks:
|
||||
- name: "{{ docker_network }}"
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: "Ensure {{ container_name }} Docker network exists"
|
||||
docker_network:
|
||||
name: "{{ docker_network }}"
|
||||
state: present
|
||||
connected:
|
||||
- "{{ caddy_container }}"
|
||||
appends: yes
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
# Default variables for Nginx role
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
# Handlers for Nginx role
|
||||
- name: Reload Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
@@ -1,24 +0,0 @@
|
||||
---
|
||||
# Tasks for Nginx role
|
||||
- name: Check if Nginx conf file exists
|
||||
stat:
|
||||
path: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
register: status
|
||||
|
||||
- name: No need to reload Nginx
|
||||
debug:
|
||||
msg: "No need to reload Nginx as sites-available entries have already been created"
|
||||
|
||||
- name: Set Nginx conf file
|
||||
when: status.stat.exists == false
|
||||
template:
|
||||
src: "files/nginx.conf.j2"
|
||||
dest: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
|
||||
- name: Enable new site
|
||||
when: status.stat.exists == false
|
||||
file:
|
||||
src: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
dest: "/etc/nginx/sites-enabled/{{ http_conf }}"
|
||||
state: link
|
||||
notify: Reload Nginx
|
||||
Reference in new issue
Block a user