Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dladm_vnic: error setting vlan when using python3 #131

Closed
jbronn opened this issue Oct 13, 2020 · 0 comments · Fixed by #132
Closed

dladm_vnic: error setting vlan when using python3 #131

jbronn opened this issue Oct 13, 2020 · 0 comments · Fixed by #132

Comments

@jbronn
Copy link
Contributor

jbronn commented Oct 13, 2020

SUMMARY

Errors trying to set VLAN in dladm_vnic module.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

dladm_vnic

ANSIBLE VERSION
ansible 2.10.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/jbronn/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/jbronn/.local/lib/python3.8/site-packages/ansible
  executable location = /home/jbronn/.local/bin/ansible-playbook
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
CONFIGURATION

N/A

OS / ENVIRONMENT

OmniOS CE r151034t (Illumos); target host Python is 3.7.5.

STEPS TO REPRODUCE

Running the following playbook targeting an Illumos host (OmniOS CE):

---
- name: 'create a vnic on vlan 23'
  hosts: all
  become: true
  tasks:
    - dladm_vnic:
        name: vnic0
        link: igb0
        vlan: 23
  vars:
    ansible_python_interpreter: '/usr/bin/python3'
EXPECTED RESULTS

Expect vnic0 to be created over igb0 with on VLAN 23 ("VID" in Solaris parlance).

ACTUAL RESULTS
Traceback (most recent call last):
  File "/export/home/jbronn/.ansible/tmp/ansible-tmp-1602200001.221015-1447844-199957029738156/AnsiballZ_dladm_vnic.py", line 102, in <module>
    _ansiballz_main()
  File "/export/home/jbronn/.ansible/tmp/ansible-tmp-1602200001.221015-1447844-199957029738156/AnsiballZ_dladm_vnic.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/export/home/jbronn/.ansible/tmp/ansible-tmp-1602200001.221015-1447844-199957029738156/AnsiballZ_dladm_vnic.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.dladm_vnic', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib/python3.7/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_dladm_vnic_payload_pf9t6364/ansible_dladm_vnic_payload.zip/ansible_collections/community/network/plugins/modules/dladm_vnic.py", line 260, in <module>
  File "/tmp/ansible_dladm_vnic_payload_pf9t6364/ansible_dladm_vnic_payload.zip/ansible_collections/community/network/plugins/modules/dladm_vnic.py", line 221, in main
  File "/tmp/ansible_dladm_vnic_payload_pf9t6364/ansible_dladm_vnic_payload.zip/ansible_collections/community/network/plugins/modules/dladm_vnic.py", line 183, in is_valid_vlan_id
TypeError: '<=' not supported between instances of 'int' and 'str'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant