Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this file different from the mco PR https://github.com/openshift/machine-config-operator/pull/1396/files# ?? I don't see any such file in that PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"30-resolv-prepender" - that one adds the DNS VIP to resolv.conf. On the bootstrap host we just need localhost added, which is what this PR does.

IFACE=$1
STATUS=$2
case "$STATUS" in
up)
logger -s "NM local-dns-prepender triggered by ${1} ${2}."
DNS_IP="127.0.0.1"
set +e
logger -s "NM local-dns-prepender: Checking if local DNS IP is the first entry in resolv.conf"
if grep nameserver /etc/resolv.conf | head -n 1 | grep -q "$DNS_IP" ; then
logger -s "NM local-dns-prepender: local DNS IP already is the first entry in resolv.conf"
exit 0
else
logger -s "NM local-dns-prepender: Looking for '# Generated by NetworkManager' in /etc/resolv.conf to place 'nameserver $DNS_IP'"
sed -i "/^# Generated by.*$/a nameserver $DNS_IP" /etc/resolv.conf
fi
;;
*)
;;
esac
7 changes: 0 additions & 7 deletions data/data/bootstrap/baremetal/files/etc/dhcp/dhclient.conf

This file was deleted.

3 changes: 2 additions & 1 deletion pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ func (a *Bootstrap) addStorageFiles(base string, uri string, templateData *boots
}

filename := path.Base(uri)
parentDir := path.Base(path.Dir(uri))

var mode int
appendToFile := false
if path.Base(path.Dir(uri)) == "bin" {
if parentDir == "bin" || parentDir == "dispatcher.d" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it would be nice if you can include why these files need to have same permissions as bin files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, a comment would probably be nice. It's a directory of scripts executed by NetworkManager.

mode = 0555
} else if filename == "motd" {
mode = 0644
Expand Down