accept.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. - name: Setup the vpc and the master node group
  3. #hosts: oo_first_master
  4. hosts: localhost
  5. remote_user: root
  6. gather_facts: no
  7. tasks:
  8. - name: get provisioning vars
  9. include_vars: vars.yml
  10. - name: bring lib_openshift into scope
  11. include_role:
  12. name: lib_openshift
  13. - name: fetch masters
  14. ec2_remote_facts:
  15. region: "{{ provision.region }}"
  16. filters:
  17. "tag:clusterid": "{{ provision.clusterid }}"
  18. "tag:host-type": master
  19. instance-state-name: running
  20. register: mastersout
  21. retries: 20
  22. delay: 3
  23. until: "'instances' in mastersout and mastersout.instances|length > 0"
  24. - name: fetch new node instances
  25. ec2_remote_facts:
  26. region: "{{ provision.region }}"
  27. filters:
  28. "tag:clusterid": "{{ provision.clusterid }}"
  29. "tag:host-type": node
  30. instance-state-name: running
  31. register: instancesout
  32. retries: 20
  33. delay: 3
  34. until: "'instances' in instancesout and instancesout.instances|length > 0"
  35. - debug:
  36. msg: "{{ instancesout.instances|map(attribute='private_dns_name') | list | regex_replace('.ec2.internal') }}"
  37. - name: approve nodes
  38. oc_adm_csr:
  39. #approve_all: True
  40. nodes: "{{ instancesout.instances|map(attribute='private_dns_name') | list | regex_replace('.ec2.internal') }}"
  41. timeout: 0
  42. register: nodeout
  43. delegate_to: "{{ mastersout.instances[0].public_ip_address }}"