"Undefined variable" error when ansible-playbook is executed from Robot Framework

7 views
Skip to first unread message

Bash G

unread,
Aug 9, 2019, 1:51:48 PM8/9/19
to Ansible Project
Hi,
     I have following playbook, called test.yaml.

---

- name: Show bridge port
hosts: "{{ target }}"
gather_facts: no
connection: local
tasks:
- name: Show bridge port
asa_command:
commands:
- show bridge name test-br port {{bridge1Port3}}
provider: "{{ cli }}"

NOTE: Variable {{bridge1Port3}} is defined in file group_vars/all.yaml .

  1. When ansible-playbook is executed on Linux command line with this playbook, it runs successfully (i.e. ansible-playbook playbooks/test.yaml -e target=host1 -vvvv)
  2. However, when I execute same playbook from Robot Framework, it fails, with following error in ansible.log
"msg": "The task includes an option with an undefined variable. The error was: 'bridge1Port3' is undefined\n\nThe error appears to be in 'playbooks/test.yaml': line 8, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - name: Add Qos to bridge port\n ^ here\n"

All robot does is call "Run Process ansible-playbook playbooks/test.yaml  -e target=host1 -vvvv"
Any help will be greatly appreciated.
Thanks.
-B

Reply all
Reply to author
Forward
0 new messages