Bug 2228828 - Ansible redhat.satellite.host module is not idempotent when multiple interfaces are specified for a host [NEEDINFO]
Summary: Ansible redhat.satellite.host module is not idempotent when multiple interfac...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible Collection
Version: 6.13.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-03 11:11 UTC by Giovanni Formisano
Modified: 2023-08-10 12:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:
gformisa: needinfo? (satellite6-bugs)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-19480 0 None None None 2023-08-10 12:39:40 UTC

Description Giovanni Formisano 2023-08-03 11:11:34 UTC
Description of problem:
Trying to execute an ansible playbook test provisioning hosts (vmware vm) with 2 NICs with redhat.satellite.host module and running the script the second time it's failing with this error:

failed: [localhost] (item=XXXXX.yyy.net) => {"ansible_loop_var": "item", "changed": false, "error": {"errors": {"ip": ["can't be blank"], "ip6": ["can't be blank"], "primary": ["interface is already set on the host"], "provision": ["interface is already set on the host"]}, "full_messages": ["Primary interface is already set on the host", "Provision interface is already set on the host", "IP address can't be blank", "Ip6 can't be blank"], "id": null}, "item": "xxxx.yyy.net", "msg": "Error while performing create on interfaces: 422 Client Error: Unprocessable Entity for url: https://xxxx.yyy.net/api/hosts/933/interfaces"}


ansible --version
ansible 2.9.27
  config file = /root/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Jan 23 2023, 22:31:05) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)]

How reproducible:

Execute playbook without compute_attributes the behaviour is still the same.Subsequent playbook execution fails with errors

Actual results:

failed: [localhost] (item=xxxx.yyy.net) => {"ansible_loop_var": "item", "changed": false, "error": {"errors": {"ip": ["can't be blank"], "ip6": ["can't be blank"], "primary": ["interface is already set on the host"], "provision": ["interface is already set on the host"]}, "full_messages": ["Primary interface is already set on the host", "Provision interface is already set on the host", "IP address can't be blank", "Ip6 can't be blank"], "id": null}, "item": "xxxx.yyy.net", "msg": "Error while performing create on interfaces: 422 Client Error: Unprocessable Entity for url: https://xxxx.yyy.net/api/hosts/933/interfaces"}
In addition - running without compute_attributes if the host doesn't exist in Satellite,there is an additional error:


failed: [localhost] (item=xxxx.yyy.net) => {"ansible_loop_var": "item", "changed": false, "error": {"errors": {"base": ["Failed to create a compute VCenter (VMware) instance xxxx.yyy.net: Unknown Network ID: \n "]}, "full_messages": ["Failed to create a compute VCenter (VMware) instance xxxx.yyy.net: Unknown Network ID: \n "], "id": 933}, "item": "xxxx.yyy.net", "msg": "Error while performing update on hosts: 422 Client Error: Unprocessable Entity for url: https://xxxx.yyy.net/api/hosts/933"}


Expected results:

Using redhat.satellite.host module, needs idempotent while creating a VM in vSphere with 2 NICs.


Note You need to log in before you can comment on or make changes to this bug.