provision_nodes.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. # Get bootstrap config token
  3. # bootstrap should be created on first master
  4. # need to fetch it and shove it into cloud data
  5. - name: create the node scale groups
  6. hosts: localhost
  7. connection: local
  8. gather_facts: yes
  9. tasks:
  10. - name: get provisioning vars
  11. include_vars: vars.yml
  12. - name: fetch master instances
  13. ec2_remote_facts:
  14. region: "{{ provision.region }}"
  15. filters:
  16. "tag:clusterid": "{{ provision.clusterid }}"
  17. "tag:host-type": master
  18. instance-state-name: running
  19. register: instancesout
  20. retries: 20
  21. delay: 3
  22. until: instancesout.instances|length > 0
  23. - name: slurp down the bootstrap.kubeconfig
  24. slurp:
  25. src: /etc/origin/master/bootstrap.kubeconfig
  26. delegate_to: "{{ instancesout.instances[0].public_ip_address }}"
  27. remote_user: root
  28. register: bootstrap
  29. - name: set_fact on localhost for kubeconfig
  30. set_fact:
  31. local_bootstrap: "{{ bootstrap }}"
  32. launch_config_name:
  33. infra: "infra-{{ ansible_date_time.epoch }}"
  34. compute: "compute-{{ ansible_date_time.epoch }}"
  35. - name: include build node group
  36. include: build_node_group.yml
  37. vars:
  38. openshift_build_node_type: infra
  39. - name: include build node group
  40. include: build_node_group.yml
  41. vars:
  42. openshift_build_node_type: compute