ansible安装docker
首先配置好docker安装的yum源
wget -P /etc/yum.repos.d/ https://download.docker.com/linux/centos/docker-ce.repo
docker.yml
- hosts: node
remote_user: root
tasks:
- name: setup yum-utils
yum: name=yum-utils state=present
- name: setup device-mapper-persistent-data
yum: name=device-mapper-persistent-data state=present
- name: setup lvm2
yum: name=lvm2 state=present
- name: cp docker.repo
copy:
src: "/etc/yum.repos.d/docker-ce.repo"
dest: "/etc/yum.repos.d/docker-ce.repo"
- name: setup docker-ce
yum: name=docker-ce state=present
- name: start docker
service: name=docker.service enabled=yes state=started
安装过程
[root@feiyu roles]# ansible-playbook docker.yml
PLAY [node] ************************************
文章来源: blog.csdn.net,作者:隔壁老瓦,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/wxb880114/article/details/90019819
- 点赞
- 收藏
- 关注作者
评论(0)