kolla-ansible/ansible/roles/trove/tasks/reconfigure.yml
zhubingbing 195a32b1e9 Add trove role
Add trove enable options and port configuration
Add trove groups to ansible inventory
Add defaults/main.yml
Add bootstrap Ansible task
Add config Ansible task
Add deploy Ansible task
Add pull Ansible task
Add register Ansible task
Add start Ansible task
Add upgrade Ansible task
Add reconfigure Ansible task
Add templatized json and .conf files for trove
Integrate trove with haproxy
Reference installation configuration link:http://docs.openstack.org/mitaka/install-guide-rdo/trove-install.html

Change-Id: I0bc6edbf2e495ce377f994f793bde979d5c55dbf
Implements: blueprint ansible-trove
2016-11-24 03:02:27 +00:00

75 lines
2.5 KiB
YAML

---
- name: Ensuring the containers up
kolla_docker:
name: "{{ item.name }}"
action: "get_container_state"
register: container_state
failed_when: container_state.Running == false
when: inventory_hostname in groups[item.group]
with_items:
- { name: trove_api, group: trove-api }
- { name: trove_conductor, group: trove-conductor }
- { name: trove_taskmanager, group: trove-taskmanager }
- include: config.yml
- name: Check the configs
command: docker exec {{ item.name }} /usr/local/bin/kolla_set_configs --check
changed_when: false
failed_when: false
register: check_results
when: inventory_hostname in groups[item.group]
with_items:
- { name: trove_api, group: trove-api }
- { name: trove_conductor, group: trove-conductor }
- { name: trove_taskmanager, group: trove-taskmanager }
# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS'
# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE',
# just remove the container and start again
- name: Containers config strategy
kolla_docker:
name: "{{ item.name }}"
action: "get_container_env"
register: container_envs
when: inventory_hostname in groups[item.group]
with_items:
- { name: trove_api, group: trove-api }
- { name: trove_conductor, group: trove-conductor }
- { name: trove_taskmanager, group: trove-taskmanager }
- name: Remove the containers
kolla_docker:
name: "{{ item[0]['name'] }}"
action: "remove_container"
register: remove_containers
when:
- inventory_hostname in groups[item[0]['group']]
- config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
- item[2]['rc'] == 1
with_together:
- [{ name: trove_api, group: trove-api },
{ name: trove_conductor, group: trove-conductor },
{ name: trove_taskmanager, group: trove-taskmanager }]
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
- name: Restart containers
kolla_docker:
name: "{{ item[0]['name'] }}"
action: "restart_container"
when:
- inventory_hostname in groups[item[0]['group']]
- config_strategy == 'COPY_ALWAYS'
- item[1]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[2]['rc'] == 1
with_together:
- [{ name: trove_api, group: trove-api },
{ name: trove_conductor, group: trove-conductor },
{ name: trove_taskmanager, group: trove-taskmanager }]
- "{{ container_envs.results }}"
- "{{ check_results.results }}"