]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
common: Add support for registering with Red Hat Satellite
authorDavid Galloway <dgallowa@redhat.com>
Fri, 7 Oct 2016 20:26:22 +0000 (16:26 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Mon, 26 Feb 2018 19:05:15 +0000 (14:05 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/common/README.rst
roles/common/defaults/main.yml
roles/common/tasks/rhel-entitlements.yml

index 1c561e82834b23656688bf357d7eb358d76630b2..01b6a0e175811999b814a969cbeb5c6ce2ce1295 100644 (file)
@@ -31,6 +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::
+
+    # 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"
+
 ``epel_mirror_baseurl`` is self explanatory and defined in
 ``roles/common/defaults/main.yml``.  Can be overwritten in secrets if you run
 your own local epel mirror.
index 362297746a05104415b970f361c7ef8a91fb00fe..d86f2e049d5695886bf8796426552fa4e99a73da 100644 (file)
@@ -8,6 +8,9 @@ subscription_manager_org: ""
 # Repos to enable in Red Hat Subscription Manager
 rhsm_repos: []
 
+# Defines whether to use a Red Hat Satellite server
+use_satellite: false
+
 kerberos_realm: EXAMPLE.COM
 
 epel_mirror_baseurl: "http://dl.fedoraproject.org/pub/epel"
index 99f9b2a379306880996691a0e902a363786d1846..2892e03864c968bc9a6fe171b7061dd8d2917c2d 100644 (file)
   set_fact:
     have_entitlements: "{{ subscription_manager_org != '' and subscription_manager_activationkey != ''}}"
 
+- name: Install CA Cert from Satellite Server
+  yum:
+    name: "{{ satellite_cert_rpm }}"
+    state: present
+    validate_certs: no
+  when: use_satellite == true
+
 - name: Determine if node is registered with subscription-manager.
   command: subscription-manager identity
   register: subscription