Skip to content

Errors when trying to use variables with cli add on config feature #559

@tcp-port-179

Description

@tcp-port-179

Trying to use variables with the cli add on configuration feature and it errors when applying. Have tried with single quotes, double quotes, and as documented with no quotes for the value with the same result. The template will push to the device when checking, but without variables values populated. The cli add on does push successfully with hardcoded/static values, just not with variables. vManage version 20.12.5.

 feature_profiles: 
      cli_profiles:
      - name: CLI-Add-On
        description: CLI Add On
        config:
          name: cli-add-onconfig
          cli_configuration: |
           ! CLI add on test comment
           vrf definition {{vrf}}
           rd {{rd}}
           route-target export {{rt_export}}
           route-target import {{rt_import}}
           !
           router bgp {{asn}}
            address-family ipv4 unicast vrf {{af_vrf}}
            neighbor {{nei}} remote-as {{nei_asn}}
            neighbor {{nei}} activate    

Variables value variation 1:
            vrf: 10
            rd: 1:10
            rt_export: 65499:10
            rt_import: 65499:10
            asn: 65499
            af_vrf: 10
            nei: 10.10.10.10
            nei_asn: 65499			
Variables value variation 2:
            vrf: "10"
            rd: "1:10"
            rt_export: "65499:10"
            rt_import: "65499:10"
            asn: "65499"
            af_vrf: "10"
            nei: "10.10.10.10"
            nei_asn: "65499"
Variables value variation 3:
            vrf: '10'
            rd: '1:10'
            rt_export: '65499:10'
            rt_import: '65499:10'
            asn: '65499'
            af_vrf: '10'
            nei: '10.10.10.10'
            nei_asn: '65499'		

Failed to configure configuration group device variables (PUT), got error: HTTP Request failed: StatusCode 400, {"error":{"message":"Invalid Json Payload
│ Input","code":"SCHVALID0001","details":"{"Validation Errors":{"Required But Missing Attributes":["vrf"],"Invalid Format
│ Attributes":["af_vrf","asn","nei_asn"]}}","type":"error"}}

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