Last active
February 23, 2017 18:02
-
-
Save tbielawa/6c0947572e0dc63581125233d69aed87 to your computer and use it in GitHub Desktop.
Test rhel sub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 656a25ed8a290b6634927de000455aab0956198e Mon Sep 17 00:00:00 2001 | |
From: Tim Bielawa <tbielawa@redhat.com> | |
Date: Tue, 7 Feb 2017 08:28:13 -0800 | |
Subject: [PATCH] Hacky work-around for rhel-subscribe | |
--- | |
playbooks/byo/rhel_subscribe.yml | 28 +++++++++++++++++++++++++++- | |
roles/rhel_subscribe/meta/main.yml | 2 +- | |
roles/rhel_subscribe/tasks/main.yml | 4 ++-- | |
3 files changed, 30 insertions(+), 4 deletions(-) | |
diff --git a/playbooks/byo/rhel_subscribe.yml b/playbooks/byo/rhel_subscribe.yml | |
index 65c0b1c..daa71a6 100644 | |
--- a/playbooks/byo/rhel_subscribe.yml | |
+++ b/playbooks/byo/rhel_subscribe.yml | |
@@ -1,7 +1,33 @@ | |
--- | |
-- include: ../common/openshift-cluster/std_include.yml | |
+- name: Create initial host groups for localhost | |
+ hosts: localhost | |
+ connection: local | |
+ become: no | |
+ gather_facts: no | |
tags: | |
- always | |
+ tasks: | |
+ - include_vars: openshift-cluster/cluster_hosts.yml | |
+ - name: Evaluate group l_oo_all_hosts | |
+ add_host: | |
+ name: "{{ item }}" | |
+ groups: l_oo_all_hosts | |
+ with_items: "{{ g_all_hosts | default([]) }}" | |
+ changed_when: no | |
+ | |
+- name: Create initial host groups for all hosts | |
+ hosts: l_oo_all_hosts | |
+ gather_facts: no | |
+ tags: | |
+ - always | |
+ tasks: | |
+ - include_vars: openshift-cluster/cluster_hosts.yml | |
+ - set_fact: | |
+ openshift_deployment_type: "{{ deployment_type }}" | |
+ | |
+# - include: ../common/openshift-cluster/std_include.yml | |
+# tags: | |
+# - always | |
- name: Subscribe hosts, update repos and update OS packages | |
hosts: l_oo_all_hosts | |
diff --git a/roles/rhel_subscribe/meta/main.yml b/roles/rhel_subscribe/meta/main.yml | |
index 0bbeadd..46b3b12 100644 | |
--- a/roles/rhel_subscribe/meta/main.yml | |
+++ b/roles/rhel_subscribe/meta/main.yml | |
@@ -1,3 +1,3 @@ | |
--- | |
dependencies: | |
- - role: openshift_facts | |
+ # - role: openshift_facts | |
diff --git a/roles/rhel_subscribe/tasks/main.yml b/roles/rhel_subscribe/tasks/main.yml | |
index 28c3c70..89b614f 100644 | |
--- a/roles/rhel_subscribe/tasks/main.yml | |
+++ b/roles/rhel_subscribe/tasks/main.yml | |
@@ -8,6 +8,7 @@ | |
rhel_subscription_user: "{{ lookup('oo_option', 'rhel_subscription_user') | default(rhsub_user, True) | default(omit, True) }}" | |
rhel_subscription_pass: "{{ lookup('oo_option', 'rhel_subscription_pass') | default(rhsub_pass, True) | default(omit, True) }}" | |
rhel_subscription_server: "{{ lookup('oo_option', 'rhel_subscription_server') | default(rhsub_server) }}" | |
+ no_log: True | |
- fail: | |
msg: "This role is only supported for Red Hat hosts" | |
@@ -57,5 +58,4 @@ | |
when: openshift_pool_id.stdout != '' | |
- include: enterprise.yml | |
- when: deployment_type in [ 'enterprise', 'atomic-enterprise', 'openshift-enterprise' ] and | |
- not openshift.common.is_atomic | bool | |
+ when: deployment_type in [ 'enterprise', 'atomic-enterprise', 'openshift-enterprise' ] | |
-- | |
2.9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IN YOUR INVENTORY FILE IN THE [OSEv3:vars] section: | |
rhsub_pool="Employee SKU*" | |
# Looks up an environment variable you must set in your shell "RHSUB_PASS" | |
rhsub_pass="{{ lookup('env','RHSUB_PASS') }}" | |
# Looks up an environment variable you must set in your shell "RHSUB_USER" | |
rhsub_user="{{ lookup('env','RHSUB_USER') }}" |
And subscribe with
$ ansible-playbook -v -i ./hosts-local-reg ./playbooks/byo/rhel_subscribe.yml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apply that patch with: