码迷,mamicode.com
首页 > 其他好文 > 详细

ansible-palybook

时间:2017-04-17 09:52:15      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:user   tar   code   display   logs   present   yum   enabled   添加   

 yum 下载 启动 添加add

技术分享
- name: install httpd service
  hosts: nginx
  tasks:
   - name: install
     yum: name=httpd state=present
   - name: service on
     service: name=httpd enabled=yes state=started
ansible-playbook

 创建用户:

技术分享
- name: create user
  hosts: nginx
  user: root
  gather_facts: false
  vars:
    user: "test"
  tasks:
  - name: create user
    user: name="{{ user }}"
创建用户

删除用户

技术分享
- name: userdel user
  hosts: nginx
  user: root
  gather_facts: false
  vars:
    user: "test"
  tasks:
  - name: userdel user
    user: name="{{ user }}" state=absent remove=yes
删除用户

 

ansible-palybook

标签:user   tar   code   display   logs   present   yum   enabled   添加   

原文地址:http://www.cnblogs.com/augustyang/p/6721130.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!