playbook核心元素之 模板template 介绍(7)
2016-11-30 11:40
411 查看
playbook核心元素之 --> 模板template 介绍
templates:文件文件,内部嵌套有模板语言脚本(使用模板语言编写)
注意:此模拟不能再命令行使用,而只能用于playbook
实际使用范例
templates:文件文件,内部嵌套有模板语言脚本(使用模板语言编写)
[root@ansible ~]# ansible-doc -l | grep "^\<template\>" --> template是一个模块 template Templates a file out to a remote server.
[root@node1 ~]# ansible-doc -s template --> 查看 template模块的参数 src= dest= mode= onwer= group= ...
注意:此模拟不能再命令行使用,而只能用于playbook
实际使用范例
[root@ansible ~]# vim test4.yaml - hosts: centos7 remote_user: root tasks: - name: install httpd yum: name=httpd state=latest - name: copy config file template: src=/root/httpd.conf.j2 dest=/etc/httpd/conf/httpd.conf notify: restart httpd service - name: start httpd service service: name=httpd state=started handlers: - name: restart httpd service service: name=httpd state=restarted
相关文章推荐
- playbook核心元素之 --> handlers 介绍(5)
- playbook核心元素之 variables 介绍(6)
- playbook核心元素之 --> task 介绍(4)
- Ext.元素模板(Template)
- OpenCV模板匹配函数:matchTemplate()介绍
- JS模板引擎-腾讯artTemplate 最全的使用介绍
- Websharp 4 - 元素介绍与模板设计
- 高性能JavaScript模板引擎artTemplate介绍
- Java设计模式之模板模式(Template模式)介绍
- 腾讯arttemplate模板官方介绍
- artTemplate模板引擎简单介绍使用
- C++模板(template)使用介绍
- artTemplate模板引擎简单介绍使用
- C++模板引擎Ctemplate的介绍
- 给 ListBox 的 DataTemplate 模板中的 元素设置动画
- C++模板引擎Ctemplate的介绍
- playbook核心元素之 --> 角色role(9)
- [设计模式](十):策略模式(Strategy)与模板模式(Template)详解及二者间区别介绍(两种父子类行为模式)
- Qt Quick应用开发介绍 1-5(介绍_环境_核心原理_元素作为基本_加载和显示)
- C++模板(template)使用介绍