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

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

@ric79

Description

@ric79

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions