Sed 如何改变ansible中的每个客户?

Sed 如何改变ansible中的每个客户?,sed,ansible,Sed,Ansible,我还在学Ansible。。。 要通过客户端ip回复Ansible中的ip地址吗 主持人: [servers] 192.168.0.1 192.168.0.18 192.168.0.19 192.168.0.23 192.168.0.129 192.168.0.130 192.168.0.149 server.yml --- - name: Create update alive crontab hosts: servers become: true tasks: - name: a cront

我还在学Ansible。。。 要通过客户端ip回复Ansible中的ip地址吗

主持人:

[servers]
192.168.0.1
192.168.0.18
192.168.0.19
192.168.0.23
192.168.0.129
192.168.0.130
192.168.0.149
server.yml

---
- name: Create update alive crontab
hosts: servers
become: true
tasks:
- name: a crontab job
  cron:
      minute="0"
      job="http://xx.xx.xx.xx/alive.php?ip=clientIP"

如何在server.yml中更改everyone clientIP?

您正在查找变量ansible\u host

作业=”http://xx.xx.xx.xx/alive.php?ip={{ansible_host}}”

见示例:

# ansible -m debug -a 'msg="{{ ansible_host }}"' localhost
localhost | SUCCESS => {
    "msg": "127.0.0.1"
}