Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

panos_interface cannot configure layer2 interface #266

Closed
laurent-perrin opened this issue Mar 26, 2019 · 1 comment
Closed

panos_interface cannot configure layer2 interface #266

laurent-perrin opened this issue Mar 26, 2019 · 1 comment

Comments

@laurent-perrin
Copy link

I'm trying to set an interface as layer2 to configure subinterfaces:

- name: configure interfaces
  panos_interface:
    ip_address: "{{ inventory_hostname }}"
    api_key: "{{ ansible_api_key }}"
    enable_dhcp: false
    if_name: "{{ item.name }}"
    mode: "{{ item.mode }}"
    zone_name: "{{ item.zone }}"
    ip: "{{ item.ip_address | default(omit) }}"
    management_profile: "{{ item.management_profile | default(omit) }}"
    commit: false
    state: present
  loop: "{{ interfaces }}"
  when: interfaces is defined
  notify: commit
  run_once: true
  tags: interfaces

But I got this error:

he full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_panos_interface_payload_a0JG_h/__main__.py", line 388, in main
    changed |= set_virtual_router(con, eth, vr_name, routers)
  File "/tmp/ansible_panos_interface_payload_a0JG_h/__main__.py", line 237, in set_virtual_router
    desired_vr.update('interface')
  File "/home/fgzx6022/Work/python-env/ansible2.7/local/lib/python2.7/site-packages/pandevice/base.py", line 628, in update
    retry_on_peer=self.HA_SYNC)
  File "/home/fgzx6022/Work/python-env/ansible2.7/local/lib/python2.7/site-packages/pandevice/base.py", line 3253, in method
    raise the_exception

failed: [cloud-fw-z01r-prd.cloud.620nm.net] (item={u'name': u'ethernet1/19', u'zone': u'trunk', u'mode': u'layer2'}) => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "adjust_tcp_mss": null, 
            "aggregate_group": null, 
            "api_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "comment": null, 
            "commit": false, 
            "create_default_route": false, 
            "dhcp_default_route_metric": null, 
            "enable_dhcp": false, 
            "if_name": "ethernet1/19", 
            "ip": null, 
            "ip_address": "cloud-fw-z01r-prd.cloud.620nm.net", 
            "ipv4_mss_adjust": null, 
            "ipv6_enabled": null, 
            "ipv6_mss_adjust": null, 
            "link_duplex": null, 
            "link_speed": null, 
            "link_state": null, 
            "lldp_enabled": null, 
            "lldp_profile": null, 
            "management_profile": null, 
            "mode": "layer2", 
            "mtu": null, 
            "netflow_profile": null, 
            "netflow_profile_l2": null, 
            "operation": "add", 
            "password": null, 
            "state": "present", 
            "username": "admin", 
            "vr_name": "default", 
            "vsys_dg": "vsys1", 
            "zone_name": "trunk"
        }
    }, 
    "item": {
        "mode": "layer2", 
        "name": "ethernet1/19", 
        "zone": "trunk"
    }, 
    "msg": "Failed zone/vr assignment:  interface 'ethernet1/19' is not a valid reference"
}

This same code is working for layer3 interfaces.

@shinmog
Copy link
Collaborator

shinmog commented Apr 17, 2019

Fixed by #268

@shinmog shinmog closed this as completed Apr 17, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants