Initial commit for adding ansible support
This adds a very basic structure to begin supporting ansible in Kolla. Ansible can support complete idempotency, but wrapping docker-compose does not allow idempotency at this time. These playbooks will be extended to compensate for that in future patches. Change-Id: I1c9e8d32321e2733f5a9b752edf74b4fe90317ed
This commit is contained in:
parent
62dbf832ad
commit
0f5af771ef
42
ansible/README.md
Normal file
42
ansible/README.md
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
Koalla - Kolla with ansible!
|
||||||
|
============================
|
||||||
|
|
||||||
|
Koalla extends the Kolla project past [TripleO][] into its own bonified
|
||||||
|
deployment system using [Ansible][] and [docker-compose][].
|
||||||
|
|
||||||
|
[TripleO]: https://wiki.openstack.org/wiki/TripleO
|
||||||
|
[Ansible]: https://docs.ansible.com
|
||||||
|
[docker-compose]: http://docs.docker.com/compose
|
||||||
|
|
||||||
|
|
||||||
|
Getting Started
|
||||||
|
===============
|
||||||
|
|
||||||
|
To run the ansible playbooks, you must specify an inventory file which tracks
|
||||||
|
all of the available nodes in your environment. With this inventory file
|
||||||
|
ansible will log into each node via ssh (configurable) and run tasks. Ansible
|
||||||
|
does not require password less logins via ssh, however it is highly recommended
|
||||||
|
to setup ssh-keys. More information on the ansible inventory file can be found
|
||||||
|
[here][].
|
||||||
|
|
||||||
|
[here]: https://docs.ansible.com/intro_inventory.html
|
||||||
|
|
||||||
|
|
||||||
|
Deploying
|
||||||
|
=========
|
||||||
|
|
||||||
|
For AIO deploys, you can run the following commands. These will setup all of
|
||||||
|
the containers on your localhost.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cd ./kolla/ansible
|
||||||
|
$ ansible-playbook -i inventory/all-in-one site.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Further Reading
|
||||||
|
===============
|
||||||
|
|
||||||
|
Ansible playbook documentation can be found [here][].
|
||||||
|
|
||||||
|
[here]: http://docs.ansible.com/playbooks.html
|
8
ansible/inventory/all-in-one
Normal file
8
ansible/inventory/all-in-one
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[support]
|
||||||
|
localhost ansible_connection=local
|
||||||
|
|
||||||
|
[database:children]
|
||||||
|
support
|
||||||
|
|
||||||
|
[message-broker:children]
|
||||||
|
support
|
14
ansible/inventory/multinode
Normal file
14
ansible/inventory/multinode
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[support]
|
||||||
|
# These hostname must be resolvable from your deployment host
|
||||||
|
support01 ansible_ssh_user=sam
|
||||||
|
support02 ansible_ssh_user=sam
|
||||||
|
support03 ansible_ssh_user=sam
|
||||||
|
|
||||||
|
# The above can also be specified as follows:
|
||||||
|
#support[01:03] ansible_ssh_user=sam
|
||||||
|
|
||||||
|
[database:children]
|
||||||
|
support
|
||||||
|
|
||||||
|
[message-broker:children]
|
||||||
|
support
|
3
ansible/roles/database/tasks/main.yml
Normal file
3
ansible/roles/database/tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- name: Bringing up mariadb service(s)
|
||||||
|
command: docker-compose -f /root/kolla/compose/mariadb.yml up -d
|
3
ansible/roles/message-broker/tasks/main.yml
Normal file
3
ansible/roles/message-broker/tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- name: Bringing up rabbitmq service(s)
|
||||||
|
command: docker-compose -f /root/kolla/compose/rabbitmq.yml up -d
|
10
ansible/site.yml
Normal file
10
ansible/site.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
- hosts: database
|
||||||
|
roles:
|
||||||
|
- database
|
||||||
|
tags: database
|
||||||
|
|
||||||
|
- hosts: message-broker
|
||||||
|
roles:
|
||||||
|
- message-broker
|
||||||
|
tags: message-broker
|
Loading…
Reference in New Issue
Block a user