diff --git a/ansible/post-deploy.yml b/ansible/post-deploy.yml index 6bf8b482c6..831d41e713 100644 --- a/ansible/post-deploy.yml +++ b/ansible/post-deploy.yml @@ -10,3 +10,8 @@ owner: "{{ ansible_user_uid }}" group: "{{ ansible_user_gid }}" mode: 0600 + + - import_role: + name: octavia + tasks_from: openrc.yml + when: enable_octavia | bool diff --git a/ansible/roles/octavia/tasks/openrc.yml b/ansible/roles/octavia/tasks/openrc.yml new file mode 100644 index 0000000000..19eee9693e --- /dev/null +++ b/ansible/roles/octavia/tasks/openrc.yml @@ -0,0 +1,9 @@ +--- +- name: Template out octavia-openrc.sh + become: true + template: + src: octavia-openrc.sh.j2 + dest: "{{ node_config }}/octavia-openrc.sh" + owner: "{{ ansible_user_uid }}" + group: "{{ ansible_user_gid }}" + mode: 0600 diff --git a/ansible/roles/octavia/templates/octavia-openrc.sh.j2 b/ansible/roles/octavia/templates/octavia-openrc.sh.j2 new file mode 100644 index 0000000000..b0308c3c24 --- /dev/null +++ b/ansible/roles/octavia/templates/octavia-openrc.sh.j2 @@ -0,0 +1,11 @@ +# Clear any old environment that may conflict. +for key in $( set | awk '{FS="="} /^OS_/ {print $1}' ); do unset $key ; done +export OS_PROJECT_DOMAIN_NAME=Default +export OS_USER_DOMAIN_NAME=Default +export OS_PROJECT_NAME={{ octavia_service_auth_project }} +export OS_USERNAME=octavia +export OS_PASSWORD={{ octavia_keystone_password }} +export OS_AUTH_URL={{ keystone_admin_url }}/v3 +export OS_INTERFACE=internal +export OS_ENDPOINT_TYPE=internalURL + diff --git a/tests/check-config.sh b/tests/check-config.sh index ce77711ab2..c3751537a7 100755 --- a/tests/check-config.sh +++ b/tests/check-config.sh @@ -21,7 +21,7 @@ function check_config { -not -regex .*key \ -not -regex ".*ca-certificates.*" \ -not -path /etc/kolla \ - -not -name admin-openrc.sh \ + -not -regex .*-openrc.sh \ -not -name globals.yml \ -not -name ceph-ansible.yml \ -not -name header \