provision-openstack.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ---
  2. - hosts: localhost
  3. gather_facts: True
  4. become: False
  5. vars_files:
  6. - stack_params.yaml
  7. pre_tasks:
  8. - include: pre_tasks.yml
  9. roles:
  10. - role: openstack-stack
  11. - role: openstack-create-cinder-registry
  12. when:
  13. - cinder_hosted_registry_name is defined
  14. - cinder_hosted_registry_size_gb is defined
  15. - role: static_inventory
  16. when: openstack_inventory|default('static') == 'static'
  17. inventory_path: "{{ openstack_inventory_path|default(inventory_dir) }}"
  18. private_ssh_key: "{{ openstack_private_ssh_key|default('') }}"
  19. ssh_config_path: "{{ openstack_ssh_config_path|default('/tmp/ssh.config.openshift.ansible' + '.' + stack_name) }}"
  20. ssh_user: "{{ ansible_user }}"
  21. - name: Refresh Server inventory or exit to apply SSH config
  22. hosts: localhost
  23. connection: local
  24. become: False
  25. gather_facts: False
  26. tasks:
  27. - name: Exit to apply SSH config for a bastion
  28. meta: end_play
  29. when: openstack_use_bastion|default(False)|bool
  30. - name: Refresh Server inventory
  31. meta: refresh_inventory
  32. - include: post-provision-openstack.yml
  33. when: not openstack_use_bastion|default(False)|bool