ansible--jia初始
Posted qing-840
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ansible--jia初始相关的知识,希望对你有一定的参考价值。
#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初始的主要内容,如果未能解决你的问题,请参考以下文章