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 164 forks source link

repository module keeps setting upstream_password #1396

Closed gvde closed 2 years ago

gvde commented 2 years ago
SUMMARY

Running against a katello 4.3 or 4.4 server my playbook always wants to change repositories which have an upstream_password set:

--- before
+++ after
@@ -5,7 +5,6 @@
             "content_type": "yum",
             "download_policy": "immediate",
             "gpg_key_id": 9,
-            "http_proxy_id": null,
             "http_proxy_policy": "global_default_http_proxy",
             "id": 251,
             "label": "bareos-com_bareos_20-el7",
@@ -14,10 +13,8 @@
             "organization_id": 1,
             "os_versions": [],
             "product_id": 163,
-            "ssl_ca_cert_id": null,
-            "ssl_client_cert_id": null,
-            "ssl_client_key_id": null,
             "unprotected": true,
+            "upstream_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
             "upstream_username": "username",
             "url": "http://download.bareos.com/bareos/release/20/CentOS_7/",
             "verify_ssl_on_sync": true
ANSIBLE VERSION
$ ansible --version
ansible 2.9.27
  config file = /home/k/k111111/git/foreman-ansible/ansible.cfg
  configured module search path = ['/home/k/k111111/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Nov 17 2021, 16:10:06) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
COLLECTION VERSION

Using latest version 3.3.0 from ansible-galaxy with some patches from pull requests.

KATELLO/FOREMAN VERSION
katello-4.4.0-1.el8.noarch
foreman-3.2.0-1.el8.noarch
STEPS TO REPRODUCE

Set upstream_username and upstream_password on repository using theforeman.foreman.repository and run the playbook twice.

EXPECTED RESULTS

Don't suggest any changes during the second run.

evgeni commented 2 years ago

The problem is that the API doesn't return the password (which is good), but then the module doesn't have anything to compare against.

In other modules we documented this behavior, in repository we forgot.

gvde commented 2 years ago

O.K. Closing this.