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

ansible--jia初始

时间:2018-07-04 17:35:52      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:tmp   sdfs   user   --   var   sdfsdf   test   his   The   

#cat jia.yml
- hosts: test-gfs
user: dev
gather_facts: true

vars:
PORT: "3306"
MESAGE: "wangrenqing"
IP_local: "{{ansible_default_ipv4.address}}"
IP_local_lan: "{{ ansible_all_ipv4_addresses[1] }}"
#HOST_NAME: "{{inventory_hostname}}
tasks:
- name: copy file to client
template: src=./test.j dest=/tmp/test.tmp
- debug: "msg={{ ansible_default_ipv4.address }}"

- name: "add file"
lineinfile: dest=/tmp/test.tmp line="{{PORT}}"

 

#cat ./test.j
this is {{PORT}} fsdfsdf {{MESAGE}}

ip_wan: {{IP_local}} ip_lan: {{IP_local_lan}}

ansible--jia初始

标签:tmp   sdfs   user   --   var   sdfsdf   test   his   The   

原文地址:https://www.cnblogs.com/Qing-840/p/9264132.html

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