feat(docker): add the docker role (#522)
Extracted from the environment repository, wave 1. Scrubbed of private references: namespace mortis, no repository paths or issue numbers in comments and docs, the removed docker_ufw_rules guard dropped, the molecule scenario uses the FQCN and no provisioner environment overrides. ansible-lint mocks the role's FQCN because CI checks the Collection out outside an ansible_collections path. Verified: the commit hooks. Not verified: the molecule scenario (CI only). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
903a1a2e5a
commit
aad59fc339
17 files changed
+774
No files matched your search
@@ -0,0 +1,52 @@
|
||||
---
|
||||
- name: Install prerequisite packages
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- ca-certificates
|
||||
- curl
|
||||
state: present
|
||||
update_cache: true
|
||||
tags: [docker, install]
|
||||
|
||||
- name: Ensure APT keyrings directory exists
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /etc/apt/keyrings
|
||||
state: directory
|
||||
mode: "0755"
|
||||
tags: [docker, install]
|
||||
|
||||
- name: Install Docker APT GPG key
|
||||
become: true
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ docker_gpg_url }}"
|
||||
dest: "{{ docker_keyring_path }}"
|
||||
mode: "0644"
|
||||
tags: [docker, install]
|
||||
|
||||
- name: Install Docker APT source list
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ docker_apt_list_path }}"
|
||||
content: |
|
||||
deb [arch={{ docker_apt_arch }} signed-by={{ docker_keyring_path }}] {{ docker_repo_base_url }} {{ ansible_distribution_release }} stable
|
||||
mode: "0644"
|
||||
tags: [docker, install]
|
||||
|
||||
- name: Install Docker Engine packages
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
name: "{{ docker_packages }}"
|
||||
state: present
|
||||
update_cache: true
|
||||
notify: Restart docker
|
||||
tags: [docker, install]
|
||||
|
||||
- name: Enable and start Docker service
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ docker_service }}"
|
||||
enabled: true
|
||||
state: started
|
||||
tags: [docker, install]
|
||||
Reference in new issue
Block a user