diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index 264f6b25d5..4e9fe68c55 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -404,7 +404,6 @@ outputs: container_puppet_script: {get_file: ./container-puppet.sh} all_nodes_validation_script.sh : {get_file: ../validation-scripts/all-nodes.sh} deploy-artifacts.sh : {get_file: ../puppet/deploy-artifacts.sh} - hosts-config.sh: {get_file: ../scripts/hosts-config.sh} generate-config-tasks: {get_file: generate-config-tasks.yaml} host-container-puppet-tasks: {get_file: host-container-puppet-tasks.yaml} deploy_steps_playbook: diff --git a/hosts-config.yaml b/hosts-config.yaml deleted file mode 100644 index 2d6d0828bd..0000000000 --- a/hosts-config.yaml +++ /dev/null @@ -1,38 +0,0 @@ -heat_template_version: rocky -description: 'All Hosts Config' - -parameters: - hosts: - type: string - -resources: - - hostsConfigImpl: - type: OS::Heat::SoftwareConfig - properties: - group: script - config: - str_replace: - params: - WRITE_HOSTS: - list_join: - - ' ' - - str_split: - - '\n' - - {get_param: hosts} - template: {get_file: scripts/hosts-config.sh} - -outputs: - config_id: - description: The ID of the hostsConfigImpl resource. - value: - {get_resource: hostsConfigImpl} - hosts_entries: - description: | - The content that should be appended to your /etc/hosts if you want to get - hostname-based access to the deployed nodes (useful for testing without - setting up a DNS). - value: {get_param: hosts} - OS::stack_id: - description: The ID of the hostsConfigImpl resource. - value: {get_resource: hostsConfigImpl} diff --git a/overcloud-resource-registry-puppet.j2.yaml b/overcloud-resource-registry-puppet.j2.yaml index 7a8241f646..b142e16e0c 100644 --- a/overcloud-resource-registry-puppet.j2.yaml +++ b/overcloud-resource-registry-puppet.j2.yaml @@ -5,7 +5,6 @@ resource_registry: OS::Heat::StructuredDeployment: config-download-structured.yaml OS::TripleO::PostDeploySteps: common/post.yaml OS::TripleO::AllNodesDeployment: OS::Heat::None - OS::TripleO::Hosts::SoftwareConfig: hosts-config.yaml OS::TripleO::DefaultPasswords: default_passwords.yaml OS::TripleO::RandomString: OS::Heat::RandomString diff --git a/scripts/hosts-config.sh b/scripts/hosts-config.sh deleted file mode 100755 index a2072eaf24..0000000000 --- a/scripts/hosts-config.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -set -eux -set -o pipefail - -write_entries() { - local file="$1" - local entries="$2" - - # Don't do anything if the file isn't there - if [ ! -f "$file" ]; then - return - fi - - if grep -q "^# HEAT_HOSTS_START" "$file"; then - temp=$(mktemp) - ( - sed '/^# HEAT_HOSTS_START/,$d' "$file" - echo -ne "\n# HEAT_HOSTS_START - Do not edit manually within this section!\n" - echo "$entries" - echo -ne "# HEAT_HOSTS_END\n\n" - sed '1,/^# HEAT_HOSTS_END/d' "$file" - ) > "$temp" - echo "INFO: Updating hosts file $file, check below for changes" - diff "$file" "$temp" || true - cat "$temp" > "$file" - else - # NOTE(aschultz): we purge any entries in the hosts file that match - # the existing short hostname on initial installation only. This - # prevents existing data from coming through and causing deployment - # issues when services (I'm looking at you rabbitmq) start up. - sed -i "/$(hostname -s)/d" "$file" - echo -ne "\n# HEAT_HOSTS_START - Do not edit manually within this section!\n" >> "$file" - echo "$entries" >> "$file" - echo -ne "# HEAT_HOSTS_END\n\n" >> "$file" - fi - -} - -hosts="$HOSTS_ENTRY" -if [ ! -z "$hosts" ]; then - for tmpl in /etc/cloud/templates/hosts.*.tmpl ; do - write_entries "$tmpl" "$hosts" - done - write_entries "/etc/hosts" "$hosts" -else - echo "No hosts in Heat, nothing written." -fi