首页 > 其他 > 详细

YAML_14 tags给指定的任务定义一个调用标识,以后不用重复整个过程,只需要执行tags标签的部分

时间:2019-03-28 17:00:38      阅读:163      评论:0      收藏:0      [点我收藏+]
ansible]# vim adhttp.yml
---
- hosts: cache
  remote_user: root
  tasks:
    - copy:
        src: /root/httpd.conf
        dest:  /etc/httpd/conf/httpd.conf
        owner: root
        group: root
        mode: 0644
      tags: config_httpd
      notify:
        - restart httpd
  handlers:
     - name: restart httpd
       service: name=httpd state=restarted
 
2)调用方式
ansible]# ansible-playbook adhttp.yml --tags=config_httpd

YAML_14 tags给指定的任务定义一个调用标识,以后不用重复整个过程,只需要执行tags标签的部分

原文:https://www.cnblogs.com/luwei0915/p/10615722.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!