Skip to content

aix_devices doesn't handle multiple attribute instances #53366

@dpbianc

Description

@dpbianc
SUMMARY

The 1.1 version of the aix_devices module does not handle devices that may have multiple
instances of an attribute. For example, network interfaces can have multiple instances of
the alias4 attribute. I can add multiple alias4 attributes, but the module doesn't recognize
that there may be multiple alias4 values.

It appears that the module expects the attribute to have a single instance and the check routine only returns the first instance of an attribute.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Version 1.1 of module aix_devices (aix_devices.py)

ANSIBLE VERSION
ansible 2.6.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/freeware/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.15 (default, Jul 27 2018, 03:37:11) [GCC 6.3.0]

CONFIGURATION
CACHE_PLUGIN(env: ANSIBLE_CACHE_PLUGIN) = jsonfile
CACHE_PLUGIN_CONNECTION(env: ANSIBLE_CACHE_PLUGIN_CONNECTION) = /nas/depot/ansib
CACHE_PLUGIN_TIMEOUT(env: ANSIBLE_CACHE_PLUGIN_TIMEOUT) = 3600

OS / ENVIRONMENT

AIX 7.2

STEPS TO REPRODUCE
- name: Create en0 aliases
  hosts: vftmweb1d
  gather_facts: no
  tasks:
   - name: Create en0 aliases
    aix_devices:
      device: '{{ item.device }}'
      attributes:
        alias4: '{{ item.ipaddr }},{{ item.netmask }}'
      state: available
    with_items:
      - { device: 'en0', ipaddr: '10.10.10.2', netmask: '255.255.255.0' }
      - { device: 'en0', ipaddr: '10.10.10.3', netmask: '255.255.255.0' }
 
EXPECTED RESULTS

If the alias4 entries exist, the task should complete without changes.

ACTUAL RESULTS

If the alias4 entries exist, the first alias4 completes without change, the second is added again (which doesn't add a duplicate entry).


Metadata

Metadata

Assignees

No one assigned

    Labels

    affects_2.6This issue/PR affects Ansible v2.6aixAIX communitybot_closedbugThis issue/PR relates to a bug.collectionRelated to Ansible Collections workcollection:community.generalhas_prThis issue has an associated PR.moduleThis issue/PR relates to a module.needs_collection_redirecthttps://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.mdsupport:communityThis issue/PR relates to code supported by the Ansible community.systemSystem category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions