73a1812c58
clouds.yaml[0] is a richer way to express configuration for OpenStack clouds. It's also fully supported by Ansible's OpenStack modules as well as python-openstackclient and openstacksdk. It's the future - who doesn't like the future? Write a file using both the public (default) and the internal endpoints for the admin user. Also, change all of the examples to reference it and to get python-openstackclient to use it too. [0] https://docs.openstack.org/openstacksdk/latest/user/guides/connect_from_config.html Implements: blueprint use-clouds-yaml Change-Id: I557d2e4975c7b3d3c713a556b9ba47af9567ce6e
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
---
|
|
- name: Creating clouds.yaml file on the deploy node
|
|
hosts: localhost
|
|
tasks:
|
|
- name: Create /etc/openstack directory
|
|
become: true
|
|
file:
|
|
state: directory
|
|
dest: "/etc/openstack"
|
|
owner: "{{ ansible_facts.user_uid }}"
|
|
group: "{{ ansible_facts.user_gid }}"
|
|
mode: 0700
|
|
|
|
- name: Template out clouds.yaml
|
|
become: true
|
|
template:
|
|
src: "roles/common/templates/clouds.yaml.j2"
|
|
dest: "/etc/openstack/clouds.yaml"
|
|
owner: "{{ ansible_facts.user_uid }}"
|
|
group: "{{ ansible_facts.user_gid }}"
|
|
mode: 0600
|
|
|
|
- name: Creating admin openrc file on the deploy node
|
|
hosts: localhost
|
|
tasks:
|
|
- name: Template out admin-openrc.sh
|
|
become: true
|
|
template:
|
|
src: "roles/common/templates/admin-openrc.sh.j2"
|
|
dest: "{{ node_config }}/admin-openrc.sh"
|
|
owner: "{{ ansible_facts.user_uid }}"
|
|
group: "{{ ansible_facts.user_gid }}"
|
|
mode: 0600
|
|
|
|
- import_role:
|
|
name: octavia
|
|
tasks_from: openrc.yml
|
|
when: enable_octavia | bool
|