3ac7da64d1
Add set_configs function that implements the flow from the proposed ansible-multi spec. Move start.sh to config-internal.sh to preserve existing behaviour. config-externall.sh copies the appropriate configs in from the bind'd location and sets permissions and ownership appropriately. Partially Implements: blueprint ansible-multi Change-Id: I53fca0660451087f273fefc3c63e0d8cf1a2c096
35 lines
883 B
YAML
35 lines
883 B
YAML
---
|
|
- name: Creating database
|
|
mysql_db:
|
|
login_host: "{{ database_address }}"
|
|
login_user: "{{ database_user }}"
|
|
login_password: "{{ database_password }}"
|
|
name: "{{ service_database_name }}"
|
|
register: database
|
|
run_once: True
|
|
|
|
- name: Creating database user and setting permissions
|
|
mysql_user:
|
|
login_host: "{{ database_address }}"
|
|
login_user: "{{ database_user }}"
|
|
login_password: "{{ database_password }}"
|
|
name: "{{ service_database_name }}"
|
|
password: "{{ service_database_password }}"
|
|
host: "%"
|
|
priv: "{{ service_database_name }}.*:ALL"
|
|
append_privs: "yes"
|
|
run_once: True
|
|
|
|
- include: start.yml
|
|
vars:
|
|
run_once: True
|
|
when: database|changed
|
|
|
|
- name: Cleaning up boostrap container
|
|
docker:
|
|
name: "{{ container_name }}"
|
|
image: "{{ container_image }}"
|
|
state: "absent"
|
|
run_once: True
|
|
when: database|changed
|