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

nios_fixed_address not able to add options that don't require use_options #64034

Closed
megabreit opened this issue Oct 28, 2019 · 3 comments
Closed
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. infoblox Infoblox NIOS module This issue/PR relates to a module. net_tools Net-tools category networking Network category support:certified This issue/PR relates to certified code. support:community This issue/PR relates to code supported by the Ansible community.

Comments

@megabreit
Copy link

SUMMARY

It is not possible to add options that don't require use_options e.g. host-name

ISSUE TYPE
  • Bug Report
COMPONENT NAME

net_tools, nios, lib/ansible/modules/net_tools/nios/nios_fixed_address.py

ANSIBLE VERSION
ansible 2.8.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/xxxx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15+ (default, Oct  7 2019, 17:39:04) [GCC 7.4.0]


CONFIGURATION
empty
OS / ENVIRONMENT

Ubuntu 18.04 with Ansible 2.8.6 from Ansible PPA (2.8.6-1ppa~bionic)

pip freeze|grep -i infoblox
infoblox-client==0.4.23

STEPS TO REPRODUCE
    - name: set dhcp options for a ipv4 fixed address
      nios_fixed_address:
        name: hostname.domain
        ipaddr: "{{ vm_ipaddr }}"
        mac: "{{ macaddress }}"
        network: 10.0.0.0/24
        network_view: default
        options:
          - name: host-name
            value:  "{{ vm_name }}"
        state: present
        provider: "{{ nios_provider }}"
      connection: local
      register: dhcp_results
EXPECTED RESULTS

The host-name option should be set in the infoblox appliance for the specific fixed address.

ACTUAL RESULTS

Ansible terminates with the error below.
It is impossible to use any option that has no use_option. The source code has no special treatment for those occasions. "use_options" defaults always to "True". See line 221 in lib/ansible/modules/net_tools/nios/nios_fixed_address.py
The same error happens when any use_option is used. I tried "yes", "no", "true", "false". It's also not possible to use equivalent "num: 12" instead of "name: host-name".

fatal: [localhost]: FAILED! => {"changed": false, "code": "Client.Ibap.Proto", "msg": "Option host-name can not have a use_option flag", "operation": "create_object", "type": "AdmConProtoError"}
@ansibot
Copy link
Contributor

ansibot commented Oct 28, 2019

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Oct 28, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. infoblox Infoblox NIOS module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. net_tools Net-tools category networking Network category support:certified This issue/PR relates to certified code. support:community This issue/PR relates to code supported by the Ansible community. labels Oct 28, 2019
justjais pushed a commit that referenced this issue Dec 11, 2019
* Update nios_txt_record.py

Fix for Bug #62377

* Fixes for #62377, #64045, #64034

Fixes for #62377 nios_txt_record module cannot handle multiple TXT records

Fix for #64045 nios_a_record is requested to modify IP of existing A record, but attempts to create new A record instead

Fix for #64034 nios_fixed_address not able to add options that don't require use_options

* Update api.py

* Update nios_a_record.py examples

* Update nios_fixed_address.py

* Update nios_txt_record.py

* Update nios_fixed_address.py

* Update nios_fixed_address.py to fix #56301

Fixes #56301

* Update nios_fixed_address.py

* Update nios_a_record.py

* Update api.py
Akasurde pushed a commit to Akasurde/ansible that referenced this issue Dec 21, 2019
Fixes: ansible#56301
Fixes: ansible#62377 nios_txt_record module cannot handle multiple TXT records
Fixes: ansible#64045 nios_a_record is requested to modify IP of existing A record, but attempts to create new A record instead
Fixes: ansible#64034 nios_fixed_address not able to add options that don't require use_options

(cherry picked from commit 0685691)
@Akasurde
Copy link
Member

Closing this issue as #65369 is merged. Please feel free to open a new issue if problem persists.

Backport for Stable 2.9 - #66013

@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Jan 2, 2020
@ansible ansible locked and limited conversation to collaborators Jan 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. infoblox Infoblox NIOS module This issue/PR relates to a module. net_tools Net-tools category networking Network category support:certified This issue/PR relates to certified code. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

4 participants