provision-openstack.yml 1.8 KB

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