fix: Docker still doesn't work

This commit is contained in:
Laur Ivan 2023-11-18 17:52:06 +01:00
parent f664f99bb2
commit 9b5356397f
3 changed files with 49 additions and 2 deletions

View File

@ -47,6 +47,10 @@
loop_control: loop_control:
label: "{{ item.name }}" label: "{{ item.name }}"
- name: Show molecule inventory
ansible.builtin.debug:
msg: "{{ molecule_inventory }}"
- name: Dump molecule_inventory - name: Dump molecule_inventory
ansible.builtin.copy: ansible.builtin.copy:
content: | content: |
@ -77,3 +81,30 @@
- name: Display uname info - name: Display uname info
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ result.stdout }}" msg: "{{ result.stdout }}"
# Prepare DinD
- name: Prepare DinD
hosts: molecule
gather_facts: true
tasks:
- name: Update apt
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 600
when: "ansible_facts.os_family == 'Debian'"
- name: Install python dependencies
ansible.builtin.pip:
name:
- requests
- docker
- docker-compose
- ansible
- name: Install docker
vars:
docker_service_manage: false
ansible.builtin.include_role:
name: "geerlingguy.docker"

View File

@ -5,5 +5,18 @@ dependency:
requirements-file: molecule/default/requirements.yml requirements-file: molecule/default/requirements.yml
platforms: platforms:
- name: molecule-ubuntu - name: molecule-ubuntu
image: ubuntu:18.04 image: geerlingguy/docker-ubuntu1804-ansible:latest
privileged: true
pre_build_image: true
capabilities:
- SYS_ADMIN
tmpfs:
- /tmp
- /run
- /run/lock
volumes:
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
- '/var/run/docker.sock:/tmp/docker_mounted.sock'
command: 'lib/systemd/systemd'
stop_signal: 'RTMIN+3'

View File

@ -1,2 +1,5 @@
collections: collections:
- community.docker - community.docker
roles:
- name: geerlingguy.docker