-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Archlinux support for
docker
role
- Loading branch information
Showing
3 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
- name: Installing Docker and requirements... | ||
ansible.builtin.package: | ||
name: | ||
- docker | ||
- docker-compose | ||
- docker-buildx | ||
state: present | ||
update_cache: true | ||
register: docker_install | ||
until: not docker_install.failed # Because sometimes the primary DNS is not up yet | ||
retries: 6 | ||
delay: 5 | ||
|
||
- name: Getting python3-pip version... | ||
ansible.builtin.shell: pip3 -V | cut -d " " -f 2 | ||
changed_when: false | ||
register: pip_version | ||
|
||
# https://peps.python.org/pep-0668/ | ||
# Using this until a good cross-user venv is available | ||
- name: Installing required Python packages... | ||
ansible.builtin.pip: | ||
name: requests | ||
extra_args: "{{ '--break-system-packages' if pip_version.stdout is version('23.0.0', 'gt', version_type='loose') else none }}" | ||
|
||
- name: Creating /etc/docker directory... | ||
ansible.builtin.file: | ||
path: /etc/docker | ||
state: directory | ||
mode: "0755" | ||
|
||
- name: Adding Docker daemon config... | ||
ansible.builtin.template: | ||
src: "{{ docker_daemon_template }}" | ||
dest: /etc/docker/daemon.json | ||
lstrip_blocks: true | ||
mode: "0644" | ||
register: daemon_config | ||
|
||
- name: Enabling docker service... | ||
ansible.builtin.systemd: | ||
name: docker.service | ||
enabled: true | ||
daemon_reload: true | ||
state: restarted | ||
when: daemon_config.changed or docker_install.changed | ||
|
||
- name: Including default network creation tasks... | ||
when: docker_create_network | ||
block: | ||
- name: Checking if {{ docker_network.name }} exists... | ||
community.docker.docker_network_info: | ||
name: "{{ docker_network.name }}" | ||
register: docker_network_check | ||
|
||
- name: Creating {{ docker_network.name }}... | ||
community.docker.docker_network: | ||
name: "{{ docker_network.name }}" | ||
enable_ipv6: "{{ docker_network.enable_ipv6 }}" | ||
ipam_config: | ||
- subnet: "{{ docker_network.ipv4_subnet }}" | ||
- subnet: "{{ docker_network.ipv6_subnet }}" | ||
when: not docker_network_check.exists |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
--- | ||
- name: Installing Docker on Windows machine... | ||
ansible.builtin.include_tasks: windows.yml | ||
when: "'os_windows' in group_names" | ||
when: ansible_os_family == "Windows" | ||
|
||
- name: Installing Docker on Debian based Linux machine... | ||
ansible.builtin.include_tasks: linux.yml | ||
when: ansible_facts.os_family == "Debian" | ||
ansible.builtin.include_tasks: debian_os.yml | ||
when: ansible_os_family == "Debian" | ||
|
||
- name: Installing Docker on Archlinux based machine... | ||
ansible.builtin.include_tasks: archlinux.yml | ||
when: ansible_os_family == "Archlinux" |