-
Notifications
You must be signed in to change notification settings - Fork 9
/
service_discovery.yml
40 lines (37 loc) · 1.3 KB
/
service_discovery.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- name: Service discovery
hosts: undercloud
gather_facts: yes
any_errors_fatal: true
vars:
service_map:
nova-scheduler:
group: nova_scheduler
command: "nova service-list | grep nova-scheduler | awk '{print $6}' | awk -F '.' '{print $1}' | head -1"
command_execution: undercloud
nova-compute:
group: nova-compute
command: "nova service-list | grep nova-compute | awk '{print $6}' | awk -F '.' '{print $1}'"
command_execution: undercloud
neutron-server:
group: neutron-server
command: "systemctl is-active neutron-server"
command_execution: overcloud_nodes
tasks:
- fail:
msg: "'sevices' is not defined"
when: services is not defined
- fail:
msg: "{{ item }} not found in service map"
when: service_map[item] is not defined
with_items: "{{ services }}"
- include_tasks: tasks/service_discovery.yml
when: service_map[service].group not in groups or install.resync|default(false)
with_items: "{{ services }}"
loop_control:
loop_var: service
- name: generate inventory file
hosts: localhost
gather_facts: no
tags: always
roles:
- inventory-update