4 Commits

Author SHA1 Message Date
92a51785cb Set also the group for directories. 2022-09-22 14:33:46 +02:00
adf56827ad Create directories via become. 2022-09-22 11:41:02 +02:00
6f34af57d4 Better molecule support. 2022-09-22 11:22:57 +02:00
3707a3bdd9 Remove unnecessary requirements. 2022-09-20 23:17:05 +02:00
8 changed files with 35 additions and 19 deletions

View File

@@ -8,13 +8,16 @@
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
when: docker_compose_file.stat.exists

View File

@@ -3,20 +3,9 @@
hosts: all
# gather_facts: false
pre_tasks:
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == 'Debian'
- name: Install python requests
pip:
name:
- requests
- docker
- docker-compose
- name: Install docker
vars:
docker_service_manage: false
include_role:
name: geerlingguy.docker
- name: "Include necessary variables"
ansible.builtin.include_vars:
file: "../../.env.yml"
roles:
- role: laurivan.authentik

View File

@@ -6,6 +6,10 @@
no_log: "{{ molecule_no_log }}"
tasks:
# Developer must implement.
- name: Remove the docker image
community.docker.docker_container:
name: instance-authentik
state: absent
# Mandatory configuration for Molecule to function.

View File

@@ -10,7 +10,7 @@ dependency:
driver:
name: docker
platforms:
- name: instance
- name: instance-authentik
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos8}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:

View File

@@ -1,12 +1,30 @@
---
- name: Setup the test machine
hosts: instance
hosts: instance-authentik
tasks:
- name: Create docker.sock
raw: touch /var/run/docker.sock
become: true
changed_when: false
- name: Move docker.sock from tmp
raw: mount --move /tmp/docker_mounted.sock /var/run/docker.sock
become: true
changed_when: false
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == 'Debian'
- name: Install python requests
pip:
name:
- requests
- docker
- docker-compose
- name: Install docker
vars:
docker_service_manage: false
include_role:
name: geerlingguy.docker

View File

@@ -8,3 +8,4 @@
- name: Example assertion
ansible.builtin.assert:
that: true

View File

@@ -1,5 +1,4 @@
---
roles:
- geerlingguy.docker
collections:
# - community.docker
collections: []

View File

@@ -5,7 +5,9 @@
ansible.builtin.file:
state: directory
path: "{{ item }}"
mode: 0755
mode: '0755'
owner: "{{ ansible_effective_user_id }}"
group: "{{ ansible_effective_group_id }}"
with_items:
- "{{ authentik_volume_media }}"
- "{{ authentik_volume_certs }}"