Centos 7.6 Install ansible-playbook install docker simple

Centos 7.6 Install ansible-playbook install docker simple_第1张图片

安装ansible

yum install ansible vim wget net-tools git -y

添加主机

vim  /etc/ansible/hosts
[docker-install]
192.168.3.209 hostname=docker ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=1234.com

创建到目录

mkdir -p /etc/ansible/roles/docker 

配置docker安装脚本

vim /etc/ansible/roles/docker/docker-install.yml
---
- hosts: docker-install
  remote_user: root
  tasks:
   - name: install tool
     shell: yum install epel-release -y && yum install bash-completion bash-completion-extras htop tree vim  tmux htop iotop iftop -y

   - name: stop selinux
     shell: sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /e

你可能感兴趣的:(Centos,Ansible,Docker)