From da871ddb681e43a8c2a05aab4b01f219b0b24e72 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 19 Jan 2022 15:18:13 -0800 Subject: [PATCH] + Setting up new playbook for a lab server --- .gitignore | 4 +++ docker-host/readme | 16 +++++++++ docker-host/setup/tasks/install-docker.yml | 39 ++++++++++++++++++++++ docker-host/setup/tasks/main.yml | 6 ++++ docker-host/setup/tasks/system-update.yml | 10 ++++++ reset-polybar-i3 | 10 ++++++ 6 files changed, 85 insertions(+) create mode 100644 docker-host/readme create mode 100644 docker-host/setup/tasks/install-docker.yml create mode 100644 docker-host/setup/tasks/main.yml create mode 100644 docker-host/setup/tasks/system-update.yml create mode 100755 reset-polybar-i3 diff --git a/.gitignore b/.gitignore index 2f323b9..7405318 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ locs.conf msg # Cursor files I use for the memes cursors/ +# Playbook stuff for da lab +docker-host/ssh/ +docker-host/inventory.ini + diff --git a/docker-host/readme b/docker-host/readme new file mode 100644 index 0000000..d519a1b --- /dev/null +++ b/docker-host/readme @@ -0,0 +1,16 @@ +What this directory contains +============================ + +This includes playbooks and scripts used to setup a local lab server as a +docker host which you can use to basically do whatever. + +What I use on my own lab server +=============================== + +> Ubuntu 21.10 + +> Docker for hosting various local services more easily + +> Local DNS + +> diff --git a/docker-host/setup/tasks/install-docker.yml b/docker-host/setup/tasks/install-docker.yml new file mode 100644 index 0000000..c8e8f67 --- /dev/null +++ b/docker-host/setup/tasks/install-docker.yml @@ -0,0 +1,39 @@ +--- +- hosts: leftcoastlab + become: yes + tasks: + - name: Install docker dependencies + apt: + name: "{{item}}" + update_cache: yes + loop: + - apt-transport-https + - ca-certificates + - curl + - gnupg + - software-properties-common + - lsb-release + + - name: Install docker GPG key + apt_key: + url: https://download.docker.com/linux/ubuntu/gpg + state: present + + - name: Add Docker Apt Repo + apt_repository: + repo: deb https://download.docker.com/linux/ubuntu impish stable + state: present + + - name: Install Docker components + apt: + name: "{{item}}" + update_cache: yes + loop: + - docker-ce + - docker-ce-cli + - containerd.io + + + + + diff --git a/docker-host/setup/tasks/main.yml b/docker-host/setup/tasks/main.yml new file mode 100644 index 0000000..ae6ec73 --- /dev/null +++ b/docker-host/setup/tasks/main.yml @@ -0,0 +1,6 @@ +# +--- +- hosts: leftcoastlab + tasks: + - name: Say hi + command: echo hi diff --git a/docker-host/setup/tasks/system-update.yml b/docker-host/setup/tasks/system-update.yml new file mode 100644 index 0000000..f15142b --- /dev/null +++ b/docker-host/setup/tasks/system-update.yml @@ -0,0 +1,10 @@ +# Simply update all required packages that we have on the system +# This also takes care of updating any packages that must updated through means +# of Git or some other non-apt method should it be required +--- +- hosts: leftcoastlab + become: yes + tasks: + - name: Distribution Upgrade + apt: + upgrade: dist diff --git a/reset-polybar-i3 b/reset-polybar-i3 new file mode 100755 index 0000000..c2125aa --- /dev/null +++ b/reset-polybar-i3 @@ -0,0 +1,10 @@ +#!/bin/sh + +# Make sure we don't start up two instances at once +pbar_id=`pgrep polybar` +if [ ! -z $pbar_id ];then + kill `pgrep $pbar_id` +fi + +# Start up polybar now that none are running +polybar cute