Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

'p2p' is undefined - pb.generate.variables #47

Open
ric79 opened this issue Jul 19, 2017 · 0 comments
Open

'p2p' is undefined - pb.generate.variables #47

ric79 opened this issue Jul 19, 2017 · 0 comments

Comments

@ric79
Copy link

ric79 commented Jul 19, 2017

Hello,
when I run pb.generate.variables.yaml I get

TASK [generate-underlay-bgp : Generate Underlay YAML] **************************************************************************************
task path: /home/rrusso/ipfabric/roles/generate-underlay-bgp/tasks/main.yaml:3
fatal: [spine-01]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'p2p' is undefined"}
fatal: [spine-02]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'p2p' is undefined"}
fatal: [leaf-02]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'p2p' is undefined"}
fatal: [leaf-01]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'p2p' is undefined"}
fatal: [leaf-03]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'p2p' is undefined"}
fatal: [leaf-04]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'p2p' is undefined"}

The error disappears when I run the playbook again. The problem is caused because "refresh_inventory" is missing in the second playbook. I think it should be:

https://github.com/JNPRAutomate/ansible-junos-evpn-vxlan/blob/master/pb.generate.variables.yaml
- name: Generate variables for underlay
  hosts: [spine, leaf]
  connection: local
  gather_facts: no
  pre_tasks:  
    - include_vars: "{{ topology_file }}"
    - meta: refresh_inventory
  roles:
    - generate-underlay-bgp

In this way, group_vars/all.yml, which was created in the first playbook, is taken into account also in the second playbook. I'm using Ansible 2.3.1.0

R

ric79 added a commit to ric79/ansible-junos-evpn-vxlan that referenced this issue Jul 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant