Merge "Rename role name to service name"

This commit is contained in:
Jenkins 2015-07-31 09:03:50 +00:00 committed by Gerrit Code Review
commit e9db94135d
20 changed files with 23 additions and 24 deletions

View File

@ -15,10 +15,10 @@ localhost ansible_connection=local
[haproxy:children]
support
[database:children]
[mariadb:children]
support
[message-broker:children]
[rabbitmq:children]
support
[keystone:children]

View File

@ -18,10 +18,10 @@ compute01
[haproxy:children]
support
[database:children]
[mariadb:children]
support
[message-broker:children]
[rabbitmq:children]
support
[keystone:children]

View File

@ -21,7 +21,7 @@ listen mariadb
# TODO(SamYaple): Make DB port configurable throughout Ansible
bind {{ kolla_internal_address }}:3306
{% for host in groups['database'] %}
{% for host in groups['mariadb'] %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:3306 check inter 2000 rise 2 fall 5 {% if not loop.first %}backup{% endif %}
{% endfor %}
@ -32,7 +32,7 @@ listen rabbitmq
# TODO(SamYaple): Make rabbitmq port configurable throughout Ansible
bind {{ kolla_internal_address }}:5672
{% for host in groups['message-broker'] %}
{% for host in groups['rabbitmq'] %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:5672 check inter 2000 rise 2 fall 5
{% endfor %}

View File

@ -8,7 +8,7 @@ vrrp_instance Floating {
state MASTER
interface {{ api_interface }}
virtual_router_id 51
priority {{ groups['database'].index(inventory_hostname) }}
priority {{ groups['rabbitmq'].index(inventory_hostname) }}
advert_int 1
virtual_ipaddress {
{{ kolla_internal_address }}

View File

@ -57,4 +57,4 @@
- "{{ node_config_directory }}/mariadb/:/opt/kolla/mariadb/:ro"
container_volumes_from:
- "mariadb_data"
when: delegate_host == 'None' and inventory_hostname == groups['database'][0]
when: delegate_host == 'None' and inventory_hostname == groups['mariadb'][0]

View File

@ -3,7 +3,7 @@
vars:
service_name: "mariadb"
config_source:
- "roles/database/templates/galera.cnf.j2"
- "roles/mariadb/templates/galera.cnf.j2"
config_template_dest:
- "{{ node_templates_directory }}/mariadb/galera.cnf_minimal"
config_dest: "{{ node_config_directory }}/mariadb/galera.cnf"

View File

@ -9,5 +9,5 @@
- "{{ node_config_directory }}/mariadb/:/opt/kolla/mariadb/:ro"
container_volumes_from:
- "mariadb_data"
when: delegate_host != 'None' or (groups['database'] | length) == 1 or
( delegate_host == 'None' and inventory_hostname != groups['database'][0] )
when: delegate_host != 'None' or (groups['mariadb'] | length) == 1 or
( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] )

View File

@ -8,7 +8,7 @@ query_cache_type=0
innodb_log_file_size=48M
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://{% if (groups['database'] | length) > 1 %}{% for host in groups['database'] %}{{ hostvars[host]['ansible_hostname'] }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
wsrep_cluster_address=gcomm://{% if (groups['mariadb'] | length) > 1 %}{% for host in groups['mariadb'] %}{{ hostvars[host]['ansible_hostname'] }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
wsrep_cluster_name="{{ database_cluster_name }}"
wsrep_node_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}

View File

@ -10,7 +10,7 @@
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: "roles/message-broker/templates/rabbitmq-env.conf.j2",
- { src: "rabbitmq-env.conf.j2",
dest: "{{ node_config_directory }}/rabbitmq/rabbitmq-env.conf" }
- { src: "roles/message-broker/templates/rabbitmq.config.j2",
- { src: "rabbitmq.config.j2",
dest: "{{ node_config_directory }}/rabbitmq/rabbitmq.config" }

View File

@ -10,7 +10,7 @@
{default_pass, <<"{{ rabbitmq_password }}">>},
{cluster_partition_handling, autoheal},
{cluster_nodes, [
{% for host in groups['database'] %}'rabbit@{{ hostvars[host]['ansible_hostname'] }}'{% if not loop.last %},{% endif %}{% endfor %}
{% for host in groups['rabbitmq'] %}'rabbit@{{ hostvars[host]['ansible_hostname'] }}'{% if not loop.last %},{% endif %}{% endfor %}
]}
]},

View File

@ -4,16 +4,15 @@
- haproxy
tags: haproxy
- hosts: database
- hosts: mariadb
roles:
- database
tags:
- database
- mariadb
tags: mariadb
- hosts: message-broker
- hosts: rabbitmq
roles:
- message-broker
tags: message-broker
- rabbitmq
tags: rabbitmq
- hosts: keystone
roles:

View File

@ -86,8 +86,8 @@ To run the playbooks for only a particular service, Ansible tags can be used.
Multiple tags may be specified, and order is still determined by the playbooks.
cd ./kolla/ansible
ansible-playbook -i inventory/all-in-one -e @/etc/kolla/defaults.yml -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml site.yml --tags message-broker
ansible-playbook -i inventory/all-in-one -e @/etc/kolla/defaults.yml -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml site.yml --tags message-broker,database
ansible-playbook -i inventory/all-in-one -e @/etc/kolla/defaults.yml -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml site.yml --tags rabbitmq
ansible-playbook -i inventory/all-in-one -e @/etc/kolla/defaults.yml -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml site.yml --tags rabbitmq,mariadb
Further Reading