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_network router and ntp-servers (42) option can not have a use_option flag #221

Open
ggeronimo-github opened this issue Apr 2, 2024 · 2 comments

Comments

@ggeronimo-github
Copy link

Summary
When using the infoblox.nios_modules.nios_network, for certain DHCP options router and 42, I am getting the errors:

Option router can not have a use_option flag

Option ntp-servers can not have a use_option flag

Issue Type
Bug Report

Component Name
nios_network

Ansible Version
ansible [core 2.16.4]

Configuration

# tasks for dhcp_network
- name: Set DHCP network and options for multiple networks IPv4
  loop: "{{ dhcp_networks }}"
  loop_control:
    loop_var: dhcp_network
  infoblox.nios_modules.nios_network:
    network_view: "{{ dhcp_network.network_view }}"
    network: "{{ dhcp_network.network }}"
    comment: "{{ dhcp_network.comment }}"
    options:
      - name: domain-name-servers
        value: "{{ dhcp_network.dns_server }}"
      - name: router
        value: "{{ dhcp_network.router }}"

    members:
      - name: "{{ dhcp_network.dhcp_member }}"
    state: present
    provider: "{{ nios_provider }}"

and

# tasks for dhcp_network
- name: Set DHCP network and options for multiple networks IPv4
  loop: "{{ dhcp_networks }}"
  loop_control:
    loop_var: dhcp_network
  infoblox.nios_modules.nios_network:
    network_view: "{{ dhcp_network.network_view }}"
    network: "{{ dhcp_network.network }}"
    comment: "{{ dhcp_network.comment }}"
    options:
      - name: domain-name-servers
        value: "{{ dhcp_network.dns_server }}"
      - num: 42
        value: "{{ dhcp_network.ntp_server }}"

    members:
      - name: "{{ dhcp_network.dhcp_member }}"
    state: present
    provider: "{{ nios_provider }}"

Expected Results
Since router and option 42 can not have a use_option flag, it should not be included when using the module, and task should be ok, not failed.

Actual Results

"msg": "Option router can not have a use_option flag",
    "operation": "update_object",
    "type": "AdmConProtoError"

and 

    "msg": "Option ntp-servers can not have a use_option flag",
    "operation": "update_object",
    "type": "AdmConProtoError"
@badnetmask
Copy link
Contributor

This is a relatively simple patch (I've done it before), I just don't have the availability to do it right now, but you can probably try it on your side first to prove the point.

Look for wherever your collections are landed on your system, edit this line on nios_network.py, then add the numbers 3 and 42 (options "router" and "ntp-server" respectively).

If it works, you can even submit your own PR. 😉

@chuegel
Copy link

chuegel commented Oct 25, 2024

@badnetmask it worked, thanks for the hint!

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

No branches or pull requests

3 participants