Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-19480

Ansible redhat.satellite.host module is not idempotent when multiple interfaces are specified for a host

XMLWordPrintable

    • 0
    • False
    • Moderate
    • None
    • None
    • None
    • Manual

      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.

              jira-bugzilla-migration RH Bugzilla Integration
              rhn-support-gformisa Giovanni Formisano
              RH Bugzilla Integration RH Bugzilla Integration
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: