From 91c6dcf872fc2990391b41e63920d9c17d02c538 Mon Sep 17 00:00:00 2001 From: olli Date: Mon, 21 Aug 2023 16:04:03 +0200 Subject: [PATCH] =?UTF-8?q?install.sh=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..4ce15e0 --- /dev/null +++ b/install.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e + +# on fresh install remove cdrom-repo and install sudo if not available +which sudo >/dev/null 2>&1 || su -c "sed -i '/cdrom/d' /etc/apt/sources.list ; apt update ; apt -y install sudo" +id | grep -q '(sudo)' || su -c "/usr/sbin/usermod -a -G sudo ${USER}" + + +sudo apt-get -y install ansible git +sudo ansible-galaxy collection install community.general +#sudo apt-get -y install python3-pip git +#sudo pip install ansible + +cd +rm -rf $(hostname -s)-git +mkdir $(hostname -s)-git +cd $(hostname -s)-git + +for playbook in \ + debian.ansible.basics \ + debian.ansible.runchecks \ + debian.ansible.autoupdate \ + debian.ansible.dedyn.client +do + git clone https://gitea.ds9.dedyn.io/olli/${playbook}.git + sudo ansible-playbook --connection=local --inventory $(hostname), --limit $(hostname) ${playbook}/*.yml +done \ No newline at end of file