ansible docker 安装启动并设置开机启动
---
- name: ansible playbook
hosts: all
remote_user: root
become: yes
tasks:
- name: 安装 docker
yum:
name: docker-engine
state:latest
- name: 启动 docker
service:
name: docker
state: started #主机每次重启后服务的状态,可选值 [started, stoped, reloaded, restarted]