Skip to content

Commit

Permalink
Fixes #15685: Use rudder-setup dev mode in rudder-test to install a d…
Browse files Browse the repository at this point in the history
…evelopment server
  • Loading branch information
peckpeck authored and Jenkins CI committed Sep 17, 2019
1 parent b8039f7 commit a52c263
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
29 changes: 0 additions & 29 deletions scripts/dev.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,9 @@
#!/bin/sh

sed -i "s/^IP=.*$/IP=*/" /opt/rudder/etc/rudder-slapd.conf
sed -i "s/^#IP=.*$/IP=*/" /etc/default/rudder-slapd

PG_HBA_FILE=$(su - postgres -c "psql -t -P format=unaligned -c 'show hba_file';")
if [ $? -ne 0 ]; then
echo "Postgresql failed to start! Halting"
exit 1
fi

PG_CONF_FILE=$(su - postgres -c "psql -t -P format=unaligned -c 'show config_file';")
if [ $? -ne 0 ]; then
echo "Postgresql failed to start! Halting"
exit 1
fi

echo "listen_addresses = '*'" >> ${PG_CONF_FILE}
echo "host all all 192.168.42.0/24 trust" >> ${PG_HBA_FILE}
echo "host all all 10.0.0.0/16 trust" >> ${PG_HBA_FILE}
/etc/init.d/postgresql restart


if [ -e /opt/rudder/etc/rudder-passwords.conf ] ; then
sed -i "s/\(RUDDER_WEBDAV_PASSWORD:\).*/\1rudder/" /opt/rudder/etc/rudder-passwords.conf
sed -i "s/\(RUDDER_PSQL_PASSWORD:\).*/\1Normation/" /opt/rudder/etc/rudder-passwords.conf
sed -i "s/\(RUDDER_OPENLDAP_BIND_PASSWORD:\).*/\1secret/" /opt/rudder/etc/rudder-passwords.conf
fi

rudder agent run
if [ -d /opt/rudder/jetty7 ]; then
cp -a /vagrant/dev/fake-rudder.war /opt/rudder/jetty7/webapps/rudder.war
else
cp -a /vagrant/dev/fake-rudder.war /opt/rudder/share/webapps/rudder.war
fi


service rudder-jetty restart
4 changes: 3 additions & 1 deletion vagrant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
$debian7 = "normation/debian-7-64"
$debian8 = "normation/debian-8-64"
$debian9 = "normation/debian-9-64"
$debian10 = "normation/debian-10-64"

$ubuntu10_04 = "bento/ubuntu-10.04"
$ubuntu12_04 = "normation/ubuntu-12.04"
Expand Down Expand Up @@ -165,6 +166,7 @@ def provisioning_script(os, host_name, net, first_ip,
if setup == "dev-server"
setup = "server"
dev = true
dev_var="DEV_MODE=true"
end

sync_file_prefix = "/vagrant"
Expand Down Expand Up @@ -200,7 +202,7 @@ def provisioning_script(os, host_name, net, first_ip,
end
if provision == true then
if setup != "empty" and setup != "ncf" then
command += "#{proxy} ALLOWEDNETWORK=#{net}.0/24 UNSUPPORTED=#{ENV['UNSUPPORTED']} REPO_PREFIX=rtf/ /usr/local/bin/rudder-setup setup-#{setup} \"#{version}\" \"#{server}\"\n"
command += "#{proxy} #{dev_var} ALLOWEDNETWORK=#{net}.0/24 UNSUPPORTED=#{ENV['UNSUPPORTED']} REPO_PREFIX=rtf/ /usr/local/bin/rudder-setup setup-#{setup} \"#{version}\" \"#{server}\"\n"
end
if setup == "ncf" then
command += "#{proxy} /usr/local/bin/ncf-setup setup-local \"#{ncf_version}\" \"#{cfengine_version}\"\n"
Expand Down

0 comments on commit a52c263

Please sign in to comment.