2分钟
17 示例5:引用系统自带变量
ansible all -m setup |grep ansible_fqdn 查看系统自带变量
vim var.yml
—
– hosts: websrvs
remote_user: root
tasks:
– name: create log file
file: name=/data/{{ ansible_fqdn }}.log state=touch
ansible all -m setup |grep ansible_fqdn 查看系统自带变量
vim var.yml
—
– hosts: websrvs
remote_user: root
tasks:
– name: create log file
file: name=/data/{{ ansible_fqdn }}.log state=touch
Copyright © 2013-2026 Tencent Cloud.All Rights Reserved. 腾讯云 版权所有
学员评价