Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #4142: /etc/hosts gets messed up by sed commands #7

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
16 changes: 8 additions & 8 deletions provision/node.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ APTITUDE_ARGS="--assume-yes"
export DEBIAN_FRONTEND=noninteractive

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)
# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)

sed -ri "s/^127\.0\.1\.1[\t ]+(node[0-9]+)(.*)/127\.0\.1\.1\\t\1\.rudder\.local\2/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+(node[0-9]+)[\t ]+(.*)/127\.0\.0\.1\\t\1\.rudder\.local \2/" /etc/hosts
echo -e "\n192.168.42.10 server.rudder.local" >> /etc/hosts


# Install lsb-release so we can guess which Debian version are we operating on.
aptitude update && aptitude ${APTITUDE_ARGS} install lsb-release
DEBIAN_RELEASE=$(lsb_release -cs)

# Accept the Rudder repository key
# Accept the Rudder repository key
wget --quiet -O- "http://${KEYSERVER}/pks/lookup?op=get&search=0x${KEY}" | sudo apt-key add -

#APT configuration
Expand All @@ -73,7 +73,7 @@ aptitude update
#Packages required by Rudder
aptitude ${APTITUDE_ARGS} install rudder-agent

# Set the IP of the rudder master
# Set the IP of the rudder master
echo "192.168.42.10" > /var/rudder/cfengine-community/policy_server.dat

# Start the CFEngine agent
Expand Down
14 changes: 7 additions & 7 deletions provision/node_centos5.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ set -e
YUM_ARGS="-y --nogpgcheck"

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)
# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)

sed -ri "s/^127\.0\.0\.1\t+(node[0-9]+)(.*)/127\.0\.0\.1\\t\1\.rudder\.local\2/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+(node[0-9]+)[\t ]+(.*)/127\.0\.0\.1\\t\1\.rudder\.local \2/" /etc/hosts
echo -e "\n192.168.42.10 server.rudder.local" >> /etc/hosts

# Add Rudder repositories
Expand Down Expand Up @@ -63,7 +63,7 @@ yum ${YUM_ARGS} install pcre openssl db4-devel
# Install Rudder
yum ${YUM_ARGS} install rudder-agent

# Set the IP of the rudder master
# Set the IP of the rudder master
echo "192.168.42.10" > /var/rudder/cfengine-community/policy_server.dat

# Start the CFEngine agent
Expand Down
14 changes: 7 additions & 7 deletions provision/node_centos6.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ set -e
YUM_ARGS="-y --nogpgcheck"

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)
# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)

sed -ri "s/^127\.0\.0\.1[\t ]+(node[0-9]+)(.*)/127\.0\.0\.1\\t\1\.rudder\.local\2/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+(node[0-9]+)[\t ]+(.*)/127\.0\.0\.1\\t\1\.rudder\.local \2/" /etc/hosts
echo -e "\n192.168.42.10 server.rudder.local" >> /etc/hosts

# Add Rudder repositories
Expand Down Expand Up @@ -61,7 +61,7 @@ yum ${YUM_ARGS} check-update || true
# Install Rudder
yum ${YUM_ARGS} install rudder-agent

# Set the IP of the rudder master
# Set the IP of the rudder master
echo "192.168.42.10" > /var/rudder/cfengine-community/policy_server.dat

# Start the CFEngine agent
Expand Down
14 changes: 7 additions & 7 deletions provision/node_sles11.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ set -e
ZYPPER_ARGS="--non-interactive --no-gpg-checks"

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)
# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)

sed -ri "s/^127\.0\.0\.1[\t ]+(node[0-9]+)(.*)/127\.0\.0\.1\\t\1\.rudder\.local\2/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+(node[0-9]+)[\t ]+(.*)/127\.0\.0\.1\\t\1\.rudder\.local \2/" /etc/hosts
echo -e "\n192.168.42.10 server.rudder.local" >> /etc/hosts

# Add Rudder repositories
Expand Down Expand Up @@ -70,7 +70,7 @@ zypper ${ZYPPER_ARGS} refresh
# Install Rudder agent
zypper ${ZYPPER_ARGS} install rudder-agent

# Set the IP of the rudder master
# Set the IP of the rudder master
echo "192.168.42.10" > /var/rudder/cfengine-community/policy_server.dat

# Start the CFEngine agent
Expand Down
16 changes: 8 additions & 8 deletions provision/node_ubuntu.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ APTITUDE_ARGS="--assume-yes"
export DEBIAN_FRONTEND=noninteractive

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)
# Host preparation:
# This machine is "node", with the FQDN "node.rudder.local".
# It has this IP : 192.168.42.11 (See the Vagrantfile)

sed -ri "s/^127\.0\.1\.1[\t ]+(node[0-9]+)(.*)/127\.0\.1\.1\\t\1\.rudder\.local \1\2/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+(node[0-9]+)[\t ]+(.*)/127\.0\.0\.1\\t\1\.rudder\.local \2/" /etc/hosts
echo -e "\n192.168.42.10 server.rudder.local" >> /etc/hosts


# Install lsb-release so we can guess which Debian version are we operating on.
aptitude update && aptitude ${APTITUDE_ARGS} install lsb-release
DEBIAN_RELEASE=$(lsb_release -cs)

# Accept the Rudder repository key
# Accept the Rudder repository key
wget --quiet -O- "http://${KEYSERVER}/pks/lookup?op=get&search=0x${KEY}" | sudo apt-key add -

# Rudder repositories
Expand All @@ -65,7 +65,7 @@ aptitude update
#Packages required by Rudder
aptitude ${APTITUDE_ARGS} install rudder-agent

# Set the IP of the rudder master
# Set the IP of the rudder master
echo "192.168.42.10" > /var/rudder/cfengine-community/policy_server.dat

# Start the CFEngine agent
Expand Down
16 changes: 8 additions & 8 deletions provision/server.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -e
KEYSERVER=keyserver.ubuntu.com
KEY=474A19E8

# Rudder related parameters
# Rudder related parameters
SERVER_INSTANCE_HOST="server.rudder.local"
DEMOSAMPLE="no"
LDAPRESET="yes"
Expand All @@ -40,15 +40,15 @@ APTITUDE_ARGS="--assume-yes"
export DEBIAN_FRONTEND=noninteractive

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "server", with the FQDN "server.rudder.local".
# It has this IP : 192.168.42.10 (See the Vagrantfile)
# Host preparation:
# This machine is "server", with the FQDN "server.rudder.local".
# It has this IP : 192.168.42.10 (See the Vagrantfile)

sed -ri "s/^127\.0\.1\.1[\t ]+server(.*)$/127\.0\.1\.1\tserver\.rudder\.local\1/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+server[\t ]+(.*)$/127\.0\.0\.1\tserver\.rudder\.local \1/" /etc/hosts
echo -e "\n192.168.42.11 node1.rudder.local" >> /etc/hosts
echo -e "\n192.168.42.12 node2.rudder.local" >> /etc/hosts
echo -e "\n192.168.42.13 node3.rudder.local" >> /etc/hosts
Expand Down Expand Up @@ -89,7 +89,7 @@ do
fi
done

# Update APT cache
# Update APT cache
aptitude update

#Packages required by Rudder
Expand Down
14 changes: 7 additions & 7 deletions provision/server_centos6.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ set -e

YUM_ARGS="-y"

# Rudder related parameters
# Rudder related parameters
SERVER_INSTANCE_HOST="server.rudder.local"
DEMOSAMPLE="no"
LDAPRESET="yes"
INITPRORESET="yes"
ALLOWEDNETWORK[0]='192.168.42.0/24'

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "server", with the FQDN "server.rudder.local".
# It has this IP : 192.168.42.10 (See the Vagrantfile)
# Host preparation:
# This machine is "server", with the FQDN "server.rudder.local".
# It has this IP : 192.168.42.10 (See the Vagrantfile)

sed -ri "s/^127\.0\.0\.1[\t ]+server(.*)$/127\.0\.0\.1\tserver\.rudder\.local\1/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+server[\t ]+(.*)$/127\.0\.0\.1\tserver\.rudder\.local \1/" /etc/hosts
echo -e "\n192.168.42.11 node1.rudder.local" >> /etc/hosts
echo -e "\n192.168.42.12 node2.rudder.local" >> /etc/hosts
echo -e "\n192.168.42.13 node3.rudder.local" >> /etc/hosts
Expand Down
14 changes: 7 additions & 7 deletions provision/server_sles11.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ set -e

ZYPPER_ARGS="--non-interactive --no-gpg-checks"

# Rudder related parameters
# Rudder related parameters
SERVER_INSTANCE_HOST="server.rudder.local"
DEMOSAMPLE="no"
LDAPRESET="yes"
INITPRORESET="yes"
ALLOWEDNETWORK[0]='192.168.42.0/24'

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "server", with the FQDN "server.rudder.local".
# It has this IP : 192.168.42.10 (See the Vagrantfile)
# Host preparation:
# This machine is "server", with the FQDN "server.rudder.local".
# It has this IP : 192.168.42.10 (See the Vagrantfile)

sed -ri "s/^127\.0\.0\.1[\t ]+server(.*)$/127\.0\.0\.1\tserver\.rudder\.local\1/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+server[\t ]+(.*)$/127\.0\.0\.1\tserver\.rudder\.local \1/" /etc/hosts
echo -e "\n192.168.42.11 node1.rudder.local" >> /etc/hosts
echo -e "\n192.168.42.12 node2.rudder.local" >> /etc/hosts
echo -e "\n192.168.42.13 node3.rudder.local" >> /etc/hosts
Expand Down
16 changes: 8 additions & 8 deletions provision/server_ubuntu.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -e
KEYSERVER=keyserver.ubuntu.com
KEY=474A19E8

# Rudder related parameters
# Rudder related parameters
SERVER_INSTANCE_HOST="server.rudder.local"
DEMOSAMPLE="no"
LDAPRESET="yes"
Expand All @@ -37,15 +37,15 @@ APTITUDE_ARGS="--assume-yes"
export DEBIAN_FRONTEND=noninteractive

# Showtime
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Editing anything below might create a time paradox which would
# destroy the very fabric of our reality and maybe hurt kittens.
# Be responsible, please think of the kittens.

# Host preparation:
# This machine is "server", with the FQDN "server.rudder.local".
# It has this IP : 192.168.42.10 (See the Vagrantfile)
# Host preparation:
# This machine is "server", with the FQDN "server.rudder.local".
# It has this IP : 192.168.42.10 (See the Vagrantfile)

sed -ri "s/^127\.0\.1\.1[\t ]+server(.*)$/127\.0\.1\.1\tserver\.rudder\.local\1/" /etc/hosts
sed -ri "s/^127\.0\.0\.1[\t ]+server[\t ]+(.*)$/127\.0\.0\.1\tserver\.rudder\.local \1/" /etc/hosts
echo -e "\n192.168.42.11 node1.rudder.local" >> /etc/hosts
echo -e "\n192.168.42.12 node2.rudder.local" >> /etc/hosts
echo -e "\n192.168.42.13 node3.rudder.local" >> /etc/hosts
Expand Down Expand Up @@ -77,7 +77,7 @@ do
fi
done

# Update APT cache
# Update APT cache
aptitude update

#Packages required by Rudder
Expand Down