Ansible变量
时间:2021-05-23 来源:未知 投稿:admin 点击:次
例:
[webserver]
192.168.0.12 ansible_ssh_user=root ansible_ssh_pass=fwqzx.com http_port=80 #定义http端口的变量
192.168.0.12 ansible_ssh_user=root ansible_ssh_pass=fwqzx.com
[webserver:vars]
http_port=8080
servername=www.fwqzx.com
ansible webservers -a "echo {{server_http_port}}” #查看变量信息
80优先级高于8080
[webserver]
192.168.0.12 ansible_ssh_user=root ansible_ssh_pass=fwqzx.com http_port=80 #定义http端口的变量
192.168.0.12 ansible_ssh_user=root ansible_ssh_pass=fwqzx.com
[webserver:vars]
http_port=8080
servername=www.fwqzx.com
ansible webservers -a "echo {{server_http_port}}” #查看变量信息
80优先级高于8080
如果您的问题仍未解决,还可以加入服务器在线技术交流QQ群:8017413寻求帮助。
上一篇:Ansible hosts使用方式
下一篇:没有了
下一篇:没有了
相关内容
最新热点内容
推荐内容