tripleo-ansible/tripleo_ansible/roles/tripleo-cellv2/tasks/extract_cell_information.yml

40 lines
1.4 KiB
YAML

---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Extract transport_url and database connection from one CellController
become: true
block:
- name: Extract transport_url from CellController
command: >-
crudini --get /var/lib/config-data/nova/etc/nova/nova.conf DEFAULT transport_url
register: cell_transport_url_result
- name: Set fact cell_transport_url
set_fact:
cell_transport_url: "{{ cell_transport_url_result.stdout }}"
- name: Extract database connection from CellController
command: >-
crudini --get /var/lib/config-data/nova/etc/nova/nova.conf database connection
register: cell_database_vip_result
- name: Set fact cell_database_vip
set_fact:
cell_database_vip: "{{ cell_database_vip_result.stdout |regex_replace('.*@(.*?)/.*$', '\\1') }}"
tags:
- extract
- create