Надо ansible_default_ipv4["address"]
Есть подозрение что не оно....
Что делаю: хочу локально запустить ssh спараметром команды на удалённом хосте для смены пароля:
- name: RouterOS change FW Update
hosts: caps
gather_facts: false
tasks:
- name: Change password
local_action: ansible.builtin.command ssh -o StrictHostKeyChecking=no admin@{{ ansible_default_ipv4["address"] }} "/user set [find username=admin] password=newpass"
В итоге получаю ошибку:
fatal: [10.0.49.7 -> localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible_default_ipv4' is undefined\n\nThe error appears to be in '/etc/ansible/RouterOS/play_ROS.yaml': line 6, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Change password\n ^ here\n"}