From ba4a5fac73a8429524bd77c51f8878c539823816 Mon Sep 17 00:00:00 2001 From: Marc Ahlgrim Date: Wed, 31 Aug 2022 19:59:19 +0200 Subject: [PATCH] added code-server Signed-off-by: Marc Ahlgrim --- install_ansible_rundeck.sh | 71 ++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 7 deletions(-) diff --git a/install_ansible_rundeck.sh b/install_ansible_rundeck.sh index b8f148d..8804b4d 100644 --- a/install_ansible_rundeck.sh +++ b/install_ansible_rundeck.sh @@ -4,21 +4,39 @@ # vanilla debian 11 # RUN AS ROOT! +# you might wan to change this +# sets all passwords of users and the vscode server to "onemarcfifty" + +USERPASSWORD=onemarcfifty + + +# first we install some software + apt update apt -y upgrade apt install -y python3 pip sudo wget curl + +# now let's add the rundeck user + useradd -m -G sudo -s /bin/bash rundeck -# passwd rundeck +echo "rundeck:$USERPASSWORD" | chpasswd + +# install ansible through pip + pip install ansible +# download the rundeck installation script and run it directly +# then install rundeck + curl https://raw.githubusercontent.com/rundeck/packaging/main/scripts/deb-setup.sh 2> /dev/null | sudo bash -s rundeck apt update apt -y install rundeck + +# replace the localhost entries in the config files with the hostname + sed -i s/localhost/`hostname`/g /etc/rundeck/framework.properties sed -i s/localhost/`hostname`/g /etc/rundeck/rundeck-config.properties -# optional: move to mariadb - # install mariadb apt install -y mariadb-server # create rundeck db @@ -27,15 +45,54 @@ mysql -u root -e 'create database rundeck' RANDOMPASSWORD=`date +%s | sha256sum | base64 | head -c 32` mysql -u root -e "create user rundeck@localhost identified by '$RANDOMPASSWORD'" mysql -u root -e 'grant ALL on rundeck.* to rundeck@localhost' + # update the rundeck config +# comment out the original data source + sed -i s/^dataSource.url/\#dataSource.url/g /etc/rundeck/rundeck-config.properties -echo 'dataSource.driverClassName = org.mariadb.jdbc.Driver'>>/etc/rundeck/rundeck-config.properties -echo 'dataSource.url = jdbc:mysql://localhost/rundeck?autoReconnect=true&useSSL=false' >>/etc/rundeck/rundeck-config.properties -echo 'dataSource.username = rundeck' >>/etc/rundeck/rundeck-config.properties -echo "dataSource.password = $RANDOMPASSWORD" >>/etc/rundeck/rundeck-config.properties + +# point the datasource to the new local mariadb installation + +(cat >> /etc/rundeck/rundeck-config.properties) </etc/systemd/system/code-server.service) <