provision-openstack.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ---
  2. - hosts: localhost
  3. gather_facts: True
  4. become: False
  5. pre_tasks:
  6. - include: pre_tasks.yml
  7. roles:
  8. - role: openstack-stack
  9. stack_name: "{{ env_id }}.{{ public_dns_domain }}"
  10. dns_domain: "{{ public_dns_domain }}"
  11. dns_nameservers: "{{ public_dns_nameservers }}"
  12. subnet_prefix: "{{ openstack_subnet_prefix }}"
  13. ssh_public_key: "{{ openstack_ssh_public_key }}"
  14. openstack_image: "{{ openstack_default_image_name }}"
  15. lb_flavor: "{{ openstack_default_flavor | default('m1.small') }}"
  16. etcd_flavor: "{{ openstack_default_flavor | default('m1.small') }}"
  17. master_flavor: "{{ openstack_default_flavor | default('m1.medium') }}"
  18. node_flavor: "{{ openstack_default_flavor | default('m1.medium') }}"
  19. infra_flavor: "{{ openstack_default_flavor | default('m1.medium') }}"
  20. dns_flavor: "{{ openstack_default_flavor | default('m1.small') }}"
  21. external_network: "{{ openstack_external_network_name }}"
  22. num_etcd: "{{ openstack_num_etcd | default(0) }}"
  23. num_masters: "{{ openstack_num_masters }}"
  24. num_nodes: "{{ openstack_num_nodes }}"
  25. num_infra: "{{ openstack_num_infra }}"
  26. num_dns: "{{ openstack_num_dns | default(1) }}"
  27. nodes_to_remove: "{{ openstack_nodes_to_remove | default([]) | to_yaml }}"
  28. master_volume_size: "{{ docker_volume_size }}"
  29. app_volume_size: "{{ docker_volume_size }}"
  30. infra_volume_size: "{{ docker_volume_size }}"
  31. - name: Refresh Server inventory
  32. hosts: localhost
  33. connection: local
  34. become: False
  35. gather_facts: False
  36. tasks:
  37. - meta: refresh_inventory
  38. - hosts: cluster_hosts
  39. gather_facts: True
  40. tasks:
  41. - name: Debug hostvar
  42. debug:
  43. msg: "{{ hostvars[inventory_hostname] }}"
  44. verbosity: 2
  45. - name: waiting for server to come back
  46. local_action: wait_for host={{ hostvars[inventory_hostname]['ansible_ssh_host'] }} port=22 delay=30 timeout=300
  47. become: false
  48. - include: post-provision-openstack.yml