mirror of
https://github.com/Crocmagnon/ansible.git
synced 2024-11-21 23:08:01 +01:00
Compare commits
4 commits
a19f54552b
...
c6b897f218
Author | SHA1 | Date | |
---|---|---|---|
c6b897f218 | |||
6aa82a24d4 | |||
1d74e9609b | |||
7e5807e009 |
16 changed files with 63 additions and 46 deletions
|
@ -8,7 +8,7 @@
|
|||
- import_playbook: display.yaml # noqa: name[play]
|
||||
- import_playbook: ghost-config.yaml # noqa: name[play]
|
||||
- import_playbook: ghost-update.yaml # noqa: name[play]
|
||||
- import_playbook: gitea.yaml # noqa: name[play]
|
||||
- import_playbook: git.yaml # noqa: name[play]
|
||||
- import_playbook: goatcounter.yaml # noqa: name[play]
|
||||
- import_playbook: lyon-transports.yaml # noqa: name[play]
|
||||
- import_playbook: manuels.yaml # noqa: name[play]
|
||||
|
@ -21,4 +21,5 @@
|
|||
- import_playbook: test_headers.yaml # noqa: name[play]
|
||||
- import_playbook: voice-pipeline.yaml # noqa: name[play]
|
||||
- import_playbook: wallabag.yaml # noqa: name[play]
|
||||
- import_playbook: watchtower.yaml # noqa: name[play]
|
||||
- import_playbook: ynab.yaml # noqa: name[play]
|
||||
|
|
|
@ -3,5 +3,7 @@ services:
|
|||
build:
|
||||
context: sources
|
||||
restart: always
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=false"
|
||||
ports:
|
||||
- "127.0.0.1:9010:80"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
server:
|
||||
image: codeberg.org/forgejo/forgejo:8
|
||||
image: codeberg.org/forgejo/forgejo:9
|
||||
env_file: gitea.env
|
||||
restart: always
|
||||
volumes:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
app:
|
||||
image: python:3.13-slim
|
||||
image: python:3-slim
|
||||
command: python /app/app.py
|
||||
volumes:
|
||||
- ./:/app
|
||||
|
|
8
playbooks/apps/files/watchtower/docker-compose.yaml
Normal file
8
playbooks/apps/files/watchtower/docker-compose.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
services:
|
||||
watchtower:
|
||||
image: containrrr/watchtower
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /home/gaugendre/.docker/config.json:/config.json
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
command: --interval 86400 --cleanup --include-restarting
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: Gitea
|
||||
- name: Forgejo
|
||||
hosts: servers
|
||||
gather_facts: false
|
||||
tasks:
|
|
@ -33,13 +33,12 @@
|
|||
- name: Write service unit file
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: templates/goatcounter.service.j2
|
||||
src: templates/goatcounter/goatcounter.service.j2
|
||||
dest: /etc/systemd/system/goatcounter.service
|
||||
mode: "0600"
|
||||
owner: root
|
||||
group: root
|
||||
notify:
|
||||
- Daemon-reload
|
||||
- Restart service
|
||||
- name: Flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
@ -51,15 +50,12 @@
|
|||
enabled: true
|
||||
|
||||
handlers:
|
||||
- name: Daemon-reload
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: true
|
||||
- name: Restart service
|
||||
become: true
|
||||
ansible.builtin.service:
|
||||
ansible.builtin.systemd:
|
||||
name: goatcounter
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
|
||||
vars:
|
||||
ansible_python_interpreter: /tmp/ansible/bin/python
|
||||
|
|
|
@ -6,13 +6,12 @@
|
|||
- name: Write service file
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: templates/lyon-transports.service.j2
|
||||
src: templates/lyon-transports/lyon-transports.service.j2
|
||||
dest: /etc/systemd/system/lyon-transports.service
|
||||
mode: "0600"
|
||||
owner: root
|
||||
group: root
|
||||
notify:
|
||||
- Reload daemon
|
||||
- Restart service
|
||||
- name: Flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
@ -24,15 +23,12 @@
|
|||
enabled: true
|
||||
|
||||
handlers:
|
||||
- name: Reload daemon
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: true
|
||||
- name: Restart service
|
||||
become: true
|
||||
ansible.builtin.service:
|
||||
ansible.builtin.systemd:
|
||||
name: lyon-transports
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
|
||||
vars:
|
||||
dir: /mnt/data/lyon-transports
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
[Unit]
|
||||
Description=Goatcounter
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart={{ dir }}/goatcounter serve -listen *:8005 -tls http -smtp smtps://goatcounter%%40mg.augendre.info:{{gc_mailgun_api_key}}@smtp.mailgun.org:587 -email-from goatcounter@mg.augendre.info -automigrate -db sqlite+{{ dir }}/db/goatcounter.sqlite3
|
||||
Type=simple
|
||||
Restart=always
|
||||
User=gaugendre
|
||||
Group=gaugendre
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
13
playbooks/apps/templates/goatcounter/goatcounter.service.j2
Normal file
13
playbooks/apps/templates/goatcounter/goatcounter.service.j2
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Goatcounter
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart={{ dir }}/goatcounter serve -listen 127.0.0.1:8005 -tls http -smtp smtps://goatcounter%%40mg.augendre.info:{{gc_mailgun_api_key}}@smtp.mailgun.org:587 -email-from goatcounter@mg.augendre.info -automigrate -db sqlite+{{ dir }}/db/goatcounter.sqlite3
|
||||
Type=simple
|
||||
Restart=always
|
||||
User=gaugendre
|
||||
Group=gaugendre
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
|
@ -1,13 +0,0 @@
|
|||
[Unit]
|
||||
Description=Lyon transports API
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart={{ dir }}/lyon-transports-linux-amd64 --host 0.0.0.0 --port 8013 -u {{ lyon_transports_username }} -p {{ lyon_transports_password }} --cors-allowed-origin https://display.augendre.info
|
||||
Type=simple
|
||||
Restart=always
|
||||
User=gaugendre
|
||||
Group=gaugendre
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Lyon transports API
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart={{ dir }}/lyon-transports-linux-amd64 --host 127.0.0.1 --port 8013 -u {{ lyon_transports_username }} -p {{ lyon_transports_password }} --cors-allowed-origin https://display.augendre.info
|
||||
Type=simple
|
||||
Restart=always
|
||||
User=gaugendre
|
||||
Group=gaugendre
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
11
playbooks/apps/watchtower.yaml
Normal file
11
playbooks/apps/watchtower.yaml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- name: Watchtower
|
||||
hosts: servers
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Docker
|
||||
ansible.builtin.include_role:
|
||||
name: docker
|
||||
|
||||
vars:
|
||||
docker_app_name: watchtower
|
|
@ -2,3 +2,4 @@
|
|||
docker_app_name: some-app
|
||||
docker_dir: /mnt/data/{{ docker_app_name }}
|
||||
docker_build: policy
|
||||
docker_remove_orphans: true
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
---
|
||||
- name: Stop service
|
||||
listen: Restart service
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ docker_dir }}"
|
||||
state: stopped
|
||||
listen: Restart service
|
||||
- name: Start service
|
||||
listen: Restart service
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ docker_dir }}"
|
||||
state: present
|
||||
build: "{{ docker_build }}"
|
||||
listen: Restart service
|
||||
remove_orphans: "{{ docker_remove_orphans }}"
|
||||
|
|
|
@ -30,3 +30,4 @@
|
|||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ docker_dir }}"
|
||||
state: present
|
||||
remove_orphans: "{{ docker_remove_orphans }}"
|
||||
|
|
Loading…
Reference in a new issue