- CUSTOMER MESSAGE START ----
$ ansible-galaxy collection list | grep -i vyos
vyos.vyos 6.0.0
$ ansible-playbook -u admin -i ../inventory.ini site.yaml
...
$ ansible-playbook -u admin -i ../inventory.ini site.yaml
TASK [Add VyOS 1.4.4-hyper-v if it's not present] ***********************************
task path: ~/ansible_vyos/tasks/update.yaml:52
[ERROR]: Task failed: Action failed: Unsupported parameters for (vyos.vyos.vyos_command) module: answer, prompt. Supported parameters include: commands, interval, match, retries, wait_for (waitfor).
Origin: ~/ansible_vyos/tasks/update.yaml:52:7
50 # set environment variable TERM to dumb to
51 # trigger skipping the progress bar
52 - name: Add VyOS 1.4.4-hyper-v if it's not present
^ column 7
fatal: [vyos-bit]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (vyos.vyos.vyos_command) module: answer, prompt. Supported parameters include: commands, interval, match, retries, wait_for (waitfor)."}
$ cat tasks/update.yaml
...
- set environment variable TERM to dumb to
- trigger skipping the progress bar
- name: Add VyOS 1.4.4-hyper-v if it's not present when: system_images.stdout_lines | select("search", "1.4.4") | list | length == 0 vyos.vyos.vyos_command: commands:
- "TERM=dumb && add system image http://remote.server.org//VyOS/vyos-1.4.4-hyperv-amd64.iso" prompt:
- "What would you like to name this image"
- "Would you like to set the new image as the default one for boot"
- "An active configuration was found. Would you like to copy it to the new image"
- "Would you like to copy SSH host keys" answer:
- "1.4.4"
- "Yes"
- "Yes"
- "Yes" vars: ansible_command_timeout: 180
...
yet the prompt and answer parameters are still in the current documentation: https://docs.ansible.com/projects/ansible/latest/collections/vyos/vyos/vyos_command_module.html#notes
which stands If a command sent to the device requires answering a prompt, it is possible to pass a dict containing command, answer and prompt. See examples.
I suspect this got lost in the, big announced, 6.0.0 release. https://blog.vyos.io/vyos-ansible-collection-6.0.0-release
I am open to any other Ansible solutions to update/upgrade. It’s been a troubled road for two years now https://forum.vyos.io/t/add-system-image-http-with-ansible/12784