]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
common: Set release when registering
authorDavid Galloway <dgallowa@redhat.com>
Thu, 30 Apr 2020 14:37:49 +0000 (10:37 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 30 Apr 2020 14:47:25 +0000 (10:47 -0400)
Because we're running Satellite in a VM in RHV on Gluster, we get really slow I/O performance.  Sadly *well* below the recommended performance: https://access.redhat.com/solutions/3397771

When attempting to set the release in a task later in this tasklist, Satellite would throw 500 errors because it was busy still trying to let the postgres DB know the system had been registered.

Setting the release during registration will save minutes per registration.

Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/common/README.rst
roles/common/tasks/rhel-entitlements.yml

index 01b6a0e175811999b814a969cbeb5c6ce2ce1295..d6b80bc62784ea3ced0a684724089df101c853c4 100644 (file)
@@ -31,13 +31,14 @@ secrets repo.
 ``rhsm_repos`` is a list of Red Hat repos that a system should subscribe to.  We
 have them defined in ``roles/common/vars/redhat_{6,7}.yml``.
 
-``use_satellite`` is a boolean that sets whether a local Red Hat Satellite server is available and should be used instead of Red Hat's CDN.  If ``use_satellite`` is set to true, you must also define ``subscription_manager_activationkey``, ``subscription_manager_org``, and ``satellite_cert_rpm`` in your secrets repo.  See example::
+``use_satellite`` is a boolean that sets whether a local Red Hat Satellite server is available and should be used instead of Red Hat's CDN.  If ``use_satellite`` is set to true, you must also define ``subscription_manager_activationkey``, ``subscription_manager_org``, and ``satellite_cert_rpm`` in your secrets repo.  ``set_rhsm_release: true`` will add ``--release=X.Y`` to the ``subscription-manager register`` command; This prevents a RHEL7.6 install from being upgraded to RHEL7.7, for example.::
 
     # Red Hat Satellite vars
     use_satellite: true
     satellite_cert_rpm: "http://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm"
     subscription_manager_org: "Your Org"
     subscription_manager_activationkey: "abc123"
+    set_rhsm_release: false
 
 ``epel_mirror_baseurl`` is self explanatory and defined in
 ``roles/common/defaults/main.yml``.  Can be overwritten in secrets if you run
index 3215a92acaa94a03a47767d0c9d5882dcaf3af09..be21edb3f93f95fe84b20c1ac45b71812f64c74d 100644 (file)
   set_fact:
     rhsm_registered: "{{ subscription.rc == 0 }}"
 
+# A `dnf group upgrade base` which happens later in the testnodes role will
+# update a 8.X system to 8.Y.  We don't want that to happen because we
+# expect to test on a specific version.  set_rhsm_release=true locks a 8.X install to 8.X packages.
 - name: Register with subscription-manager.
   command: subscription-manager register
            --activationkey={{ subscription_manager_activationkey }}
            --org={{ subscription_manager_org }}
+           {% if set_rhsm_release|default(false)|bool == true %}--release={{ ansible_distribution_version }}{% endif %}
            --force
   no_log: true
   when: rhsm_registered == false and have_entitlements == true
   import_tasks: beta_repos.yml
   when: ansible_distribution_version not in rhsm_release_list.stdout_lines
 
-# A `dnf group upgrade base` which happens later in the testnodes role will
-# update a 8.X system to 8.Y.  We don't want that to happen because we
-# expect to test on a specific version.  This locks a 8.X install to 8.X packages.
-- name: Set release number
-  command: "subscription-manager release --set={{ ansible_distribution_version }}"
-  when: rhsm_registered == true
-  register: release_set
-  until: release_set is success
-  retries: 12
-  delay: 10
-
 - name: Get list of enabled RHSM repos
   shell: subscription-manager repos --list | grep -B4 'Enabled:.*1' | grep 'Repo ID:' | sed -e 's/Repo ID:\s*\(.*\)/\1/' | sort
   register: repo_list_cmd