Fix ansible issues
This commit is contained in:
parent
ecd00fc75d
commit
872f545c64
6 changed files with 32 additions and 18 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use nix
|
|
@ -10,23 +10,27 @@
|
|||
path: "{{ service_path }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Create a service-config directory for {{ svc.name }}
|
||||
ansible.builtin.file:
|
||||
path: "{{ config_path }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
mode: "0700"
|
||||
|
||||
- name: Template {{ svc.name }} docker-compose
|
||||
- name: Template docker-compose for {{ svc.name }}
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ (service_path, 'docker-compose.yml') | path_join }}"
|
||||
mode: "0644"
|
||||
|
||||
- name: Template {{ svc.name }} config
|
||||
- name: Template config for {{ svc.name }}
|
||||
ansible.builtin.template:
|
||||
src: config.cfg.j2
|
||||
dest: "{{ (config_path, 'config.cfg') | path_join }}"
|
||||
mode: "0600"
|
||||
|
||||
- name: Template {{ svc.name }} caddy config
|
||||
- name: Template caddy config for {{ svc.name }}
|
||||
ansible.builtin.template:
|
||||
src: caddy_site.conf.j2
|
||||
dest: "{{ (caddy_config_path, svc.domain + '.conf') | path_join }}"
|
||||
mode: "0644"
|
||||
|
|
|
@ -16,12 +16,11 @@ svc:
|
|||
compose:
|
||||
watchtower: true
|
||||
image: joohoi/acme-dns
|
||||
|
||||
compose_file:
|
||||
services:
|
||||
app:
|
||||
ports:
|
||||
- "53:53"
|
||||
- "53:53/udp"
|
||||
volumes:
|
||||
- ./config:/etc/acme-dns:ro
|
||||
file:
|
||||
services:
|
||||
app:
|
||||
ports:
|
||||
- "53:53"
|
||||
- "53:53/udp"
|
||||
volumes:
|
||||
- ./config:/etc/acme-dns:ro
|
||||
|
|
|
@ -12,17 +12,20 @@
|
|||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Template {{ svc.name }} docker-compose
|
||||
- name: Template docker-compose for {{ svc.name }}
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ (service_path, 'docker-compose.yml') | path_join }}"
|
||||
mode: "0644"
|
||||
|
||||
- name: Template {{ svc.name }} service.env file
|
||||
- name: Template service.env file for {{ svc.name }}
|
||||
ansible.builtin.template:
|
||||
src: service.env.j2
|
||||
dest: "{{ (service_path, 'service.env') | path_join }}"
|
||||
mode: "0600"
|
||||
|
||||
- name: Template {{ svc.name }} caddy config
|
||||
- name: Template caddy config for {{ svc.name }}
|
||||
ansible.builtin.template:
|
||||
src: caddy_site.conf.j2
|
||||
dest: "{{ (caddy_config_path, svc.domain + '.conf') | path_join }}"
|
||||
mode: "0644"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% set compose_file = compose_file | default({}) %}
|
||||
{% set compose_file = compose.file | default({}) %}
|
||||
{% set compose_file = compose_default_file | combine(compose_file, recursive=True) %}
|
||||
{% if compose.env | default(False) %}
|
||||
{% set compose_file = compose_file | combine(compose_env_file, recursive=True) %}
|
||||
{% set compose_file = compose_file | combine(compose_env_file, recursive=True) %}
|
||||
{% endif %}
|
||||
{{ compose_file | to_nice_yaml }}
|
||||
|
|
7
shell.nix
Normal file
7
shell.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
with import <nixpkgs> {};
|
||||
mkShell {
|
||||
nativeBuildInputs = [
|
||||
ansible
|
||||
ansible-lint
|
||||
];
|
||||
}
|
Reference in a new issue