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

**URL:** <https://forum.ansible.com/t/undefined-variable-error-when-ansible-playbook-is-executed-from-robot-framework/31011>\
**Category:** Ansible Project\
**Created:** [August 9, 2019, 5:51pm UTC](https://forum.ansible.com/t/undefined-variable-error-when-ansible-playbook-is-executed-from-robot-framework/31011 "2019-08-09T17:51:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bash\_G](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@Bash\_G](https://forum.ansible.com/u/Bash_G)\
**Post date:** [August 9, 2019, 5:51pm UTC](https://forum.ansible.com/t/undefined-variable-error-when-ansible-playbook-is-executed-from-robot-framework/31011/1 "2019-08-09T17:51:48Z")

</div>

Hi,  
I have following playbook, called test.yaml.

```auto
---

- 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 }}"

```

```auto

```

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

```

```auto

```

```auto

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)
1. 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"

```

```auto
All robot does is call "Run Process ansible-playbook playbooks/test.yaml -e target=host1 -vvvv"

```

```auto
Any help will be greatly appreciated.

```

```auto
Thanks.

```

```auto
-B

```
