Better molecule.

This commit is contained in:
Laur Ivan 2022-09-18 13:11:29 +02:00
parent 0b1d1754a8
commit 5932c1bf58
3 changed files with 22 additions and 3 deletions

View File

@ -0,0 +1,19 @@
---
- name: Clean up
hosts: all
tasks:
- name: Check if the docker-compose file exists.
ansible.builtin.stat:
path: "~/authentik/docker-compose.yml"
register: docker_compose_file
- name: Remove authentik docker-compose.
community.docker.docker_compose:
project_src: ~/authentik/
build: false
state: absent
when: docker_compose_file.stat.exists
become: false
- name: Remove the docker-compose file
ansible.builtin.file:
path: "~/authentik/docker-compose.yml"
state: absent

View File

@ -1,6 +1,6 @@
--- ---
- name: Setup the test machine - name: Setup the test machine
hosts: instance-authentik hosts: all
tasks: tasks:
- name: create docker.sock - name: create docker.sock
raw: touch /var/run/docker.sock raw: touch /var/run/docker.sock

View File

@ -2,7 +2,7 @@
# tasks file for authentik # tasks file for authentik
- name: Set up directories - name: Set up directories
file: ansible.builtin.file:
state: directory state: directory
path: "{{ item }}" path: "{{ item }}"
mode: 0755 mode: 0755
@ -19,7 +19,7 @@
become: false become: false
- name: Set up the database directory. - name: Set up the database directory.
file: ansible.builtin.file:
state: directory state: directory
path: "{{ item }}" path: "{{ item }}"
mode: 0755 mode: 0755