forked from vamsi1967/k8s-HA-ansible-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-install.yaml
45 lines (39 loc) · 1.13 KB
/
docker-install.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- name: setup the docker repository && yum-utils && install docker
hosts: master,worker
become: yes
gather_facts: no
tasks:
- name: install yum-utils
package:
name:
- yum-utils
state: present
tags: yumutils
- name: add the repository
shell: yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
args:
creates: /etc/yum.repos.d/docker-ce.repo
register: docker_repo_add
tags: dockerrepo
- local_action:
module: copy
content: "{{ docker_repo_add }}"
dest: /home/kubeadmin/k8s/playbooks/{{inventory_hostname}}_docker_repo_add
- name: install docker
package:
name:
- containerd.io
- docker-ce
- docker-ce-cli
state: present
update_cache: true
skip_broken: yes
register: dockerinstall
- debug:
var: dockerinstall.results
- local_action:
module: copy
content: "{{ dockerinstall }}"
dest: /home/kubeadmin/k8s/playbooks/{{inventory_hostname}}_docker_repo_add