HAProxy deployment elements

- haproxy-deployment.sh script
- keystone, nova, haproxy_config, haproxy resources
This commit is contained in:
Przemyslaw Kaminski 2015-04-20 12:25:26 +02:00
parent 73e09b3b6a
commit d6e97dab9b
14 changed files with 117 additions and 0 deletions

View File

@ -1,3 +1,5 @@
# x
## Usage:
Creating resources:

47
haproxy-deployment.sh Executable file
View File

@ -0,0 +1,47 @@
#!/usr/bin/env bash
# HAProxy deployment with Keystone and Nova
cd /vagrant
rm clients.json
rm -Rf rs/*
# Create resources
python cli.py resource create node1 x/resources/ro_node/ rs/ '{"ip":"10.0.0.3", "ssh_key" : "/vagrant/tmp/keys/ssh_private", "ssh_user":"vagrant"}'
python cli.py resource create node2 x/resources/ro_node/ rs/ '{"ip":"10.0.0.4", "ssh_key" : "/vagrant/tmp/keys/ssh_private", "ssh_user":"vagrant"}'
python cli.py resource create node3 x/resources/ro_node/ rs/ '{"ip":"10.0.0.5", "ssh_key" : "/vagrant/tmp/keys/ssh_private", "ssh_user":"vagrant"}'
python cli.py resource create node4 x/resources/ro_node/ rs/ '{"ip":"10.0.0.6", "ssh_key" : "/vagrant/tmp/keys/ssh_private", "ssh_user":"vagrant"}'
python cli.py resource create node5 x/resources/ro_node/ rs/ '{"ip":"10.0.0.7", "ssh_key" : "/vagrant/tmp/keys/ssh_private", "ssh_user":"vagrant"}'
python cli.py resource create mariadb_keystone1_data x/resources/data_container/ rs/ '{"image": "mariadb", "export_volumes" : ["/var/lib/mysql"], "ip": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create mariadb_keystone2_data x/resources/data_container/ rs/ '{"image": "mariadb", "export_volumes" : ["/var/lib/mysql"], "ip": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create keystone1 x/resources/keystone/ rs/ '{"ip": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create keystone2 x/resources/keystone/ rs/ '{"ip": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create haproxy_keystone_config x/resources/haproxy_config/ rs/ '{"server": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create mariadb_nova1_data x/resources/data_container/ rs/ '{"image" : "mariadb", "export_volumes" : ["/var/lib/mysql"], "ip": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create mariadb_nova2_data x/resources/data_container/ rs/ '{"image" : "mariadb", "export_volumes" : ["/var/lib/mysql"], "ip": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create nova1 x/resources/nova/ rs/ '{"server": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create nova2 x/resources/nova/ rs/ '{"server": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create haproxy_nova_config x/resources/haproxy_config/ rs/ '{"server": "", "ssh_user": "", "ssh_key": ""}'
python cli.py resource create haproxy x/resources/haproxy/ rs/ '{"configs": [], "ssh_user": "", "ssh_key": ""}'
# Connect resources
python cli.py connect rs/node1 rs/mariadb_keystone1_data
python cli.py connect rs/node2 rs/mariadb_keystone2_data
python cli.py connect rs/mariadb_keystone1_data rs/keystone1
python cli.py connect rs/mariadb_keystone2_data rs/keystone2
python cli.py connect rs/haproxy_keystone_config rs/keystone2 --mapping '{"ip": "servers"}'
python cli.py connect rs/node3 rs/mariadb_nova1_data
python cli.py connect rs/node4 rs/mariadb_nova2_data
python cli.py connect rs/mariadb_nova1_data rs/nova1
python cli.py connect rs/mariadb_nova2_data rs/nova2
python cli.py connect rs/nova2 rs/haproxy_nova_config --mapping '{"ip": "servers"}'
python cli.py connect rs/node5 rs/haproxy
python cli.py connect rs/haproxy_keystone_config rs/haproxy --mapping '{"server": "servers"}'
python cli.py connect rs/haproxy_nova_config rs/haproxy --mapping '{"server": "servers"}'

View File

@ -0,0 +1,6 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- shell: docker stop {{ name }}
- shell: docker rm {{ name }}

View File

@ -0,0 +1,6 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- shell: docker run -d --net="host" --privileged \
--name {{ name }} {{ image }}

View File

@ -0,0 +1,5 @@
id: haproxy
handler: ansible
version: 1.0.0
input:
servers:

View File

@ -0,0 +1,6 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- shell: docker stop {{ name }}
- shell: docker rm {{ name }}

View File

@ -0,0 +1,6 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- shell: docker run -d --net="host" --privileged \
--name {{ name }} {{ image }}

View File

@ -0,0 +1,5 @@
id: haproxy_config
handler: ansible
version: 1.0.0
input:
servers:

View File

@ -0,0 +1,6 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- shell: docker stop {{ name }}
- shell: docker rm {{ name }}

View File

@ -0,0 +1,6 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- shell: docker run -d --net="host" --privileged \
--name {{ name }} {{ image }}

View File

@ -0,0 +1,5 @@
id: keystone
handler: ansible
version: 1.0.0
input:
image: garland/docker-openstack-keystone

View File

@ -0,0 +1,6 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- shell: docker stop {{ name }}
- shell: docker rm {{ name }}

View File

@ -0,0 +1,6 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- shell: docker run -d --net="host" --privileged \
--name {{ name }} {{ image }}

View File

@ -0,0 +1,5 @@
id: nova
handler: ansible
version: 1.0.0
input:
image: # TODO