gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-grid5k] 24/141: add resolv.conf


From: gnunet
Subject: [taler-grid5k] 24/141: add resolv.conf
Date: Thu, 18 Nov 2021 14:49:25 +0100

This is an automated email from the git hooks/post-receive script.

marco-boss pushed a commit to branch master
in repository grid5k.

commit a2b01f7c953b8b7b38ef71dcda7217693025569d
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Thu Oct 7 15:14:45 2021 +0200

    add resolv.conf
---
 configs/etc/resolv.conf        |  2 ++
 experiment/scripts/database.sh | 19 +++++++++++++++----
 experiment/scripts/exchange.sh | 14 ++------------
 experiment/setup.sh            | 21 +++++++++++++++------
 experiment/taler-perf.rspec    |  4 ++--
 5 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/configs/etc/resolv.conf b/configs/etc/resolv.conf
new file mode 100644
index 0000000..f716a38
--- /dev/null
+++ b/configs/etc/resolv.conf
@@ -0,0 +1,2 @@
+search perf.taler.
+nameserver <NAMESERVER_IP_HERE>
diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh
index 3bc5a74..8cc6b4f 100755
--- a/experiment/scripts/database.sh
+++ b/experiment/scripts/database.sh
@@ -1,6 +1,9 @@
 #!/bin/bash
 set -eux
 
+sed -i "s\<DB_URL_HERE>\postgresql:///${DB_NAME}\g" \
+       /etc/taler/secrets/exchange-db.secret.conf
+
 echo "listen_addresses='*'" >> /etc/postgresql/13/main/postgresql.conf
 echo "host all all 172.16.0.0/16 md5" >> /etc/postgresql/13/main/pg_hba.conf
 
@@ -8,13 +11,21 @@ systemctl start postgresql
 
 su postgres << EOF
 createuser taler-exchange-httpd
-createuser taler-exchange-wire
-createuser taler-exchange-aggregator
-createuser taler-exchange-closer
 createdb -O taler-exchange-httpd ${DB_NAME}
 psql
 create user "${DB_USER}" with encrypted password '${DB_PASSWORD}';
-grant all privileges on database "${DB_NAME}" to "${DB_USER}";
+EOF
+
+sudo -u taler-exchange-httpd taler-exchange-dbinit
+
+su taler-exchange-httpd -s /bin/bash << EOF
+psql
+GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA public TO "${DB_USER}";
+GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA public TO "${DB_USER}";
+GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA public TO "${DB_USER}";
+GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO "${DB_USER}";
+GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO "${DB_USER}";
+GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO "${DB_USER}";
 EOF
 
 exit 0
diff --git a/experiment/scripts/exchange.sh b/experiment/scripts/exchange.sh
index 7518a44..0fe5e52 100755
--- a/experiment/scripts/exchange.sh
+++ b/experiment/scripts/exchange.sh
@@ -27,20 +27,10 @@ until PGPASSWORD="${DB_PASSWORD}" psql \
       -c '\q';
 do
   echo "Database not ready yet"
-  sleep 5
+  sleep 1
 done
 
-sudo -u taler-exchange-httpd taler-exchange-dbinit
-
-su taler-exchange-httpd -s /bin/bash << EOF
-PGPASSWORD=${DB_PASSWORD} psql -h ${DATABASE_DOMAIN} -U ${DB_USER} -d 
${DB_NAME}
-GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA public TO 
"taler-exchange-aggregator";
-GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA public TO 
"taler-exchange-closer";
-GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA public TO 
"taler-exchange-wire";
-GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO "taler-exchange-aggregator";
-GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO "taler-exchange-closer";
-GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO "taler-exchange-wire";
-EOF
+sleep 1
 
 systemctl start taler-exchange.target nginx
 
diff --git a/experiment/setup.sh b/experiment/setup.sh
index 798af18..781aaa3 100755
--- a/experiment/setup.sh
+++ b/experiment/setup.sh
@@ -1,5 +1,4 @@
 #!/bin/bash
-# Script run when a machine boots
 set -euax
 
 # Load the environment configuration
@@ -16,7 +15,8 @@ BANK_DOMAIN=bank.${DNS_ZONE}
 
 NS_IP=$(host ${DNS_HOST} | sed -n 1p | awk '{print $4}')
 
-# Set a dynamic domain name in our own dns - excepts the domain to be passed
+# Set a dynamic domain name in our own dns
+# argument: the domain to be added
 function set_ddn() {
   nsupdate -k /root/ddns.key -v << EOF
 server ${NS_IP}
@@ -26,6 +26,18 @@ send
 EOF
 }
 
+# Delete all old dns entries of the experitment
+while IFS='=' read -r name value; do
+  if [[ $name == *"_DOMAIN" && $value == *".${DNS_ZONE}" ]]; then 
+    nsupdate -k /root/ddns.key -v << EOF
+server ${NS_IP}
+zone ${DNS_ZONE}
+update delete ${value} A
+send
+EOF
+  fi
+done < <(env)
+
 # Temporarily checkout to the feature branch
 cd "${G5K_HOME}" && git checkout node-setup && git pull && cd
 
@@ -46,10 +58,7 @@ key "ddns-key.perf.taler" {
 };
 EOF
   
-  if ! grep -Fxq "nameserver ${NS_IP}" /etc/resolv.conf ; then
-    sed -i "3i\\
-nameserver ${NS_IP}" /etc/resolv.conf
-  fi
+  sed -i "s/<NAMESERVER_IP_HERE>/${NS_IP}/g" /etc/resolv.conf
 
   # wait for the dns to be initialized before continuing
   sleep 5
diff --git a/experiment/taler-perf.rspec b/experiment/taler-perf.rspec
index 0efc614..cb7ff57 100644
--- a/experiment/taler-perf.rspec
+++ b/experiment/taler-perf.rspec
@@ -1,5 +1,5 @@
 <?xml version='1.0'?>
-<rspec xmlns="http://www.geni.net/resources/rspec/3"; type="request" 
generated_by="jFed RSpec Editor" generated="2021-10-06T17:00:08.895+02:00" 
xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"; 
xmlns:delay="http://www.protogeni.net/resources/rspec/ext/delay/1"; 
xmlns:jfed-command="http://jfed.iminds.be/rspec/ext/jfed-command/1"; 
xmlns:client="http://www.protogeni.net/resources/rspec/ext/client/1"; 
xmlns:jfed-ssh-keys="http://jfed.iminds.be/rspec/ext/jfed-ssh-keys/1"; xmlns: 
[...]
+<rspec xmlns="http://www.geni.net/resources/rspec/3"; type="request" 
generated_by="jFed RSpec Editor" generated="2021-10-07T12:10:47.404+02:00" 
xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"; 
xmlns:delay="http://www.protogeni.net/resources/rspec/ext/delay/1"; 
xmlns:jfed-command="http://jfed.iminds.be/rspec/ext/jfed-command/1"; 
xmlns:client="http://www.protogeni.net/resources/rspec/ext/client/1"; 
xmlns:jfed-ssh-keys="http://jfed.iminds.be/rspec/ext/jfed-ssh-keys/1"; xmlns: 
[...]
   <node client_id="DB" exclusive="true" 
component_manager_id="urn:publicid:IDN+am.grid5000.fr+authority+am">
     <sliver_type name="raw-pc">
       <disk_image 
name="http://public.lyon.grid5000.fr/~bfhch01/taler-debian11.dsc"/>
@@ -18,7 +18,7 @@
     <sliver_type name="raw-pc">
       <disk_image 
name="http://public.lyon.grid5000.fr/~bfhch01/taler-debian11.dsc"/>
     </sliver_type>
-    <hardware_type name="econome-nantes"/>
+    <hardware_type name="uvb-sophia"/>
     <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1"; x="607.5" 
y="347.5"/>
   </node>
   <node client_id="Bank" exclusive="true" 
component_manager_id="urn:publicid:IDN+am.grid5000.fr+authority+am">

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]