Skip to content

Commit fcbd80c

Browse files
committed
Remove internal nameserver and host file manipulation
1 parent 7233ab2 commit fcbd80c

25 files changed

Lines changed: 10 additions & 306 deletions

README.adoc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,6 @@ The above DNS records should be set on the DNS server authoritative for the
480480
domain used in OpenShift cluster (`example.com` in the example above).
481481
====
482482

483-
[NOTE]
484-
====
485-
A DNS server is set also on bastion node during deployment but this
486-
server is used only by OpenShift nodes internally and should not be used
487-
for resolving OpenShift user entry points. We plan to use Designate service
488-
in near future. Alternatively `skip_dns=true` parameter can be used, then
489-
instead of DNS server on bastion node openshift-ansible deploys dnsmasq on
490-
each node.
491-
====
492-
493483
== Retrieving the CA certificate
494484

495485
You can retrieve the CA certificate that was generated during the OpenShift

bastion.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ parameters:
173173
type: number
174174
default: 4000
175175

176-
skip_dns:
177-
type: boolean
178-
179176
system_update:
180177
type: boolean
181178

@@ -249,7 +246,6 @@ resources:
249246
config:
250247
str_replace:
251248
params:
252-
$SKIP_DNS: {get_param: skip_dns}
253249
$OPENSHIFT_ANSIBLE_GIT_URL: {get_param: openshift_ansible_git_url}
254250
$OPENSHIFT_ANSIBLE_GIT_REV: {get_param: openshift_ansible_git_rev}
255251
$DOCKER_VOLUME_ID: {get_resource: docker_volume}
@@ -362,13 +358,11 @@ resources:
362358
- "\n"
363359
- - "#!/bin/bash"
364360
- "set -eux"
365-
- get_file: templates/var/lib/ansible/templates/etc/resolv.conf
366361
- get_file: templates/var/lib/ansible/group_vars/masters.yml
367362
- get_file: templates/var/lib/ansible/group_vars/nodes.yml
368363
- get_file: templates/var/lib/ansible/host_vars/loadbalancer.yml
369364
- get_file: templates/var/lib/ansible/group_vars/OSv3.yml
370365
- get_file: templates/var/lib/ansible/playbooks/registry.yml
371-
- get_file: templates/var/lib/ansible/playbooks/dns.yml
372366
- get_file: templates/var/lib/ansible/playbooks/main.yml
373367
- get_file: templates/var/lib/ansible/playbooks/scaleup.yml
374368
- get_file: templates/var/lib/ansible/playbooks/scaledown.yml

fragments/bastion-ansible.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ function create_metadata_json() {
7070
"heat_outputs_path": "$heat_outputs_path",
7171
"ssh_user": "$ssh_user",
7272
"deployment_type": "$deployment_type",
73-
"skip_dns": $([ "$skip_dns" == "True" ] && echo true || echo false),
7473
"lb_ip": "$lb_ip",
7574
"dns_forwarders": "$dns_forwarders",
76-
"dns_ip": "$dns_ip",
7775
"ldap_url": "$ldap_url",
7876
"ldap_bind_dn": "$ldap_bind_dn",
7977
"ldap_bind_password": "$ldap_bind_password",
@@ -136,22 +134,6 @@ function is_scaleup() {
136134
grep -v '.*-node') && return 1 || return 0
137135
}
138136

139-
function update_etc_hosts() {
140-
# $1 - IP
141-
# $2 - hostname
142-
grep -q "$2" /etc/hosts || echo "$1 $2" >> /etc/hosts
143-
}
144-
145-
if [ "$lb_type" == "external" ]; then
146-
# for external loadbalancer override LB's IP to point to the first master
147-
# node (because the LB can not be pre-set and working). This is done
148-
# only for the initial run, for next scale up/down it's expected
149-
# that the LB is already set.
150-
[ -e ${ANSDIR}.deployed ] || update_etc_hosts "$master_ip" "$lb_hostname"
151-
else
152-
update_etc_hosts "$lb_ip" "$lb_hostname"
153-
fi
154-
155137
[ "$prepare_ansible" == "False" ] && exit 0
156138

157139
mkdir -p /var/lib/ansible/group_vars

fragments/bastion-boot.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# ENVVARS
66
# WC_NOTIFY - a curl URL fragment from an OpenStack WaitCondition
77
# used to signal OpenStack of completion status
8-
# DNS_IP - The IP address of the nearest resolver host
98
#
109
# OPENSHIFT_ANSIBLE_GIT_URL - the URL of a git repository containing the
1110
# openshift ansible playbooks and configs
@@ -34,16 +33,6 @@ HEAT_AGENT_CONTAINER_IMAGE=jprovaznik/ooshift-heat-agent
3433
# Select the EPEL release to make it easier to update
3534
EPEL_RELEASE_VERSION=7-7
3635

37-
# --- DNS functions ----------------------------------------------------------
38-
#
39-
# Disable automatic updates of resolv.conf when an interface comes up
40-
function disable_resolv_updates() {
41-
# INTERFACE=$1
42-
sed -i -e '/^PEERDNS=/s/=.*/="no"/' \
43-
/etc/sysconfig/network-scripts/ifcfg-$1
44-
}
45-
46-
4736
# ----------------------------------------------------------------------------
4837
# Functions for Atomic Host systems
4938
# ----------------------------------------------------------------------------
@@ -131,9 +120,6 @@ function clone_openshift_ansible() {
131120
notify_failure "could not check out openshift-ansible rev $2"
132121
}
133122

134-
# Do not update resolv.conf from eth0 when the system boots
135-
disable_resolv_updates eth0
136-
137123
sudo_enable_from_ssh
138124

139125
if is_atomic_host

fragments/bastion-node-add.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,3 @@ NODESFILE=/var/lib/ansible/${node_type}_list
1818
mkdir -p /var/lib/ansible/
1919
touch $NODESFILE
2020
grep -q "$node_hostname" $NODESFILE || echo $node_hostname >> $NODESFILE
21-
22-
echo "$node_etc_host" >> /etc/hosts
23-
[ -e /run/ostree-booted ] && cp /etc/hosts /host/etc/hosts || true

fragments/bastion-node-cleanup.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
22
# ENVVARS
3-
# SKIP_DNS = boolean: local DNS updates are disabled
43
# node_name = "<hostname>"
54

65
# Exit on fail or bad VAR expansion
@@ -38,11 +37,4 @@ fi
3837
-u $ssh_user --sudo -i $INVENTORY \
3938
-a "subscription-manager unregister && subscription-manager clean" || true
4039

41-
# Save a copy of the current host file
42-
cp /etc/hosts{,.bkp}
43-
44-
# Remove the node IP entry from the hosts file (saving the backup)
45-
grep -v "$node_name" /etc/hosts.bkp > /etc/hosts
46-
[ -e /run/ostree-booted ] && cp /etc/hosts /host/etc/hosts
47-
4840
echo "Deleted node $node_name"

fragments/common_functions.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ function sudo_enable_from_ssh() {
1717
sed -i "/requiretty/s/^/#/" /etc/sudoers
1818
}
1919

20-
# add the local nameserver to the beginning of the local resolver list
21-
function add_nameserver() {
22-
# NAMESERVER_IP=$1
23-
sed -i "/search openstacklocal.*/anameserver $1" /etc/resolv.conf
24-
}
25-
2620
# All hosts must have an external disk device (cinder?) for docker storage
2721
function docker_set_storage_device() {
2822
# By default the cinder volume is mapped to virtio-first_20_chars of cinder

fragments/common_openshift_functions.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
function disable_peerdns() {
2-
# INTERFACE=$1
3-
sed -i '/^PEERDNS=/s/=.*/="no"/' /etc/sysconfig/network-scripts/ifcfg-$1
4-
}
5-
61
# workaround for openshift-ansible - symlinks are created in /usr/local/bin but
72
# this path is not by default in sudo secure_path so ansible fails
83
function sudo_set_secure_path() {

fragments/infra-boot.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#
33
# Prepare an OpenShift node VM for configuration by Ansible
44
#
5-
# ENVVARS
6-
# SKIP_DNS - local DNS is disabled: do not try to make updates
7-
#
85
# CONSTANTS
96
#
107
# The device to mount to store Docker images and containers
@@ -20,9 +17,7 @@ set -o pipefail
2017
source /usr/local/share/openshift-on-openstack/common_functions.sh
2118
source /usr/local/share/openshift-on-openstack/common_openshift_functions.sh
2219

23-
[ "$SKIP_DNS" != "True" ] && add_nameserver $DNS_IP
2420

25-
disable_peerdns eth0
2621
ifup eth1
2722

2823
sudo_set_secure_path "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin"

fragments/lb-boot.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Prepare the Load Balancer host to run ansible for host configuration
44
#
55
# ENVVARS
6-
# DNS_IP: The IP address of the closest DNS server for name resolution
76
# WC_NOTIFY: A curl query prefix to provide status to OpenStack WaitCondition
87

98
# Exit immediately on error or on reference to an undefined variable
@@ -19,15 +18,6 @@ source /usr/local/share/openshift-on-openstack/common_functions.sh
1918
# MAIN
2019
# ==============================================================================
2120

22-
# Add a nameserver line for the local DNS server
23-
if [ -n "$DNS_IP" ]
24-
then
25-
sed -i '/search openstacklocal.*/a\nnameserver $DNS_IP' /etc/resolv.conf
26-
fi
27-
28-
# Disable updates to the /etc/resolv.conf file for DNS when starting eth0
29-
sed -i '/^PEERDNS=/s/=.*/=no/' /etc/sysconfig/network-scripts/ifcfg-eth0
30-
3121
# workaround for openshift-ansible - Add /usr/local/bin to sudo PATH
3222
# symlinks are created in /usr/local/bin but this path is not by
3323
# default in sudo secure_path so ansible fails

0 commit comments

Comments
 (0)