adapt for redat

This commit is contained in:
vincent 2022-05-31 20:52:46 +02:00
parent fe4d24f579
commit 2c804df298
5 changed files with 32 additions and 4 deletions

View File

@ -1,9 +1,22 @@
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
- name: Add CentOS repository
block:
- name: Add Docker repository.
get_url:
url: "https://download.docker.com/linux/centos/docker-ce.repo"
dest: '/etc/yum.repos.d/docker-ce.repo'
owner: root
group: root
mode: 0644
when: ansible_os_family == "RedHat"
become: true
- name: Install Docker. - name: Install Docker.
package: package:
name: name: "{{ docker_package }}"
- docker
- python-docker
- docker-compose
state: present state: present
notify: restart docker notify: restart docker
become: true become: true

1
tests/inventory Normal file
View File

@ -0,0 +1 @@
localhost

4
tests/test.yml Normal file
View File

@ -0,0 +1,4 @@
---
- hosts: all
roles:
- docker

5
vars/Archlinux.yml Normal file
View File

@ -0,0 +1,5 @@
---
docker_package:
- docker
- python-docker
- docker-compose

5
vars/RedHat.yml Normal file
View File

@ -0,0 +1,5 @@
---
docker_package:
- docker-ce
- python3-docker
- docker-compose-plugin