A Python library for code common to TripleO CLI and TripleO UI.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
754 B

---
- hosts: nova_discovery_nodes
gather_facts: True
vars:
container_name: "{{ nova_host_discovery_container }}"
tasks:
- block:
- name: Check if discovery container exist
shell: docker ps | grep {{ container_name }}$
register: is_discovery_container_running
ignore_errors: True
- name: Set fact discover_hosts
set_fact:
discover_hosts: "{{ is_discovery_container_running.rc == 0 }}"
- name: Discovering nova hosts
command: docker exec {{ container_name }} nova-manage cell_v2 discover_hosts --by-service
become: true
changed_when: false
delegate_to: '{{ groups[''nova_discovery_nodes''][0] }}'
run_once: true
when:
- discover_hosts|bool