Skip to content

Removing device fail in aix_devices.py module #51755

@ramooncamacho

Description

@ramooncamacho
SUMMARY

Trying to remove an adapter, it returns error in command syntax.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

aix_devices.py

ANSIBLE VERSION
ansible 2.8.0.dev0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/tvt.ramoon.camacho/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/tvt.ramoon.camacho/ansible/lib/ansible
  executable location = /home/tvt.ramoon.camacho/ansible/bin/ansible
  python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
CONFIGURATION
DEFAULT_REMOTE_USER(/etc/ansible/ansible.cfg) = testuser
DEPRECATION_WARNINGS(/etc/ansible/ansible.cfg) = False
OS / ENVIRONMENT

Tests performed in AIX 7.1 environment

STEPS TO REPRODUCE

Playbook example:

[testuser@controller ansible]$ cat aix_dev.yaml
---
- name: Testing
  hosts: testeram
  become: yes

  tasks:
    - name: Removes fcs0.
      aix_devices:
        device: fcs0
        state: removed
        recursive: yes
[testuser@controller ansible]$

Running the playbook:

[testuser@controller ansible]$ ansible-playbook aix_dev.yaml

PLAY [Testing] *********************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************
ok: [testeram]

TASK [Removes fcs0.] ***************************************************************************************************************************************************
fatal: [testeram]: FAILED! => {"changed": false, "err": "rmdev: 0514-500 Usage error - \n\nUsage:\nrmdev {-l|-p} Name [-d|-S][-R][-q][-f File][-g]\nrmdev -h\n\n", "msg": "Failed to run rmdev", "rc": 1}
        to retry, use: --limit @/home/testuser/ansible/aix_dev.retry

PLAY RECAP *************************************************************************************************************************************************************
testeram                   : ok=1    changed=0    unreachable=0    failed=1    skipped=0

[testuser@controller ansible]$

I saw it's trying to execute "/usr/sbin/rmdev -l fcs0 -R ''", and doing the same at the operating system, it returns error:

testuser@testeram(/home/testuser)# sudo /usr/sbin/rmdev -l fcs0 -R ''
rmdev: 0514-500 Usage error -

Usage:
rmdev {-l|-p} Name [-d|-S][-R][-q][-f File][-g]
rmdev -h

testuser@testeram(/home/testuser)#

If I do the same with no single quotation marks, it runs correctly:

testuser@testeram(/home/testuser)# sudo /usr/sbin/rmdev -l fcs0 -R
sfwcomm0 Defined
fscsi0 Defined
fcs0 Defined
testuser@testeram(/home/testuser)#
EXPECTED RESULTS

It was expected the device be removed.

ACTUAL RESULTS

It returns error in command syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects_2.8This issue/PR affects Ansible v2.8aixAIX 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