Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
b08x committed Jan 2, 2024
2 parents dc20885 + c747241 commit d0b4b98
Show file tree
Hide file tree
Showing 240 changed files with 4,328 additions and 1,680 deletions.
17 changes: 17 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Gemfile

source 'https://rubygems.org'

gem 'debug', '1.8.0'
gem 'google-protobuf', '3.25.0'
gem 'io-console', '0.6.0'
gem 'irb', '1.8.3'
gem 'pry'
gem 'pry-doc'
gem 'psych', '5.1.1.1'
gem 'rake'
gem 'rdoc', '6.5.0'
gem 'reline', '0.3.9'
gem 'sorbet-runtime', '0.5.11116'
gem 'stringio', '3.0.8'
gem 'tty-progressbar'
69 changes: 69 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
GEM
remote: https://rubygems.org/
specs:
coderay (1.1.3)
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
google-protobuf (3.25.0)
google-protobuf (3.25.0-aarch64-linux)
google-protobuf (3.25.0-arm64-darwin)
google-protobuf (3.25.0-x86-linux)
google-protobuf (3.25.0-x86_64-darwin)
google-protobuf (3.25.0-x86_64-linux)
io-console (0.6.0)
irb (1.8.3)
rdoc
reline (>= 0.3.8)
method_source (1.0.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-doc (1.4.0)
pry (~> 0.11)
yard (~> 0.9.11)
psych (5.1.1.1)
stringio
rake (13.1.0)
rdoc (6.5.0)
psych (>= 4.0.0)
reline (0.3.9)
io-console (~> 0.5)
sorbet-runtime (0.5.11116)
stringio (3.0.8)
strings-ansi (0.2.0)
tty-cursor (0.7.1)
tty-progressbar (0.18.2)
strings-ansi (~> 0.2)
tty-cursor (~> 0.7)
tty-screen (~> 0.8)
unicode-display_width (>= 1.6, < 3.0)
tty-screen (0.8.2)
unicode-display_width (2.5.0)
yard (0.9.34)

PLATFORMS
aarch64-linux
arm64-darwin
ruby
x86-linux
x86_64-darwin
x86_64-linux

DEPENDENCIES
debug (= 1.8.0)
google-protobuf (= 3.25.0)
io-console (= 0.6.0)
irb (= 1.8.3)
pry
pry-doc
psych (= 5.1.1.1)
rake
rdoc (= 6.5.0)
reline (= 0.3.9)
sorbet-runtime (= 0.5.11116)
stringio (= 3.0.8)
tty-progressbar

BUNDLED WITH
2.5.3
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# syncopated
# syncopatedIaC

An exercise in configuration management. Intended to serve as an IaC framework for a small lab or studio.

Based on Ansible, the repository contains roles, playbooks, and modules to help configure and manage Linux hosts that are part of an audio production workflow.
The repository contains Ansible roles, playbooks, and modules to help configure and manage Linux hosts that are part of an audio production workflow.

## directory index
## Directory Index

| Path | Content | |
| :------------------------ | :------------------------------------------ | --- |
Expand Down Expand Up @@ -38,11 +38,11 @@ variables for individual hosts

### vars

{{ distro }}/packages.yml - package lists
vars/{{ distro }}/packages.yml - package lists

theme.yml - theme variables
var/stheme.yml - theme variables

### role variables
### Role Variables

#### defaults/main.yml

Expand All @@ -60,6 +60,13 @@ theme.yml - theme variables

- Role variables allow users to customize the role without modifying the role's default behavior.

### Using Tags

```bash
ansible-playbook -i inventory.ini playbooks/full.yml --tags $TAGS --limit $HOSTNAME
```


# demo

[![asciicast](https://asciinema.org/a/622463.svg)](https://asciinema.org/a/622463)
Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ connect_timeout = 30
highlight = bright green
debug = dark gray
ok = blue
changed = normal
changed = bright yellow

[diff]
always = True
Expand Down
208 changes: 154 additions & 54 deletions bin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,58 +56,89 @@ cup 1

wipe="false"

DISTRO=$(lsb_release -si)

case $DISTRO in
Arch|ArchLabs|cachyos|EndeavourOS)
pacman -Syu --noconfirm --downloadonly --quiet
pacman -S --noconfirm openssh base-devel rsync openssh python-pip \
firewalld python-setuptools rustup fd rubygems yadm jack2 jack2-dbus \
pulseaudio pulseaudio-jack pulseaudio-alsa net-tools htop gum most ranger \
nodejs npm yadm --overwrite '*'
;;
Fedora|AlmaLinux)
echo '[charm]
name=Charm
baseurl=https://repo.charm.sh/yum/
enabled=1
gpgcheck=1
gpgkey=https://repo.charm.sh/yum/gpg.key' | tee /etc/yum.repos.d/charm.repo
dnf -y install gum
;;
Debian|Raspbian|MX)
mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | tee /etc/apt/sources.list.d/charm.list
apt-get update --quiet
apt-get install -y openssh-server build-essential fd-find ruby-rubygems ruby-bundler ruby-dev gum yadm
;;
*)
echo "Unsupported distribution."
exit 1
esac

# and so it begins...
wipe && say "hello!\n" $GREEN && sleep 0.5

say "-----------------------------------------------" $BLUE
say "installing ssh, fd, ruby along with" $BLUE
say "gcc, g++, make, and other essential build tools" $BLUE
say "ssh will also be enabled and started." $BLUE
say "-----------------------------------------------\n" $BLUE

BOOTSTRAP_PKGS=(
'ansible'
'aria2'
'base-devel'
'bat'
'bc'
'cargo'
'ccache'
'cmake'
'dialog'
'fd'
'git'
'git-lfs'
'gum'
'htop'
# 'jack2'
# 'jack2-dbus'
'lnav'
'most'
'neovim'
'net-tools'
'nodejs'
'npm'
'openssh'
# 'pulseaudio'
# 'pulseaudio-alsa'
# 'pulseaudio-jack'
'python-pip'
'python-setuptools'
'ranger'
'rsync'
'rubygems'
'rustup'
'unzip'
'wget'
'yadm'
'zsh'
)


pacman -Syu --noconfirm --downloadonly --quiet

pacman -S --noconfirm --needed "${BOOTSTRAP_PKGS[@]}" --overwrite '*'
# say "-----------------------------------------------" $BLUE
# say "installing ssh, fd, ruby along with" $BLUE
# say "gcc, g++, make, and other essential build tools" $BLUE
# say "ssh will also be enabled and started." $BLUE
# say "-----------------------------------------------\n" $BLUE

# BOOTSTRAP_PKGS=(
# 'ansible'
# 'aria2'
# 'base-devel'
# 'bat'
# 'bc'
# 'cargo'
# 'ccache'
# 'cmake'
# 'dialog'
# 'fd'
# 'git'
# 'git-lfs'
# 'gum'
# 'htop'
# # 'jack2'
# # 'jack2-dbus'
# 'lnav'
# 'most'
# 'neovim'
# 'net-tools'
# 'nodejs'
# 'npm'
# 'openssh'
# # 'pulseaudio'
# # 'pulseaudio-alsa'
# # 'pulseaudio-jack'
# 'python-pip'
# 'python-setuptools'
# 'ranger'
# 'rsync'
# 'rubygems'
# 'rustup'
# 'unzip'
# 'wget'
# 'yadm'
# 'zsh'
# )


# pacman -Syu --noconfirm --downloadonly --quiet
#
# pacman -S --noconfirm --needed "${BOOTSTRAP_PKGS[@]}" --overwrite '*'

systemctl enable sshd
systemctl start sshd
Expand Down Expand Up @@ -212,14 +243,83 @@ say "set defaults to deny inbound and allow outbound" $BLUE
say "add rule to allow ssh traffic" $BLUE
say "-----------------------------------------------\n" $BLUE

pacman -S --noconfirm firewalld
# Set firewall rules
case $DISTRO in
Debian|Raspbian|MX)
apt-get install -y ufw
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw enable
;;
Arch|ArchLabs|Manjaro)
pacman -S --noconfirm firewalld
systemctl enable firewalld
systemctl start firewalld
firewall-cmd --zone=public --add-service=ssh --permanent
firewall-cmd --reload
;;
*)
echo "Unsupported distribution: $DISTRO"
exit 1
;;
esac

systemctl enable firewalld && systemctl start firewalld
wipe && sleep 1

firewall-cmd --zone=public --add-service=ssh --permanent
firewall-cmd --reload
if [[ $wipe == 'true' ]]; then wipe && sleep 1; fi
say "\n-----------------------------------------------" $BLUE
say "check for ansible installations..." $BLUE
say "if installed with a system package," $BLUE
say "remove the system package and install with pip" $BLUE
say "as of date, pip will install ansible 2.14.5" $BLUE
say "-----------------------------------------------\n" $BLUE

wipe && sleep 1
case $DISTRO in
Debian|Raspbian|MX)
if [ -x $(apt list --installed | grep ansible) ]; then
apt-get remove -y ansible --quiet
fi
;;
Arch|ArchLabs|Manjaro)
if [ -x $(pacman -Q | grep ansible) ]; then
echo "ansible package not found"
else
echo "ansible package found...removing"
pacman -Rdd ansible --noconfirm
fi
;;
*)
echo "Unsupported distribution: $DISTRO"
exit 1
;;
esac

if [[ $wipe == 'true' ]]; then wipe && sleep 1; fi
say "\n-----------------------------------------------" $BLUE
say "installing pip" $BLUE && sleep 0.5
say "-----------------------------------------------\n" $BLUE

case $DISTRO in
Debian|Raspbian|MX)
apt-get update --quiet
apt-get install -y python3-pip && \
pip install ansible
;;
Arch|ArchLabs|Manjaro)
if [[ -x $(pacman -Q | grep python-pip) ]]; then
echo "pip not installed"
pacman -S --noconfirm python-pip && \
pip install ansible --break-system-packages
else
echo "pip installed"
fi
;;
*)
echo "Unsupported distribution: $DISTRO"
exit 1
;;
esac

echo -e "Finished, $(gum style --foreground 212 "...")."

Expand Down
Loading

0 comments on commit d0b4b98

Please sign in to comment.