started with templates

This commit is contained in:
Bertrand Lanson 2023-05-29 00:06:27 +02:00
parent 0697d65438
commit 13a4423259
4 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,6 @@
--- ---
# defaults file for deploy_adguard # defaults file for deploy_adguard
deploy_adguard_directory: /adguard deploy_adguard_directory: /opt/adguard
deploy_adguard_timezone: "Europe/Paris" deploy_adguard_timezone: "Europe/Paris"
deploy_adguard_enable_admin_interface: true deploy_adguard_enable_admin_interface: true
deploy_adguard_enable_dhcp: false deploy_adguard_enable_dhcp: false

View File

@ -0,0 +1,9 @@
---
# task/configure file for deploy_adguard
- name: "Copy docker-compose.yml template"
ansible.builtin.template:
src: "docker-compose.yml.j2"
dest: "{{ deploy_adguard_directory }}/docker-compose.yml"
owner: root
group: root
mode: '0600'

View File

@ -0,0 +1,13 @@
[Unit]
Description=Some personal Docker containers
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "docker compose -f {{ deploy_adguard_directory }}/docker-compose.yml up --detach"
ExecStop=/bin/bash -c "docker compose -f {{ deploy_adguard_directory }}/docker-compose.yml stop"
[Install]
WantedBy=multi-user.target

View File