Skip to content

Commit 1d6906b

Browse files
markgoddardyoctozepto
authored andcommitted
octavia: Ensure service auth project exists
Kolla Ansible supports configuration of the project used by Octavia to communicate with other services, via octavia_service_auth_project. Until Ussuri, this was set to admin. In Ussuri it changed to service. It may also be set to a different value. Kolla Ansible currently gives the octavia user the admin role in the project, but it does not ensure that the project exists. For admin and service projects, this is not a problem. If the project has been customised however, it will not necessarily exist, which will cause Octavia deployment to fail. This change fixes the issue by ensuring that the service auth project exists, in addition to the service project. Closes-Bug: #1922100 Change-Id: I968efbf3ad1de676548b4e3aeefc20bf80ca94a0 (cherry picked from commit fbd80bc)
1 parent 76fcf2f commit 1d6906b

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

ansible/roles/octavia/defaults/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ octavia_ks_users:
146146
user: "{{ octavia_keystone_user }}"
147147
password: "{{ octavia_keystone_password }}"
148148
role: "admin"
149+
# NOTE(mgoddard): The default for the service auth project is service, but
150+
# may be customised. Ensure the project exists, and assign the octavia user
151+
# the admin role in it.
152+
- project: "{{ octavia_service_auth_project }}"
153+
user: "{{ octavia_keystone_user }}"
154+
password: "{{ octavia_keystone_password }}"
155+
role: "admin"
149156

150157
####################
151158
# Kolla

ansible/roles/octavia/tasks/register.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,6 @@
66
service_ks_register_services: "{{ octavia_ks_services }}"
77
service_ks_register_users: "{{ octavia_ks_users }}"
88

9-
- name: "Adding admin role to octavia user in {{ octavia_service_auth_project }} project"
10-
become: true
11-
kolla_toolbox:
12-
module_name: "os_user_role"
13-
module_args:
14-
user: "{{ octavia_keystone_user }}"
15-
role: admin
16-
project: "{{ octavia_service_auth_project }}"
17-
auth: "{{ openstack_octavia_auth }}"
18-
endpoint_type: "{{ openstack_interface }}"
19-
cacert: "{{ openstack_cacert }}"
20-
region_name: "{{ openstack_region_name }}"
21-
run_once: True
22-
when: octavia_service_auth_project != 'service'
23-
249
- name: Adding octavia related roles
2510
become: true
2611
kolla_toolbox:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes an issue with Octavia deployment when using a custom service auth
5+
project. If ``octavia_service_auth_project`` is set to a project that does
6+
not exist, Octavia deployment would fail. The project is now created.
7+
`LP#1922100 <https://bugs.launchpad.net/kolla-ansible/+bug/1922100>`__

0 commit comments

Comments
 (0)