theforeman / foreman-ansible-modules

Ansible modules for interacting with the Foreman API and various plugin APIs such as Katello
GNU General Public License v3.0
147 stars 163 forks source link

katello_repository_set error: A value must be provided for the "product" field. #232

Closed flyemsafe closed 5 years ago

flyemsafe commented 5 years ago
SUMMARY

Enabling repository sets results in error; A value must be provided for the "product" field.

ISSUE TYPE
ANSIBLE VERSION
ansible 2.7.7
KATELLO/FOREMAN VERSION
tfm-rubygem-katello-3.10.0.19-1.el7sat.noarch
NAILGUN VERSION
Version: 0.30.2

yes

STEPS TO REPRODUCE
- name: "Enable repository sets"
  katello_repository_set:
    username: "{{ configure_katello_username }}"
    password: "{{ configure_katello_password }}"
    server_url: "{{ configure_katello_server_url }}"
    verify_ssl: "{{ configure_katello_verify_ssl }}"
    name: "Red Hat Enterprise Linux 7 Server (RPMs)"
    product: "Red Hat Enterprise Linux Server"
    organization: ACME
    repositories:
    - releasever: "7Server"
      basearch: "x86_64"
    state: enabled

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->

Repository sets enabled.

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes below -->

task path: /home/rheron/.ansible/roles/rodhouse/publish/ansible-role-configure-katello/tasks/repositories.yml:2 Using module file /home/rheron/.ansible/modules/foreman-ansible-modules/modules/katello_repository_set.py

ESTABLISH LOCAL CONNECTION FOR USER: rheron EXEC /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-vujvdphxeckwmkdkqlddcjuyyrapyobs; /usr/bin/python'"'"' && sleep 0' The full traceback is: Traceback (most recent call last): File "", line 113, in File "", line 105, in _ansiballz_main File "", line 48, in invoke_module File "/tmp/ansible_katello_repository_set_payload_3_Zh7Z/__main__.py", line 232, in File "/tmp/ansible_katello_repository_set_payload_3_Zh7Z/__main__.py", line 228, in main File "/tmp/ansible_katello_repository_set_payload_3_Zh7Z/ansible_katello_repository_set_payload.zip/ansible/module_utils/basic.py", line 2369, in fail_json File "/tmp/ansible_katello_repository_set_payload_3_Zh7Z/ansible_katello_repository_set_payload.zip/ansible/module_utils/basic.py", line 2341, in _return_formatted File "/tmp/ansible_katello_repository_set_payload_3_Zh7Z/ansible_katello_repository_set_payload.zip/ansible/module_utils/basic.py", line 522, in remove_values File "/tmp/ansible_katello_repository_set_payload_3_Zh7Z/ansible_katello_repository_set_payload.zip/ansible/module_utils/basic.py", line 505, in _remove_values_conditions TypeError: Value of unknown type: , A value must be provided for the "product" field. fatal: [localhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"\", line 113, in \n File \"\", line 105, in _ansiballz_main\n File \"\", line 48, in invoke_module\n File \"/tmp/ansible_katello_repository_set_payload_3_Zh7Z/__main__.py\", line 232, in \n File \"/tmp/ansible_katello_repository_set_payload_3_Zh7Z/__main__.py\", line 228, in main\n File \"/tmp/ansible_katello_repository_set_payload_3_Zh7Z/ansible_katello_repository_set_payload.zip/ansible/module_utils/basic.py\", line 2369, in fail_json\n File \"/tmp/ansible_katello_repository_set_payload_3_Zh7Z/ansible_katello_repository_set_payload.zip/ansible/module_utils/basic.py\", line 2341, in _return_formatted\n File \"/tmp/ansible_katello_repository_set_payload_3_Zh7Z/ansible_katello_repository_set_payload.zip/ansible/module_utils/basic.py\", line 522, in remove_values\n File \"/tmp/ansible_katello_repository_set_payload_3_Zh7Z/ansible_katello_repository_set_payload.zip/ansible/module_utils/basic.py\", line 505, in _remove_values_conditions\nTypeError: Value of unknown type: , A value must be provided for the \"product\" field.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } PLAY RECAP *********************************************************************************************** localhost : ok=5 changed=1 unreachable=0 failed=1 ```
sean797 commented 5 years ago

I think you are using Nailgun without https://github.com/SatelliteQE/nailgun/commit/d0bc410ec5a19f45643c089528c2bb31e1387916#diff-3822710a997c3f2f7c3e93e884af69caL5685 ?

I'd suggest installing Nailgun from source, Pypi doesn't get updated all that often. pip install git+https://github.com/SatelliteQE/nailgun.git@master#egg=nailgun should work

flyemsafe commented 5 years ago

ok, let me try that. I was using

git+https://github.com/SatelliteQE/nailgun.git@6.4.z#egg=nailgun
flyemsafe commented 5 years ago

Thanks, this worked for me.