adding Debian stoof

This commit is contained in:
2024-09-14 08:28:41 -07:00
parent 25738d899a
commit a268a34877
10 changed files with 258 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
- name: Restart NetworkManager
service:
name: NetworkManager
state: restarted

View File

@@ -0,0 +1,55 @@
---
- name: Create groups
group:
name: "{{ item }}"
state: present
loop: "{{ init_groups }}"
- name: Ensure Users are Configured Correctly
user:
name: "{{ item.value.name }}"
group: "{{ item.value.group }}"
groups: "{{ item.value.groups }}"
state: "{{ item.value.state }}"
create_home: "{{ item.value.create_home }}"
shell: "{{ item.value.shell }}"
loop: "{{ init_users | dict2items }}"
- name: Create or ensure presence of custom home directories
file:
path: /home/opal/{{ item }}
state: directory
mode: '0755'
owner: opal
group: opal
loop: "{{ create_directories }}"
- name: Remove default home directories if present
file:
path: /home/opal/{{ item }}
state: absent
loop: "{{ remove_directories }}"
# SSH Initial Setup
- name: Create/Ensure ~/.ssh directories
file:
path: "/home/{{ item.value.name }}/.ssh"
state: directory
mode: 0700
owner: "{{ item.value.name }}"
group: "{{ item.value.group }}"
loop: "{{ init_users | dict2items }}"
- name: Ensure systemd-timesyncd is enabled
systemd:
name: systemd-timesyncd
enabled: yes
- name: Ensure systemd-timesyncd is started
systemd:
name: systemd-timesyncd
state: started
- name: Set RTC to UTC
command:
cmd: timedatectl set-local-rtc 0

View File

@@ -0,0 +1,6 @@
# MANAGED BY ANSIBLE #
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=true

View File

@@ -0,0 +1,4 @@
# This file is managed by Ansible #
nameserver 1.1.1.2
nameserver 1.0.0.2
nameserver 2606:4700:4700:0:0:0:0:1112

33
roles/debian_base/vars/main.yml Executable file
View File

@@ -0,0 +1,33 @@
---
init_groups:
- wheel
remove_directories:
- Templates
- Videos
- Documents
- Music
- Downloads
- Pictures
- Public
- Desktop
create_directories:
- documents
- music
- downloads
- pictures
- scripts
- projects
- src
- .config
init_users:
opal:
name: opal
group: opal
groups:
- wheel
state: present
shell: /bin/bash
create_home: true

27
roles/debian_git/tasks/main.yml Executable file
View File

@@ -0,0 +1,27 @@
---
- name: doom emacs repo
become: yes
become_user: opal
git:
repo: "{{ doom_emacs_repo }}"
dest: "{{ doom_emacs_dest }}"
update: no
- name: et-book font repo
become: yes
become_user: opal
git:
repo: "{{ etbook_repo }}"
dest: "{{ etbook_dest }}"
update: no
version: master
- name: Move ET-Book directory to fonts directory
copy:
src: "{{ etbook_dir }}"
dest: "{{ fonts_dir }}"
- name: Move ET-Book Ligatures directory to fonts directory
copy:
src: "{{ etbook_lig_dir }}"
dest: "{{ fonts_dir }}"

9
roles/debian_git/vars/main.yml Executable file
View File

@@ -0,0 +1,9 @@
---
doom_emacs_repo: https://github.com/doomemacs/doomemacs
doom_emacs_dest: ~/.config/emacs
etbook_repo: https://github.com/edwardtufte/et-book
etbook_dest: ~/src/
etbook_dir: ~/src/et-book/et-book
etbook_lig_dir: ~/src/et-book/et-book-ligatures-enabled
fonts_dir: ~/.local/share/fonts

42
roles/debian_pkg/tasks/main.yml Executable file
View File

@@ -0,0 +1,42 @@
---
- name: Upgrade all packages
dnf5:
name: "*"
state: latest
- name: Install window manager packages
package:
name: "{{ item }}"
state: present
loop: "{{ wm_packages }}"
- name: Install UI/Font packages
dnf5:
name: "{{ item }}"
state: present
loop: "{{ ui_packages }}"
- name: Install general packages
package:
name: "{{ item }}"
state: present
loop: "{{ general_packages }}"
- name: Install Doom Emacs dependency packages
dnf5:
name: "{{ item }}"
state: present
loop: "{{ doom_dep_packages }}"
- name: Add Flathub repository
flatpak_remote:
name: flathub
state: present
flatpakrepo_url: "https://flathub.org/repo/flathub.flatpakrepo"
- name: Install Flatpak packages
flatpak:
name: "{{ item }}"
state: present
loop: "{{ flatpak_packages }}"

76
roles/debian_pkg/vars/main.yml Executable file
View File

@@ -0,0 +1,76 @@
---
wm_packages:
- sway
- swayidle
- swaylock
- alacritty
- waybar
- dunst
- pipewire
- polkit-kde-agent-1
- grim
- grimshot
- brightnessctl
- wlsunset
- wlogout
- xwayland
- wdisplays
- bemenu
- wtype
ui_packages:
- papirus-icon-theme
- arc-kde
- breeze-cursor-theme
- qt5ct
- qt6ct
#- fontawesome-fonts-all
#- google-noto-sans-cjk-fonts
#- google-noto-color-emoji-fonts
#- google-noto-emoji-fonts
- fonts-terminus
general_packages:
- emacs
- syncthing
- gopass
- cups
- keychain
- tldr
- eza
- gnupg2
- trash-cli
- htop
- mpv
- udiskie
- pavucontrol
- flatpak
- blueman
- beets
- unrar-free
- unzip
- lximage-qt
- screen
- playerctl # for waybar music notification
- simple-scan
- wireguard-tools
- dnf-automatic
- translate-shell
flatpak_packages:
- net.ankiweb.Anki
- org.torproject.torbrowser-launcher
doom_dep_packages:
- ripgrep
- libtool # Needed to compile vterm in Doom Emacs
- cmake # Needed to compile vterm in Doom Emacs
- discount # Markdown Compiler
- ShellCheck # Shell linter for Doom Emacs
- python3-pyflakes
- python3-isort
- micropipenv
- python3-nose2
- python3-nose
- python3-pytest
- python3-lsp-black

View File

@@ -63,6 +63,7 @@ flatpak_packages:
- org.torproject.torbrowser-launcher - org.torproject.torbrowser-launcher
doom_dep_packages: doom_dep_packages:
- fd-find
- ripgrep - ripgrep
- libtool # Needed to compile vterm in Doom Emacs - libtool # Needed to compile vterm in Doom Emacs
- cmake # Needed to compile vterm in Doom Emacs - cmake # Needed to compile vterm in Doom Emacs