Move database creation into role (glance)

There is no record for why we implement the database creation outside
of the role in the playbook, when we could do it inside the role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we remove the group_vars which were duplicated from the
role, and remove the DB setup tasks as they are no longer required.

Change-Id: I759783e7cad55c0b2f91df6faf53e9fb7896da6b
Depends-On: https://review.openstack.org/568481
This commit is contained in:
Jesse Pretorius 2018-05-15 08:33:41 +01:00
parent cac7f2c183
commit bd185e2ba6
2 changed files with 1 additions and 15 deletions

View File

@ -40,11 +40,6 @@ glance_rabbitmq_telemetry_host_group: "{{ glance_rabbitmq_host_group }}"
# If there are any Ceilometer hosts in the environment, then enable its usage
glance_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}"
# MariaDB details for the glance service
glance_galera_user: glance
glance_galera_database: glance
glance_galera_address: "{{ galera_address }}"
glance_service_region: "{{ service_region }}"
glance_service_in_ldap: "{{ service_ldap_backend_enabled }}"

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Prepare MQ/DB services
- name: Prepare MQ services
hosts: glance_all
gather_facts: no
user: root
@ -64,15 +64,6 @@
- glance_ceilometer_enabled | bool
- groups[oslomsg_notify_host_group] | length > 0
- name: Configure MySQL user
include: common-tasks/mysql-db-user.yml
vars:
user_name: "{{ glance_galera_user }}"
password: "{{ glance_container_mysql_password }}"
login_host: "{{ glance_galera_address }}"
db_name: "{{ glance_galera_database }}"
run_once: yes
- name: Install glance API services