Change variable names for service_map_facts and update README

This commit is contained in:
Sam Doran 2018-06-11 15:41:58 -04:00
parent 311dab0336
commit 73d9b549c9
3 changed files with 10 additions and 9 deletions

View File

@ -25,7 +25,6 @@ See Docker guides for [images](https://docs.docker.com/engine/reference/commandl
## Requirements ##
- ansible >= 2.4
- python >= 2.6
- docker-py >= 1.7.0
- Docker API >= 1.20
@ -51,7 +50,8 @@ See Docker guides for [images](https://docs.docker.com/engine/reference/commandl
| Name | Default Value | Description |
|-------------------|---------------------|----------------------|
| `operations_service_names` | `[]` | List of services to restart on target systems. |
| `operations_services_to_restart` | `[]` | List of services to restart on target systems. |
| `operations_custom_service_map` | `{}` | Dictionary of services and their systemd unit files, container names, and vhosts. This will be combined with the builtin list of services in `vars/main.yml`. |
## Dependencies ##
@ -70,7 +70,7 @@ None
name: openstack-operations
tasks_from: restart_service.yml
vars:
operations_service_names:
operations_services_to_restart:
- docker
- keystone
- mariadb

View File

@ -23,4 +23,5 @@ operations_logs:
# Restart Service
operations_service_names: []
operations_services_to_restart: []
operations_custom_service_map: {}

View File

@ -1,18 +1,18 @@
- name: Gather container list
service_mgmt_facts:
operations_service_names: "{{ operations_service_names }}"
operations_service_map: "{{ operations_default_service_map|combine(operations_custom_service_map) }}"
service_map_facts:
services: "{{ operations_services_to_restart }}"
service_map: "{{ operations_service_map | combine(operations_custom_service_map) }}"
- name: Restart containerized OpenStack services
docker_container:
name: "{{ item['container_name'] }}"
state: started
restart: yes
loop: "{{ docker_containers }}"
loop: "{{ docker_containers_to_restart }}"
- name: Restart OpenStack services
service:
name: "{{ item['name'] }}"
state: restarted
loop: "{{ systemd_services }}"
loop: "{{ systemd_services_to_restart }}"
when: item['state'] == "enabled"