13 Commits

7 changed files with 101 additions and 73 deletions
+6
View File
@@ -14,9 +14,11 @@
lightdm: lightdm lightdm: lightdm
sddm: sddm sddm: sddm
tmux: tmux tmux: tmux
base_devel: htop # Placeholder for Arch package.
sendmail: msmtp sendmail: msmtp
sendmail_mta: msmtp-mta sendmail_mta: msmtp-mta
ca_certificates: ca-certificates ca_certificates: ca-certificates
locate: mlocate
- name: General | Facts | Package | Parrot OS Fixes - name: General | Facts | Package | Parrot OS Fixes
set_fact: set_fact:
@@ -44,6 +46,7 @@
cron: cronie cron: cronie
encfs: encfs encfs: encfs
dig: bind dig: bind
base_devel: base-devel
when: ansible_pkg_mgr == "pacman" when: ansible_pkg_mgr == "pacman"
- name: General | Facts | Package | FreeBSD - name: General | Facts | Package | FreeBSD
@@ -72,6 +75,8 @@
microcode_intel: microcode_ctl microcode_intel: microcode_ctl
cron: cronie cron: cronie
encfs: fuse-encfs encfs: fuse-encfs
dig: bind-utils
sendmail_mta: msmtp
when: ansible_pkg_mgr == "dnf" when: ansible_pkg_mgr == "dnf"
- name: General | Facts | Package | zypper - name: General | Facts | Package | zypper
@@ -82,6 +87,7 @@
microcode_intel: ucode-intel microcode_intel: ucode-intel
cron: cronie cron: cronie
encfs: encfs encfs: encfs
dig: bind-utils
when: ansible_pkg_mgr == "zypper" when: ansible_pkg_mgr == "zypper"
+1 -1
View File
@@ -21,7 +21,7 @@
set_fact: set_fact:
crond: cronie crond: cronie
crond_pattern: cronie crond_pattern: cronie
when: ansible_distribution in ("Archlinux") when: ansible_pkg_mgr == "pacman"
- name: General | Facts | Service | Fedora - name: General | Facts | Service | Fedora
set_fact: set_fact:
-2
View File
@@ -27,7 +27,6 @@
sassc: sassc sassc: sassc
ffmpeg: ffmpeg ffmpeg: ffmpeg
wireless_tools: wireless-tools wireless_tools: wireless-tools
base_devel: htop # Placeholder for Arch package.
macbook_wifi_driver: broadcom-sta-dkms macbook_wifi_driver: broadcom-sta-dkms
xz: xz xz: xz
mesa: mesa mesa: mesa
@@ -105,7 +104,6 @@
- name: Workstation | Facts | Package | pacman (All Distros) - name: Workstation | Facts | Package | pacman (All Distros)
set_fact: set_fact:
base_devel: base-devel
macbook_wifi_driver: broadcom-wl-dkms macbook_wifi_driver: broadcom-wl-dkms
android_jdk: jdk-openjdk android_jdk: jdk-openjdk
android_fastboot: android-tools android_fastboot: android-tools
+37 -22
View File
@@ -7,12 +7,23 @@ DIR="$(dirname -- "${BASH_SOURCE[0]}")"
PROG="$(basename -- "${BASH_SOURCE[0]}")" PROG="$(basename -- "${BASH_SOURCE[0]}")"
LOCAL=$DIR/local.yml LOCAL=$DIR/local.yml
URL="https://git.hyperling.com/me/env-ansible" URL="https://git.hyperling.com/me/env-ansible"
BRANCH="main" if [[ -z $BRANCH ]]; then
export BRANCH="main"
fi
LINUX_HOSTS_DIR=/etc/ansible
LINUX_HOSTS_FILE="$LINUX_HOSTS_DIR/hosts"
FREEBSD_HOSTS_DIR="/usr/local/etc/ansible"
FREEBSD_HOSTS_FILE="$FREEBSD_HOSTS_DIR/hosts"
HOSTS_DIR="$LINUX_HOSTS_DIR"
HOSTS_FILE="$LINUX_HOSTS_FILE"
config_dir="/usr/local/etc/hyperling-scm" config_dir="/usr/local/etc/hyperling-scm"
general_config="$config_dir/general.ini" general_config="$config_dir/general.ini"
workstation_config="$config_dir/workstation.ini" workstation_config="$config_dir/workstation.ini"
server_config="$config_dir/server.ini" server_config="$config_dir/server.ini"
branch=""
## Functions ## ## Functions ##
@@ -45,10 +56,10 @@ while getopts ":lb:gwsfh" arg; do
case $arg in case $arg in
l) local="Y" && echo "Running $LOCAL as the playbook." ;; l) local="Y" && echo "Running $LOCAL as the playbook." ;;
b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;; b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;;
g) create_general="Y" && echo "Requested '$general_config'." ;; g) create_general="Y" && echo "Generating test '$general_config'." ;;
w) create_workstation="Y" && echo "Requested '$workstation_config'." ;; w) create_workstation="Y" && echo "Generating test '$workstation_config'." ;;
s) create_server="Y" && echo "Requested '$server_config'." ;; s) create_server="Y" && echo "Generating test '$server_config'." ;;
f) show_facts="Y" ;; f) show_facts="Y" && echo "Displaying ansible facts then exiting." ;;
h) usage ;; h) usage ;;
*) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;; *) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;;
esac esac
@@ -60,9 +71,13 @@ if [[ ! -z $1 && $1 != "-"* ]]; then
usage 1 usage 1
fi fi
if [[ -z "$local" && "$branch" == "" ]]; then if [[ "$branch" == "" ]]; then
echo "Using default branch $BRANCH."
branch="$BRANCH" branch="$BRANCH"
if [[ -z "$local" ]]; then
echo "Running against default branch '$branch'."
else
echo "Set branch to '$branch'."
fi
fi fi
if [[ -n "$create_general" && -f "$general_config" ]]; then if [[ -n "$create_general" && -f "$general_config" ]]; then
@@ -92,41 +107,41 @@ if [[ `which ansible > /dev/null; echo $?` != 0 ]]; then
if [[ $os == *Debian* || $os == *Ubuntu* || $os == *"Pop!_OS"* || $os == *Mint* || $os == *Parrot* ]]; then if [[ $os == *Debian* || $os == *Ubuntu* || $os == *"Pop!_OS"* || $os == *Mint* || $os == *Parrot* ]]; then
sudo apt update sudo apt update
sudo apt install -y ansible git <<< N sudo apt install -y ansible git <<< N
sudo mkdir -p /etc/ansible
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
elif [[ $os == *FreeBSD* ]]; then elif [[ $os == *FreeBSD* ]]; then
sudo pkg install -y -g py*-ansible git sudo pkg install -y -g py*-ansible git
sudo mkdir -p /usr/local/etc/ansible HOSTS_DIR="$FREEBSD_HOSTS_DIR"
sudo sh -c 'echo "localhost ansible_connection=local" > /usr/local/etc/ansible/hosts' HOSTS_FILE="$FREEBSD_HOSTS_FILE"
elif [[ $os == *Arch* || $os == *Manjaro* || $os == *Artix* ]]; then elif [[ $os == *Arch* || $os == *Manjaro* || $os == *Artix* ]]; then
sudo pacman -Sy --noconfirm ansible git sudo pacman -Sy --noconfirm ansible git
sudo mkdir -p /etc/ansible
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
elif [[ $os == *Darwin* ]]; then elif [[ $os == *Darwin* ]]; then
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "TESTING - EXIT!"
exit 0
brew install ansible git brew install ansible git
HOSTS_DIR=""
HOSTS_FILE=""
elif [[ $os == *Fedora* ]]; then elif [[ $os == *Fedora* ]]; then
sudo dnf install -y ansible git python3-libselinux sudo dnf install -y ansible git python3-libselinux
sudo mkdir -p /etc/ansible
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
elif [[ $os == *openSUSE* ]]; then elif [[ $os == *openSUSE* ]]; then
sudo zypper install -y ansible git sudo zypper install -y ansible git
sudo mkdir -p /etc/ansible
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
elif [[ $os == *NixOS* ]]; then elif [[ $os == *NixOS* ]]; then
$DIR/files/scripts/nixos.sh -b $branch $DIR/files/scripts/nixos.sh -b $branch
sudo mkdir -p /etc/ansible
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
else else
echo -e "ERROR: OS not detected." echo -e "ERROR: OS not recognized."
echo -e "$os" echo -e "$os"
exit 1 exit 1
fi fi
fi fi
echo "Installed!" echo "Installed!"
if [[ -n $HOSTS_DIR && -n $HOSTS_FILE ]]; then
echo "Ensuring hosts file exists..."
if [[ ! -e $HOSTS_FILE ]]; then
sudo mkdir -pv $HOSTS_DIR
sudo sh -c "echo 'localhost ansible_connection=local' > $HOSTS_FILE"
fi
echo "$HOSTS_FILE: '`cat $HOSTS_FILE`'"
echo "Hosts file created successfully!"
fi
if [[ "$show_facts" == "Y" ]]; then if [[ "$show_facts" == "Y" ]]; then
echo "Showing Ansible Facts" echo "Showing Ansible Facts"
ansible localhost -m setup --connection=local ansible localhost -m setup --connection=local
+14 -5
View File
@@ -16,12 +16,12 @@
backup: yes backup: yes
create: no create: no
state: present state: present
when: ansible_distribution == "Archlinux" when: ansible_pkg_mgr == "pacman"
#- name: General | Account Management | Users | Use ZSH (Arch+Manjaro) #- name: General | Account Management | Users | Use ZSH (Arch+Manjaro)
# set_fact: # set_fact:
# user_shell: "{{ zsh_exec.stdout }}" # user_shell: "{{ zsh_exec.stdout }}"
# when: ansible_distribution == "Archlinux" # when: ansible_pkg_mgr == "pacman"
# #
#- name: General | Account Management | Users | Allow ZSH (Arch) #- name: General | Account Management | Users | Allow ZSH (Arch)
# lineinfile: # lineinfile:
@@ -32,7 +32,7 @@
# backup: yes # backup: yes
# create: no # create: no
# state: present # state: present
# when: ansible_distribution == "Archlinux" # when: ansible_pkg_mgr == "pacman"
## Root ## ## Root ##
@@ -128,8 +128,17 @@
export_path_sbin: export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" export_path_sbin: export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
#export_terminal: export TERMINAL="alacritty" # colors look weird. #export_terminal: export TERMINAL="alacritty" # colors look weird.
export_terminal: export TERMINAL="kitty" export_terminal: export TERMINAL="kitty"
export_browser: export BROWSER="`which firefox || which firefox-esr || which firefox-flatpak`" export_browser: |
keyboard_settings: setxkbmap -layout us -variant altgr-intl function find-firefox {
which firefox 2>/dev/null ||
which firefox-esr 2>/dev/null ||
which firefox-flatpak 2>/dev/null
}
export BROWSER="`find-firefox`"
keyboard_settings: |
if [[ -n "$XDG_SESSION_ID" ]]; then
setxkbmap -layout us -variant altgr-intl
fi
- name: General | Account Management | Users | Files | RC Variables - name: General | Account Management | Users | Files | RC Variables
set_fact: set_fact:
+2 -1
View File
@@ -61,6 +61,7 @@
- "{{ ntp_server }}" - "{{ ntp_server }}"
- "{{ dig }}" - "{{ dig }}"
- "{{ tmux }}" - "{{ tmux }}"
- "{{ base_devel }}"
- "{{ sendmail }}" - "{{ sendmail }}"
- "{{ sendmail_mta }}" - "{{ sendmail_mta }}"
- "{{ ca_certificates }}" - "{{ ca_certificates }}"
@@ -107,7 +108,7 @@
- which - which
- "{{ cron }}" - "{{ cron }}"
state: present state: present
when: ansible_distribution == "Archlinux" when: ansible_pkg_mgr == "pacman"
- name: General | Software | Packages | Install Fix (Looking at you, openSUSE) - name: General | Software | Packages | Install Fix (Looking at you, openSUSE)
package: package:
@@ -38,7 +38,6 @@
- "{{ appimagelauncher }}" - "{{ appimagelauncher }}"
- gparted - gparted
- hugo - hugo
- "{{ base_devel }}"
- "{{ firefox }}" - "{{ firefox }}"
- "{{ firefox_esr }}" - "{{ firefox_esr }}"
- "{{ wireless_tools }}" - "{{ wireless_tools }}"