Refactor: Organize Ansible project structure
- Reorganized Ansible project structure to follow best practices. - Created dedicated directories: , , , , and . - Categorized playbooks into (host-specific) and (service-specific). - Moved all roles into the directory and standardized their naming conventions. - Relocated to for better variable management. - Renamed to to reflect its global variable scope. - Created to correctly set the to the new directory. - Moved and into the directory. - Added to providing explanations for common commands. - Cleaned up directories from all individual roles to centralize version control.
This commit is contained in:
52
roles/docker/tasks/setup-RedHat.yml
Normal file
52
roles/docker/tasks/setup-RedHat.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
- name: Ensure old versions of Docker are not installed.
|
||||
package:
|
||||
name:
|
||||
- docker
|
||||
- docker-common
|
||||
- docker-engine
|
||||
state: absent
|
||||
|
||||
- name: Add Docker GPG key.
|
||||
rpm_key:
|
||||
key: "{{ docker_yum_gpg_key }}"
|
||||
state: present
|
||||
|
||||
- name: Add Docker repository.
|
||||
get_url:
|
||||
url: "{{ docker_yum_repo_url }}"
|
||||
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Configure Docker Nightly repo.
|
||||
ini_file:
|
||||
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
||||
section: 'docker-{{ docker_edition }}-nightly'
|
||||
option: enabled
|
||||
value: '{{ docker_yum_repo_enable_nightly }}'
|
||||
mode: 0644
|
||||
no_extra_spaces: true
|
||||
|
||||
- name: Configure Docker Test repo.
|
||||
ini_file:
|
||||
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
||||
section: 'docker-{{ docker_edition }}-test'
|
||||
option: enabled
|
||||
value: '{{ docker_yum_repo_enable_test }}'
|
||||
mode: 0644
|
||||
no_extra_spaces: true
|
||||
|
||||
- name: Configure containerd on RHEL 8.
|
||||
block:
|
||||
- name: Ensure container-selinux is installed.
|
||||
package:
|
||||
name: container-selinux
|
||||
state: present
|
||||
|
||||
- name: Ensure containerd.io is installed.
|
||||
package:
|
||||
name: containerd.io
|
||||
state: present
|
||||
when: ansible_distribution_major_version | int == 8
|
||||
Reference in New Issue
Block a user