38 lines
946 B
YAML
38 lines
946 B
YAML
- name: Configure Docker all hosts
|
|
hosts: all
|
|
become: true
|
|
gather_facts: false
|
|
roles:
|
|
# - geerlingguy.pip
|
|
- docker
|
|
vars:
|
|
pip_install_use: apt
|
|
# pip_install_packages:
|
|
# - name: six
|
|
|
|
pre_tasks:
|
|
- name: Ensure python3 and pip are available
|
|
ansible.builtin.raw: |
|
|
sudo apt update && sudo apt install -y python3 python3-pip
|
|
changed_when: false
|
|
|
|
- name: Install 'six' module using apt
|
|
ansible.builtin.apt:
|
|
name: python3-six
|
|
state: present
|
|
update_cache: true
|
|
|
|
tasks:
|
|
- name: Manually gather facts after 'six' is installed
|
|
ansible.builtin.setup:
|
|
|
|
- name: Delete existing hello world container
|
|
community.docker.docker_container:
|
|
name: "les-06"
|
|
state: absent
|
|
|
|
- name: Start hello world container
|
|
community.docker.docker_container:
|
|
name: "les-06"
|
|
image: "gitea.ditmarvisser.net/hbo-ict/les-06:latest"
|