add robustness after testing site.yml
This commit is contained in:
parent
d907ec4969
commit
4db6499419
30
hosts
30
hosts
@ -4,9 +4,6 @@ openstack01-node02
|
|||||||
[keystone]
|
[keystone]
|
||||||
openstack01-node03
|
openstack01-node03
|
||||||
|
|
||||||
[dockerregistry]
|
|
||||||
openstack01-node01
|
|
||||||
|
|
||||||
[glance-controller]
|
[glance-controller]
|
||||||
openstack01-node02
|
openstack01-node02
|
||||||
|
|
||||||
@ -18,30 +15,29 @@ openstack01-node01
|
|||||||
openstack01-node02
|
openstack01-node02
|
||||||
openstack01-node03
|
openstack01-node03
|
||||||
|
|
||||||
[cassandra]
|
#[cassandra]
|
||||||
openstack01-node[01:03]
|
#openstack01-node[01:03]
|
||||||
|
|
||||||
[first_cassandra]
|
#openstack01-node01
|
||||||
openstack01-node01
|
#
|
||||||
|
#[next_cassandra]
|
||||||
[next_cassandra]
|
#openstack01-node02
|
||||||
openstack01-node02
|
#openstack01-node03
|
||||||
openstack01-node03
|
|
||||||
|
|
||||||
[memcached]
|
[memcached]
|
||||||
openstack01-node03
|
openstack01-node03
|
||||||
|
|
||||||
[first_cassandra:vars]
|
#[first_cassandra:vars]
|
||||||
run_options=""
|
#run_options=""
|
||||||
|
#
|
||||||
[next_cassandra:vars]
|
#[next_cassandra:vars]
|
||||||
run_options="-e CASSANDRA_SEEDS=172.23.41.1"
|
#run_options="-e CASSANDRA_SEEDS=172.23.41.1"
|
||||||
|
|
||||||
[neutron-controller]
|
[neutron-controller]
|
||||||
openstack01-node01
|
openstack01-node01
|
||||||
|
|
||||||
[nova-controller]
|
[nova-controller]
|
||||||
openstack01-node01
|
openstack01-node03
|
||||||
|
|
||||||
[nova-compute]
|
[nova-compute]
|
||||||
openstack01-node04
|
openstack01-node04
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Start a mariadb container to use its mysql client to initialize the keystone database.
|
# 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;
|
CREATE DATABASE IF NOT EXISTS keystone;
|
||||||
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
|
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
|
||||||
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
|
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
|
||||||
|
@ -27,6 +27,13 @@
|
|||||||
|
|
||||||
- name: Initialize db
|
- name: Initialize db
|
||||||
script: scripts/initialize_db.sh {{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
|
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
|
- name: keystone manage commands to setup db
|
||||||
command: >
|
command: >
|
||||||
|
@ -10,9 +10,12 @@
|
|||||||
|
|
||||||
- name: make mariadb settings volume
|
- name: make mariadb settings volume
|
||||||
file:
|
file:
|
||||||
path: /srv/mariadb/etc/mysql
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0777
|
mode: 0777
|
||||||
|
with_items:
|
||||||
|
- /srv/mariadb/lib/mysql
|
||||||
|
- /srv/mariadb/etc/mysql
|
||||||
|
|
||||||
- name: place settings file
|
- name: place settings file
|
||||||
copy:
|
copy:
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}"
|
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}"
|
||||||
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}"
|
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}"
|
||||||
-e "MYSQL_ROOT_PASSWORD=geheim"
|
-e "MYSQL_ROOT_PASSWORD=geheim"
|
||||||
-e "NOVA_CONTROLLER_HOST=={{ hostvars[groups['nova-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 "GLANCE_CONTROLLER_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}"
|
||||||
-e "NEUTRON_PASSWORD=geheim"
|
-e "NEUTRON_PASSWORD=geheim"
|
||||||
-e "NEUTRON_USER=neutron"
|
-e "NEUTRON_USER=neutron"
|
||||||
-e "METADATA_SECRET=geheim"
|
-e "METADATA_SECRET=geheim"
|
||||||
@ -42,6 +42,7 @@
|
|||||||
/usr/bin/docker run --rm
|
/usr/bin/docker run --rm
|
||||||
{{ env_vars }}
|
{{ env_vars }}
|
||||||
--add-host=mariadb:{{ hostvars[groups['databases'][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'] }}
|
||||||
{{ docker_image }}
|
{{ docker_image }}
|
||||||
/etc/bootstrap.sh
|
/etc/bootstrap.sh
|
||||||
tags: bootstrap
|
tags: bootstrap
|
||||||
|
@ -9,8 +9,8 @@ Restart=always
|
|||||||
ExecStartPre=-/usr/bin/docker rm -f %n
|
ExecStartPre=-/usr/bin/docker rm -f %n
|
||||||
ExecStart=/usr/bin/docker run --name %n \
|
ExecStart=/usr/bin/docker run --name %n \
|
||||||
{{ env_vars | replace('\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=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
|
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
--privileged \
|
--privileged \
|
||||||
-p 8774:8774 \
|
-p 8774:8774 \
|
||||||
-p 8778:8778 \
|
-p 8778:8778 \
|
||||||
|
Loading…
Reference in New Issue
Block a user