
Currently we require a slew of deps on each destination node, this includes a gcc compiler and installing things via pip. We can remove these dependencies by containerizing them and running and Ansible inside the container itself. The container would then report back facts about idempotency. DocImpact Closes-Bug: #1481495 Implements: blueprint containerize-dependencies Change-Id: I3dfccbf9fafc06ffc36e78f3006fe5d3367891df
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
---
|
|
- include: ../../start.yml
|
|
vars:
|
|
container_environment:
|
|
KOLLA_BOOTSTRAP:
|
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
|
DB_ROOT_PASSWORD: "{{ database_password }}"
|
|
container_image: "{{ docker_database_image_full }}"
|
|
container_name: "mariadb"
|
|
container_restart_policy: "no"
|
|
container_volumes:
|
|
- "{{ node_config_directory }}/mariadb/:/opt/kolla/mariadb/:ro"
|
|
container_volumes_from:
|
|
- "mariadb_data"
|
|
when: delegate_host == 'None' and inventory_hostname == groups['mariadb'][0]
|
|
|
|
- name: Creating haproxy mysql user
|
|
command: docker exec -t kolla_ansible /usr/bin/ansible localhost
|
|
-m mysql_user
|
|
-a "login_host='{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}'
|
|
login_user='{{ database_user }}'
|
|
login_password='{{ database_password }}'
|
|
name='haproxy'
|
|
password=''
|
|
host='%'"
|
|
register: haproxy_user
|
|
changed_when: "{{ (haproxy_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
|
until: haproxy_user.stdout.split()[2] == 'SUCCESS'
|
|
retries: 10
|
|
delay: 5
|
|
|
|
- name: Cleaning up facts
|
|
set_fact:
|
|
delegate_host: "bootstraped"
|