add robustness after testing site.yml

This commit is contained in:
Egon Rijpkema 2017-08-02 15:22:10 +02:00
parent d907ec4969
commit 4db6499419
6 changed files with 29 additions and 22 deletions

30
hosts
View File

@ -4,9 +4,6 @@ openstack01-node02
[keystone]
openstack01-node03
[dockerregistry]
openstack01-node01
[glance-controller]
openstack01-node02
@ -18,30 +15,29 @@ openstack01-node01
openstack01-node02
openstack01-node03
[cassandra]
openstack01-node[01:03]
#[cassandra]
#openstack01-node[01:03]
[first_cassandra]
openstack01-node01
[next_cassandra]
openstack01-node02
openstack01-node03
#openstack01-node01
#
#[next_cassandra]
#openstack01-node02
#openstack01-node03
[memcached]
openstack01-node03
[first_cassandra:vars]
run_options=""
[next_cassandra:vars]
run_options="-e CASSANDRA_SEEDS=172.23.41.1"
#[first_cassandra:vars]
#run_options=""
#
#[next_cassandra:vars]
#run_options="-e CASSANDRA_SEEDS=172.23.41.1"
[neutron-controller]
openstack01-node01
[nova-controller]
openstack01-node01
openstack01-node03
[nova-compute]
openstack01-node04

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Start a mariadb container to use its mysql client to initialize the keystone database.
docker run --rm -i mariadb:10.1.22 mysql -uroot -pgeheim --host "$1" << EOF
docker run --rm -i mariadb:10.2 mysql -uroot -pgeheim --host "$1" << EOF
CREATE DATABASE IF NOT EXISTS keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';

View File

@ -27,6 +27,13 @@
- name: Initialize db
script: scripts/initialize_db.sh {{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
register: result
until: result|succeeded
# sometimes the initial connect fails.
# Retry until it succeeds.
retries: 7
delay: 3
ignore_errors: yes
- name: keystone manage commands to setup db
command: >

View File

@ -10,9 +10,12 @@
- name: make mariadb settings volume
file:
path: /srv/mariadb/etc/mysql
path: "{{ item }}"
state: directory
mode: 0777
with_items:
- /srv/mariadb/lib/mysql
- /srv/mariadb/etc/mysql
- name: place settings file
copy:

View File

@ -15,8 +15,8 @@
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}"
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}"
-e "MYSQL_ROOT_PASSWORD=geheim"
-e "NOVA_CONTROLLER_HOST=={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}"
-e "GLANCE_CONTROLLER_HOST=={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}"
-e "NOVA_CONTROLLER_HOST={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}"
-e "GLANCE_CONTROLLER_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}"
-e "NEUTRON_PASSWORD=geheim"
-e "NEUTRON_USER=neutron"
-e "METADATA_SECRET=geheim"
@ -42,6 +42,7 @@
/usr/bin/docker run --rm
{{ env_vars }}
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}
{{ docker_image }}
/etc/bootstrap.sh
tags: bootstrap

View File

@ -9,8 +9,8 @@ Restart=always
ExecStartPre=-/usr/bin/docker rm -f %n
ExecStart=/usr/bin/docker run --name %n \
{{ env_vars | replace('\n', '') }} \
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }} \
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
--privileged \
-p 8774:8774 \
-p 8778:8778 \