ansible-palybook
yum 下载 启动 添加add
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
- name: install httpd service hosts: nginx tasks: - name: install yum: name=httpd state=present - name: service on service: name=httpd enabled=yes state=started
创建用户:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
- name: create user hosts: nginx user: root gather_facts: false vars: user: "test" tasks: - name: create user user: name="{{ user }}"
删除用户
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
- name: userdel user hosts: nginx user: root gather_facts: false vars: user: "test" tasks: - name: userdel user user: name="{{ user }}" state=absent remove=yes
安装httpd并启动
--- - hosts: nginx tasks: - name: "install httpd" yum: name={{ item }} state=present with_items: - httpd - httpd-devel - name: "chckonfig" service: name=httpd state=started enabled=yes
posted on 2017-04-17 04:38 augustyang 阅读(407) 评论(0) 编辑 收藏 举报