Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92a51785cb | |||
| adf56827ad | |||
| 6f34af57d4 | |||
| 3707a3bdd9 |
@@ -8,13 +8,16 @@
|
|||||||
path: "~/authentik/docker-compose.yml"
|
path: "~/authentik/docker-compose.yml"
|
||||||
register: docker_compose_file
|
register: docker_compose_file
|
||||||
- name: Remove authentik docker-compose.
|
- name: Remove authentik docker-compose.
|
||||||
|
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: ~/authentik/
|
project_src: ~/authentik/
|
||||||
build: false
|
build: false
|
||||||
state: absent
|
state: absent
|
||||||
when: docker_compose_file.stat.exists
|
when: docker_compose_file.stat.exists
|
||||||
become: false
|
become: false
|
||||||
|
|
||||||
- name: Remove the docker-compose file
|
- name: Remove the docker-compose file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "~/authentik/docker-compose.yml"
|
path: "~/authentik/docker-compose.yml"
|
||||||
state: absent
|
state: absent
|
||||||
|
when: docker_compose_file.stat.exists
|
||||||
|
|||||||
@@ -3,20 +3,9 @@
|
|||||||
hosts: all
|
hosts: all
|
||||||
# gather_facts: false
|
# gather_facts: false
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Update apt cache.
|
- name: "Include necessary variables"
|
||||||
apt: update_cache=yes cache_valid_time=600
|
ansible.builtin.include_vars:
|
||||||
when: ansible_os_family == 'Debian'
|
file: "../../.env.yml"
|
||||||
- name: Install python requests
|
|
||||||
pip:
|
|
||||||
name:
|
|
||||||
- requests
|
|
||||||
- docker
|
|
||||||
- docker-compose
|
|
||||||
- name: Install docker
|
|
||||||
vars:
|
|
||||||
docker_service_manage: false
|
|
||||||
include_role:
|
|
||||||
name: geerlingguy.docker
|
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: laurivan.authentik
|
- role: laurivan.authentik
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
no_log: "{{ molecule_no_log }}"
|
no_log: "{{ molecule_no_log }}"
|
||||||
tasks:
|
tasks:
|
||||||
# Developer must implement.
|
# Developer must implement.
|
||||||
|
- name: Remove the docker image
|
||||||
|
community.docker.docker_container:
|
||||||
|
name: instance-authentik
|
||||||
|
state: absent
|
||||||
|
|
||||||
# Mandatory configuration for Molecule to function.
|
# Mandatory configuration for Molecule to function.
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ dependency:
|
|||||||
driver:
|
driver:
|
||||||
name: docker
|
name: docker
|
||||||
platforms:
|
platforms:
|
||||||
- name: instance
|
- name: instance-authentik
|
||||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos8}-ansible:latest"
|
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos8}-ansible:latest"
|
||||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -1,12 +1,30 @@
|
|||||||
---
|
---
|
||||||
- name: Setup the test machine
|
- name: Setup the test machine
|
||||||
hosts: instance
|
hosts: instance-authentik
|
||||||
tasks:
|
tasks:
|
||||||
- name: Create docker.sock
|
- name: Create docker.sock
|
||||||
raw: touch /var/run/docker.sock
|
raw: touch /var/run/docker.sock
|
||||||
become: true
|
become: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Move docker.sock from tmp
|
- name: Move docker.sock from tmp
|
||||||
raw: mount --move /tmp/docker_mounted.sock /var/run/docker.sock
|
raw: mount --move /tmp/docker_mounted.sock /var/run/docker.sock
|
||||||
become: true
|
become: true
|
||||||
changed_when: false
|
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
|
||||||
|
|||||||
@@ -8,3 +8,4 @@
|
|||||||
- name: Example assertion
|
- name: Example assertion
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: true
|
that: true
|
||||||
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
roles:
|
roles:
|
||||||
- geerlingguy.docker
|
- geerlingguy.docker
|
||||||
collections:
|
collections: []
|
||||||
# - community.docker
|
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: directory
|
state: directory
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
mode: 0755
|
mode: '0755'
|
||||||
|
owner: "{{ ansible_effective_user_id }}"
|
||||||
|
group: "{{ ansible_effective_group_id }}"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ authentik_volume_media }}"
|
- "{{ authentik_volume_media }}"
|
||||||
- "{{ authentik_volume_certs }}"
|
- "{{ authentik_volume_certs }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user