#!/bin/bash # this script installs ansible and rundeck on a # 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 SERVERURL=rundeck2.lan # first we install some software apt update apt -y upgrade apt install -y python3 pip sudo wget curl git nmap # now let's add the rundeck user useradd -m -G sudo -s /bin/bash rundeck echo "rundeck:$USERPASSWORD" | chpasswd # Quick fix: allow sudo to the rundeck user without password # (needs review) echo "rundeck ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/rundeck # install ansible through pip pip install ansible pip install zabbix-api # 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/$SERVERURL=rundeck2.lan/g /etc/rundeck/framework.properties sed -i s/localhost/$SERVERURL=rundeck2.lan/g /etc/rundeck/rundeck-config.properties # install mariadb apt install -y mariadb-server # create rundeck db mysql -u root -e 'create database rundeck' # create user, random pass and grant access 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 # point the datasource to the new local mariadb installation (cat >> /etc/rundeck/rundeck-config.properties) </etc/systemd/system/code-server.service) <