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
146 stars 163 forks source link

katello_repositories, "Error while updating Repository: 'container_repository_name'" #187

Closed akofink closed 5 years ago

akofink commented 5 years ago
SUMMARY

katello_repositories module seems broken

ISSUE TYPE
ANSIBLE VERSION
ansible 2.6.5
  config file = /home/akofink/dev/repos/katello-ansible-seeds/ansible.cfg
  configured module search path = [u'/home/akofink/dev/repos/katello-ansible-seeds/foreman-ansible-modules/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15 (default, Sep 21 2018, 23:26:48) [GCC 8.1.1 20180712 (Red Hat 8.1.1-5)]
KATELLO/FOREMAN VERSION
$ sudo rpm -qa | grep -P foreman\|katello
foreman-selinux-1.20.0-0.201810011042git4d47c7a0.2.develop.el7.noarch
rubygem-foreman_maintain-0.2.11-1.el7.noarch
foreman-release-scl-7-2.el7.noarch
foreman-installer-1.20.0-0.201809270325gitccac1fb0.1.develop.el7.noarch
katello-service-3.9.0-9.el7.noarch
katello-client-bootstrap-1.6.0-1.el7.noarch
centos7-devel.virbr0.akofink-desktop-foreman-client-1.0-1.noarch
foreman-release-1.20.0-0.8.develop.el7.noarch
katello-installer-base-3.9.0-0.201810032220git6749c5f2.el7.noarch
katello-server-ca-1.0-1.noarch
centos7-devel.virbr0.akofink-desktop-foreman-proxy-client-1.0-1.noarch
katello-selinux-3.0.3-1.el7.noarch
foreman-debug-1.20.0-0.201810021310gitc4693b30.9.develop.el7.noarch
katello-certs-tools-2.4.0-1.el7.noarch
foreman-proxy-1.20.0-0.201809210746git74ae90e0.1.develop.el7.noarch
tfm-rubygem-foreman_remote_execution_core-1.1.3-2.el7.noarch
katello-default-ca-1.0-1.noarch
foreman-installer-katello-3.9.0-0.201810032220git6749c5f2.el7.noarch
pulp-katello-1.0.2-1.el7.noarch
centos7-devel.virbr0.akofink-desktop-foreman-proxy-1.0-1.noarch
tfm-rubygem-foreman-tasks-core-0.2.5-2.fm1_20.el7.noarch
katello-debug-3.9.0-9.el7.noarch
NAILGUN VERSION
Version: 0.31.0
STEPS TO REPRODUCE
  - name: Create custom docker repository
    katello_repository:
      username: "{{ foreman_username }}"
      password: "{{ foreman_password }}"
      server_url: "{{ foreman_server_url }}"
      verify_ssl: "{{ foreman_verify_ssl }}"
      name: alpine
      product: custom
      organization: Default Organization
      content_type: docker
      url: https://registry-1.docker.io/
      docker_upstream_name: library/alpine
      state: present
EXPECTED RESULTS

The repository should have been created without error.

ACTUAL RESULTS
TASK [Create custom docker repository] ****************************************************************************************************************************************************************************
task path: /home/akofink/dev/repos/katello-ansible-seeds/seed.yml:38
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: akofink
<127.0.0.1> EXEC /bin/sh -c 'echo ~akofink && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/akofink/.ansible/tmp/ansible-tmp-1539025874.26-151720823966962 `" && echo ansible-tmp-1539025874.26-151720823966962="` echo /home/akofink/.ansible/tmp/ansible-tmp-1539025874.26-151720823966962 `" ) && sleep 0'
Using module file /home/akofink/dev/nfs/centos7-hammer-devel/foreman-ansible-modules/modules/katello_repository.py
<127.0.0.1> PUT /home/akofink/.ansible/tmp/ansible-local-22808cCoJJY/tmpiuNxFv TO /home/akofink/.ansible/tmp/ansible-tmp-1539025874.26-151720823966962/katello_repository.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/akofink/.ansible/tmp/ansible-tmp-1539025874.26-151720823966962/ /home/akofink/.ansible/tmp/ansible-tmp-1539025874.26-151720823966962/katello_repository.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /home/akofink/.ansible/tmp/ansible-tmp-1539025874.26-151720823966962/katello_repository.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/akofink/.ansible/tmp/ansible-tmp-1539025874.26-151720823966962/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
  File "/tmp/ansible_eyD_b3/ansible_modlib.zip/ansible/module_utils/ansible_nailgun_cement.py", line 333, in update_entity
    volatile_entity = old_entity.read()
  File "/home/akofink/.local/lib/python2.7/site-packages/nailgun/entities.py", line 5273, in read
    return super(Repository, self).read(entity, attrs, ignore, params)
  File "/home/akofink/.local/lib/python2.7/site-packages/nailgun/entity_mixins.py", line 819, in read
    setattr(entity, field_name, attrs[field_name])

fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "content_type": "docker",
            "docker_upstream_name": "library/alpine",
            "download_policy": null,
            "label": null,
            "name": "alpine",
            "organization": "Default Organization",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "product": "custom",
            "server_url": "https://centos7-devel.virbr0.akofink-desktop",
            "state": "present",
            "url": "https://registry-1.docker.io/",
            "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "verify_ssl": false
        }
    },
    "msg": "Error while updating Repository: 'container_repository_name'"
}
akofink commented 5 years ago

Should be fixed by https://github.com/Katello/katello/pull/7777