Move database creation into role (congress)

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.

Depends-On: https://review.openstack.org/578800
Change-Id: Ideb2774b8381baba0461220fec78d608b6dcd154
This commit is contained in:
Jesse Pretorius 2018-06-28 14:48:41 +01:00
parent cc62907734
commit a63e4a351b
2 changed files with 5 additions and 13 deletions

View File

@ -16,11 +16,6 @@
congress_service_region: "{{ service_region }}"
congress_service_in_ldap: "{{ service_ldap_backend_enabled }}"
# MariaDB details for the congress service
congress_galera_user: congress
congress_galera_database: congress
congress_galera_address: "{{ galera_address }}"
# Ensure that the package state matches the global setting
congress_package_state: "{{ package_state }}"

View File

@ -13,20 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: install congress components
- name: Install congress components
hosts: congress_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- congress
pre_tasks:
- include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
- include: common-tasks/mysql-db-user.yml
vars:
user_name: "{{ congress_galera_user }}"
password: "{{ congress_container_mysql_password }}"
login_host: "{{ congress_galera_address }}"
db_name: "{{ congress_galera_database }}"
run_once: yes
- name: Configure log directories (on metal)
include: common-tasks/os-log-dir-setup.yml
@ -42,6 +38,7 @@
- name: Configure package proxy cache
include: common-tasks/package-cache-proxy.yml
roles:
- role: "os_congress"
- role: "system_crontab_coordination"