fix: podman connect
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: Create uptime-kuma project directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ podman_projects_dir }}/uptime-kuma"
|
||||
path: "{{ podman_projects_dir | default('/opt/podman') }}/uptime-kuma"
|
||||
state: directory
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
@@ -15,10 +15,10 @@
|
||||
group: "{{ ansible_user }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Deploy docker-compose.yml for uptime-kuma
|
||||
- name: Deploy Kubernetes YAML for uptime-kuma
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ podman_projects_dir }}/uptime-kuma/docker-compose.yml"
|
||||
src: uptime-kuma.yaml.j2
|
||||
dest: "{{ podman_projects_dir | default('/opt/podman') }}/uptime-kuma/uptime-kuma.yaml"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
mode: "0644"
|
||||
@@ -43,7 +43,7 @@
|
||||
- name: Deploy nginx vhost configuration for uptime-kuma
|
||||
ansible.builtin.template:
|
||||
src: nginx-vhost.conf.j2
|
||||
dest: "{{ nginx_conf_dir }}/uptime-kuma.conf"
|
||||
dest: "{{ nginx_conf_dir | default('/etc/nginx/conf.d') }}/uptime-kuma.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
- name: Remove nginx vhost configuration for uptime-kuma
|
||||
ansible.builtin.file:
|
||||
path: "{{ nginx_conf_dir }}/uptime-kuma.conf"
|
||||
path: "{{ nginx_conf_dir | default('/etc/nginx/conf.d') }}/uptime-kuma.conf"
|
||||
state: absent
|
||||
when: not uptime_kuma_nginx_enabled
|
||||
notify: Reload nginx
|
||||
|
||||
@@ -25,10 +25,10 @@ server {
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ uptime_kuma_nginx_hostname }}/privkey.pem;
|
||||
|
||||
# SSL configuration
|
||||
ssl_protocols {{ nginx_ssl_protocols }};
|
||||
ssl_prefer_server_ciphers {{ 'on' if nginx_ssl_prefer_server_ciphers else 'off' }};
|
||||
ssl_protocols {{ nginx_ssl_protocols | default('TLSv1.3') }};
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
{% if nginx_log_backend == 'journald' %}
|
||||
{% if nginx_log_backend | default('journald') == 'journald' %}
|
||||
access_log syslog:server=unix:/dev/log,nohostname,tag=nginx_uptime_kuma;
|
||||
error_log syslog:server=unix:/dev/log,nohostname,tag=nginx_uptime_kuma;
|
||||
{% else %}
|
||||
|
||||
@@ -8,9 +8,9 @@ Type=oneshot
|
||||
RemainAfterExit=true
|
||||
User={{ ansible_user }}
|
||||
Group={{ ansible_user }}
|
||||
WorkingDirectory={{ podman_projects_dir }}/uptime-kuma
|
||||
ExecStart=/usr/bin/podman-compose up -d
|
||||
ExecStop=/usr/bin/podman-compose down
|
||||
WorkingDirectory={{ podman_projects_dir | default('/opt/podman') }}/uptime-kuma
|
||||
ExecStart=/usr/bin/podman play kube --replace uptime-kuma.yaml
|
||||
ExecStop=/usr/bin/podman play kube --down uptime-kuma.yaml
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: uptime-kuma
|
||||
labels:
|
||||
app: uptime-kuma
|
||||
spec:
|
||||
containers:
|
||||
- name: server
|
||||
image: {{ uptime_kuma_image }}:{{ uptime_kuma_version }}
|
||||
ports:
|
||||
- containerPort: 3001
|
||||
hostPort: {{ uptime_kuma_port }}
|
||||
env:
|
||||
- name: TZ
|
||||
value: "{{ uptime_kuma_timezone }}"
|
||||
volumeMounts:
|
||||
- name: localtime
|
||||
mountPath: /etc/localtime
|
||||
readOnly: true
|
||||
- name: uptime-kuma-data
|
||||
mountPath: /app/data
|
||||
restartPolicy: Always
|
||||
|
||||
volumes:
|
||||
- name: localtime
|
||||
hostPath:
|
||||
path: /etc/localtime
|
||||
type: File
|
||||
- name: uptime-kuma-data
|
||||
hostPath:
|
||||
path: {{ uptime_kuma_data_dir }}
|
||||
type: Directory
|
||||
Reference in New Issue
Block a user