美文网首页
'Service' Module >> Ansible2.0

'Service' Module >> Ansible2.0

作者: 黑涩布朗尼 | 来源:发表于2016-06-07 16:46 被阅读0次
--- # The Service Module
- hosts: apacheweb
  user: test
  sudo: yes
  connection: ssh
  tasks:
  - name: Install Web Server
    action: yum name=httpd state=installed
  - name: Start the Web Server
    service: name=httpd state=started
  - name: Stop the Web Server
    service: name=httpd state=stopped
  - name: Enable HTTPD After Reboot
    service: name=httpd enabled=yes

其中随开机启动的设置很实用 如果选择远程配置 就不要做二次加工的事情。

相关文章

网友评论

      本文标题:'Service' Module >> Ansible2.0

      本文链接:https://www.haomeiwen.com/subject/aggddttx.html