adapt for redat
This commit is contained in:
parent
fe4d24f579
commit
2c804df298
@ -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
1
tests/inventory
Normal file
@ -0,0 +1 @@
|
|||||||
|
localhost
|
4
tests/test.yml
Normal file
4
tests/test.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- docker
|
5
vars/Archlinux.yml
Normal file
5
vars/Archlinux.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
docker_package:
|
||||||
|
- docker
|
||||||
|
- python-docker
|
||||||
|
- docker-compose
|
5
vars/RedHat.yml
Normal file
5
vars/RedHat.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
docker_package:
|
||||||
|
- docker-ce
|
||||||
|
- python3-docker
|
||||||
|
- docker-compose-plugin
|
Loading…
Reference in New Issue
Block a user