Merge "Use private IP for supplemental node"

This commit is contained in:
Zuul 2019-02-19 06:48:00 +00:00 committed by Gerrit Code Review
commit a65a8ed736
4 changed files with 47 additions and 10 deletions

View File

@ -164,9 +164,15 @@ undercloud_container_cli: >-
enable_tls_everywhere: true
novajoin_connect_timeout: 60
novajoin_read_timeout: 60
external_network_cidr: 10.0.0.0/24
freeipa_admin_password: fce95318204114530f31f885c9df588f
# Set node hostnames.
freeipa_internal_ip: "{{ external_network_cidr|nthhost(250) }}"
supplemental_node_ip: "{{ freeipa_internal_ip }}"
undercloud_undercloud_nameservers: ["{{ freeipa_internal_ip }}"]
overcloud_dns_servers: ["{{ freeipa_internal_ip }}", "8.8.8.8"]
tripleo_domain: ooo.test
undercloud_cloud_domain: "{{ tripleo_domain }}"
freeipa_server_hostname: "ipa.{{ tripleo_domain }}"

View File

@ -0,0 +1,30 @@
#!/usr/bin/python
# Copyright 2019 Red Hat Inc.
#
# 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.
import json
import sys
with open(sys.argv[1] + "/instackenv.json") as f:
j = json.load(f)
with open(sys.argv[1] + "/instackenv.original.json", "w") as f:
json.dump(j, f, sort_keys=True, indent=4, separators=(',', ': '))
for k in list(j):
for el in list(j[k]):
if 'extra' in el:
j[k].pop(el)
elif (isinstance(el, dict) and 'extra' in el.get('name')):
j[k].remove(el)
with open(sys.argv[1] + "/instackenv.json", "w") as f:
json.dump(j, f, sort_keys=True, indent=4, separators=(',', ': '))

View File

@ -75,16 +75,12 @@
executable: python3
register: node_ip
- name: set_fact for supplemental ip
- name: Set fact for private supplemental ip
set_fact:
supplemental_node_ip: "{{ node_ip.stdout|replace('\n', '')|replace('\r', '')|trim }}"
supplemental_node_ip_private: "{{ node_ip.stdout|replace('\n', '')|replace('\r', '')|trim }}"
cacheable: true
when: node_ip.stdout
- name: Show the supplemental ip
debug: msg="Supplemental node IP = {{ supplemental_node_ip }}"
when: supplemental_node_ip is defined
- name: Add supplemental node vm to inventory
add_host:
name: supplemental
@ -95,7 +91,12 @@
ansible_private_key_file: '{{ extra_node_key }}'
ansible_ssh_extra_args: '-F "{{ local_working_dir }}/ssh.config.ansible"'
supplemental_node_ip: "{{ supplemental_node_ip }}"
when: supplemental_node_ip is defined
when: supplemental_node_ip_private is defined
- name: Remove extra node
script: remove_extra_node.py {{ working_dir }}
args:
executable: python3
# readd the undercloud to reset the ansible_ssh parameters set in quickstart
- name: Add undercloud vm to inventory

View File

@ -43,10 +43,10 @@ Host undercloud
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
{% if deploy_supplemental_node|bool and supplemental_node_ip is defined %}
{% if deploy_supplemental_node|bool and supplemental_node_ip_private is defined %}
Host supplemental
Hostname {{ supplemental_node_ip }}
{% if inventory == 'extra_node' %}
Hostname {{ supplemental_node_ip_private }}
{% if undercloud_type == 'ovb' %}
IdentityFile {{ extra_node_key }}
{% else %}
ProxyCommand {{ supplemental_ssh_proxy_command }}