summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-08-23 14:15:51 -0400
committerGitHub <noreply@github.com>2017-08-23 14:15:51 -0400
commit66f5e69759542ab8a2b5a5698c192894d9274699 (patch)
treeec1322abf79431611e899afb4659f9eaf89d9d3e /playbooks
parent1c104f28d44409fe7160a7467c65d1dfca837cc3 (diff)
parentca0dc1c5898189cf42a6ef2b4b68b37c4e9648a9 (diff)
downloadopenshift-66f5e69759542ab8a2b5a5698c192894d9274699.tar.gz
openshift-66f5e69759542ab8a2b5a5698c192894d9274699.tar.bz2
openshift-66f5e69759542ab8a2b5a5698c192894d9274699.tar.xz
openshift-66f5e69759542ab8a2b5a5698c192894d9274699.zip
Merge pull request #5112 from kwoodson/oc_adm_csr
Adding oc_adm_csr to lib_openshift for node approvals
Diffstat (limited to 'playbooks')
-rwxr-xr-xplaybooks/aws/openshift-cluster/accept.yml48
1 files changed, 48 insertions, 0 deletions
diff --git a/playbooks/aws/openshift-cluster/accept.yml b/playbooks/aws/openshift-cluster/accept.yml
new file mode 100755
index 000000000..d43c84205
--- /dev/null
+++ b/playbooks/aws/openshift-cluster/accept.yml
@@ -0,0 +1,48 @@
+---
+- name: Setup the vpc and the master node group
+ #hosts: oo_first_master
+ hosts: localhost
+ remote_user: root
+ gather_facts: no
+ tasks:
+ - name: get provisioning vars
+ include_vars: vars.yml
+
+ - name: bring lib_openshift into scope
+ include_role:
+ name: lib_openshift
+
+ - name: fetch masters
+ ec2_remote_facts:
+ region: "{{ provision.region }}"
+ filters:
+ "tag:clusterid": "{{ provision.clusterid }}"
+ "tag:host-type": master
+ instance-state-name: running
+ register: mastersout
+ retries: 20
+ delay: 3
+ until: "'instances' in mastersout and mastersout.instances|length > 0"
+
+ - name: fetch new node instances
+ ec2_remote_facts:
+ region: "{{ provision.region }}"
+ filters:
+ "tag:clusterid": "{{ provision.clusterid }}"
+ "tag:host-type": node
+ instance-state-name: running
+ register: instancesout
+ retries: 20
+ delay: 3
+ until: "'instances' in instancesout and instancesout.instances|length > 0"
+
+ - debug:
+ msg: "{{ instancesout.instances|map(attribute='private_dns_name') | list | regex_replace('.ec2.internal') }}"
+
+ - name: approve nodes
+ oc_adm_csr:
+ #approve_all: True
+ nodes: "{{ instancesout.instances|map(attribute='private_dns_name') | list | regex_replace('.ec2.internal') }}"
+ timeout: 0
+ register: nodeout
+ delegate_to: "{{ mastersout.instances[0].public_ip_address }}"