provision-openstack.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. nodes_to_remove: "{{ openstack_nodes_to_remove | default([]) | to_yaml }}"
  27. master_volume_size: "{{ docker_volume_size }}"
  28. app_volume_size: "{{ docker_volume_size }}"
  29. infra_volume_size: "{{ docker_volume_size }}"
  30. - name: Refresh Server inventory
  31. hosts: localhost
  32. connection: local
  33. gather_facts: False
  34. tasks:
  35. - meta: refresh_inventory
  36. - hosts: cluster_hosts
  37. gather_facts: false
  38. tasks:
  39. - name: Debug hostvar
  40. debug:
  41. msg: "{{ hostvars[inventory_hostname] }}"
  42. verbosity: 2
  43. - name: waiting for server to come back
  44. local_action: wait_for host={{ hostvars[inventory_hostname]['ansible_ssh_host'] }} port=22 delay=30 timeout=300
  45. become: false
  46. - include: post-provision-openstack.yml