diff --git a/README.md b/README.md index 5cb1863..5ea29dd 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,17 @@ This setup is specific to the maintainer's devices and needs. You're welcome to #### Mint 100%, but not really used, just tested once for fun. #### Parrot Security OS (MATE) -100% for a while, but OS did not serve maintainer's needs and 404 errors were terrible. Ubuntu Rolling Rhino filled the gap. +100% for a while, but OS did not serve maintainer's needs and 404 errors were terrible while updating. Ubuntu Rolling Rhino filled the gap. ### Arch Family #### Manjaro 100% at some point. +### Fedora Family +#### Fedora 35 +Workstation: 100% +Server: 100% + ## Currently Supported Unix Systems ### FreeBSD 12, 13 100%, although GUI is not working completely on 13 yet (dash-to-dock doesn't compile). diff --git a/facts/general/package.yml b/facts/general/package.yml index 24a25c9..218cd06 100644 --- a/facts/general/package.yml +++ b/facts/general/package.yml @@ -30,6 +30,13 @@ ansible_python_interpreter: "/usr/local/bin/python3.8" when: ansible_system == "FreeBSD" +- name: General | Facts | Package | dnf + set_fact: + sshfs: fuse-sshfs + locate: mlocate + opensshd: openssh + when: ansible_pkg_mgr == "dnf" + - name: General | Facts | Package | Update Commands | Helpers set_fact: @@ -78,6 +85,13 @@ done && when: ansible_distribution == "Parrot OS" +- name: General | Facts | Package | Update Commands | dnf + set_fact: + update_package_manager: | + echo "*** DNF ***" && + sudo dnf upgrade {{ update_accept_var }} && + when: ansible_pkg_mgr in ("dnf") + - name: General | Facts | Package | Update Commands | flatpak | check shell: which flatpak diff --git a/facts/general/system.yml b/facts/general/system.yml index c7ee259..3ece248 100644 --- a/facts/general/system.yml +++ b/facts/general/system.yml @@ -1,27 +1,33 @@ --- # Define file, folder, and other facts per OS. +- name: General | Facts | System | Global + set_fact: + leet_ssh: 'ling@leet' + leet_drive: /mnt/leet + lynis_install_dir: /usr/local/lynis + dwm_install_dir: /usr/local/src/dwm + st_install_dir: /usr/local/src/st + global_bin: /usr/local/bin + x_desktops: /usr/share/xsessions + + - name: General | Facts | System | Linux set_fact: rc_conf: /dev/null - lynis_install_dir: /usr/local/lynis sudoers_install_dir: /etc/sudoers.d/ + shutdown_command: sudo shutdown -h now when: ansible_system == "Linux" - name: General | Facts | System | FreeBSD set_fact: rc_conf: /etc/rc.conf - lynis_install_dir: /usr/local/lynis sudoers_install_dir: /usr/local/etc/sudoers.d/ + shutdown_command: sudo shutdown -p now when: ansible_system == "FreeBSD" -- name: General | Facts | System | 1337 Drive - set_fact: - leet_ssh: 'ling@leet' - leet_drive: /mnt/leet - - name: General | Facts | System | 1337 Drive Mounted? stat: path: "{{ leet_drive }}/Temp/ansible" @@ -74,4 +80,4 @@ - name: General | Facts | System | Ansible Branch set_fact: branch: main - when: branch is not defined \ No newline at end of file + when: branch is not defined diff --git a/facts/workstation/package.yml b/facts/workstation/package.yml index d838249..4a98cd0 100644 --- a/facts/workstation/package.yml +++ b/facts/workstation/package.yml @@ -12,21 +12,25 @@ - name: Workstation | Facts | Package | Consistent set_fact: firefox: firefox + firefox_esr: firefox-esr thunderbird: thunderbird evolution: evolution + psutil: python3-psutil gnome_tweaks: gnome-tweaks dconf_editor: dconf-editor appimagelauncher: htop #placeholder nfs: nfs-common msgfmt: gettext make: make + font_awesome: fonts-font-awesome + dmenu: dmenu + sassc: sassc - name: Workstation | Facts | Package | Pop_OS! set_fact: flatpak_distro: true firefox_esr: firefox - psutil: python3-psutil when: ansible_distribution == "Pop!_OS" @@ -34,15 +38,14 @@ set_fact: flatpak_distro: true firefox_esr: firefox - psutil: python3-psutil + dmenu: suckless-tools when: ansible_distribution == "Ubuntu" - name: Workstation | Facts | Package | Debian set_fact: flatpak_distro: true - firefox_esr: firefox-esr - psutil: python3-psutil + dmenu: suckless-tools when: ansible_distribution == "Debian" @@ -50,7 +53,6 @@ set_fact: flatpak_distro: true firefox_esr: firefox - psutil: python3-psutil when: ansible_distribution == "Linux Mint" @@ -58,7 +60,6 @@ set_fact: flatpak_distro: true firefox_esr: firefox-esr - psutil: python3-psutil when: ansible_distribution == "Parrot OS" @@ -74,9 +75,17 @@ - name: Workstation | Facts | Package | FreeBSD set_fact: flatpak_distro: false - firefox_esr: firefox-esr psutil: py38-psutil ansible_python_interpreter: "/usr/local/bin/python3.8" make: gmake # make comes with OS and cannot be installed with pkg. Try using gmake for better luck. + font_awesome: font-awesome when: ansible_system == "FreeBSD" + +- name: Workstation | Facts | Package | Fedora + set_fact: + flatpak_distro: true + firefox_esr: firefox + font_awesome: python3-XStatic-Font-Awesome + nfs: nfs-utils + when: ansible_distribution == "Fedora" diff --git a/files/dwm/config.h b/files/dwm/config.h new file mode 100644 index 0000000..eafa0c2 --- /dev/null +++ b/files/dwm/config.h @@ -0,0 +1,118 @@ +/* See LICENSE file for copyright and license details. */ + +/* appearance */ +static const unsigned int borderpx = 3; /* border pixel of windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 1; /* 0 means bottom bar */ +static const char *fonts[] = { "iosevka:size:9", "monospace:size=10", "fontawesome:size=9" }; +//static const char dmenufont[] = "monospace:size=9"; +static const char dmenufont[] = "iosevka:size=8"; +static const char col_gray1[] = "#222222"; +static const char col_gray2[] = "#444444"; +static const char col_gray3[] = "#bbbbbb"; +static const char col_gray4[] = "#eeeeee"; +static const char col_cyan[] = "#400080"; +static const char *colors[][3] = { + /* fg bg border */ + [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, + [SchemeSel] = { col_gray4, col_cyan, col_cyan }, +}; + +/* tagging */ +static const char *tags[] = { "1:", "2:", "3:", "4:", "5:", "6:", "7:", "8:", "9:" }; + +static const Rule rules[] = { + /* xprop(1): + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ + /* class instance title tags mask isfloating monitor */ + { "Gimp", NULL, NULL, 0, 1, -1 }, + { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, +}; + +/* layout(s) */ +static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ +static const int nmaster = 1; /* number of clients in master area */ +static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ + +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, /* first entry is default */ + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, +}; + +/* key definitions */ +#define MODKEY Mod1Mask +#define TAGKEYS(KEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + +/* commands */ +static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ +static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; +static const char *termcmd[] = { "st", NULL }; + +static Key keys[] = { + /* modifier key function argument */ + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + { MODKEY, XK_b, togglebar, {0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY, XK_Return, zoom, {0} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY|ShiftMask, XK_c, killclient, {0} }, + { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, + { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_space, setlayout, {0} }, + { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { MODKEY, XK_0, view, {.ui = ~0 } }, + { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + { MODKEY, XK_comma, focusmon, {.i = -1 } }, + { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + TAGKEYS( XK_1, 0) + TAGKEYS( XK_2, 1) + TAGKEYS( XK_3, 2) + TAGKEYS( XK_4, 3) + TAGKEYS( XK_5, 4) + TAGKEYS( XK_6, 5) + TAGKEYS( XK_7, 6) + TAGKEYS( XK_8, 7) + TAGKEYS( XK_9, 8) + { MODKEY|ShiftMask, XK_q, quit, {0} }, +// Mine + { MODKEY, XK_q, killclient, {0} }, +}; + +/* button definitions */ +/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +static Button buttons[] = { + /* click event mask button function argument */ + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, + { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, +}; diff --git a/files/dwm/dwm.desktop b/files/dwm/dwm.desktop new file mode 100644 index 0000000..622a2a5 --- /dev/null +++ b/files/dwm/dwm.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=dwm +Comment=1337 Tiling Window Manager +Exec=/usr/local/bin/dwm.sh +Type=Application \ No newline at end of file diff --git a/files/dwm/dwm.sh b/files/dwm/dwm.sh new file mode 100644 index 0000000..d519820 --- /dev/null +++ b/files/dwm/dwm.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# 2021-10-30 Hyperling +# Basically .xinitrc, but not placed there to avoid GDM/GNOME problems. + +## System Libs ## + +if [ -d /etc/X11/xinit/xinitrc.d ]; then + for f in /etc/X11/xinit/xinitrc.d/*; do + [ -x "$f" ] && . "$f" + done + unset f +fi + + +## Variables ## + +# This doesn't work for some reason. LBRY needs it but added to its executable instead. +eval `dbus-launch` + + +## Status Bars ## + +# slstatus, from Suckless # + +#exec slstatus & + +# Custom # + +while true; do + xsetroot -name "`date +"%Y-%m-%d %H:%M:%S"`" +done & + + +## Start ## + +exec dwm diff --git a/files/sudoers_ansible b/files/sudo/sudoers_ansible similarity index 100% rename from files/sudoers_ansible rename to files/sudo/sudoers_ansible diff --git a/files/sudoers_sudo b/files/sudo/sudoers_sudo similarity index 100% rename from files/sudoers_sudo rename to files/sudo/sudoers_sudo diff --git a/hosts b/hosts index 12ecfb8..dfee6a4 100644 --- a/hosts +++ b/hosts @@ -24,15 +24,15 @@ x570 branch=dev ; vnc : Define for installation of VNC protocol ; NOT IMPLEMENTED YET ; -dell-laptop coding=true editing=true -dell-inspiron coding=true +dell-laptop coding=true editing=true gaming=true +dell-inspiron coding=true gaming=true usb-workstation coding=true lbry-server-1 lbry-server-2 lbry-server-3 aspire coding=true editing=true gaming=true freeboy rdp=true -airbook coding=true editing=true +airbook coding=true editing=true gaming=true [mobile] pinephone @@ -93,9 +93,9 @@ x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu ; hugo : Set to anything to install HUGO static website generator. ; Example: true ; -; gitlab : Set to anything to install Gitlab project management tool. -; Example: true -; NOT IMPLEMENTED YET +; gitlab : ee - Installs Enterprise Edition Free Tier. Basically CE with an easier upgrade path for Paid Features +; ce - Installs Community Edition. Excludes paid features if you'll never use them. Sepposedly difficult to move to EE. +; Example: ce ; onlyoffice domain=hyperling.com onlyoffice=true grafana domain=hyperling.com grafana=true influxdb1=true @@ -108,3 +108,5 @@ reverse-proxy certbot=true nextcloud wordpress certbot=true usb-server +gitlab gitlab=ce domain=hyperling.com +gitlab2 gitlab=ce domain=hyperling.com diff --git a/local.yml b/local.yml index 5703e37..a0f5879 100644 --- a/local.yml +++ b/local.yml @@ -57,6 +57,10 @@ - include: tasks/workstation/linux/software/gnome.yml when: ansible_system == "Linux" + - include: tasks/workstation/linux/software/dwm.yml + when: ansible_system in ("Linux", "FreeBSD") + ignore_errors: yes + # Software Tasks # - include: tasks/workstation/linux/software/flatpaks.yml when: ansible_system == "Linux" and flatpak_distro @@ -161,7 +165,7 @@ when: hugo is defined - include: tasks/server/software/gitlab.yml - when: gitlab is defined + when: gitlab is defined and ansible_pkg_mgr in ("apt", "dnf") and ansible_distribution not in ("Fedora") diff --git a/tasks/general/acct_mgmt/sudo.yml b/tasks/general/acct_mgmt/sudo.yml index c399ad1..6883561 100644 --- a/tasks/general/acct_mgmt/sudo.yml +++ b/tasks/general/acct_mgmt/sudo.yml @@ -3,7 +3,7 @@ - name: General | Account Management | Sudo | Copy Ansible copy: - src: sudoers_ansible + src: sudo/sudoers_ansible dest: "{{ sudoers_install_dir }}" owner: root group: "{{ root_group }}" @@ -11,7 +11,7 @@ - name: General | Account Management | Sudo | Copy Sudo Group copy: - src: sudoers_sudo + src: sudo/sudoers_sudo dest: "{{ sudoers_install_dir }}" owner: root group: "{{ root_group }}" diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 1c9bfc9..8a218db 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -147,7 +147,12 @@ editor: export EDITOR='vi' init_aliases: | alias init-video='mkdir -v raw; mkdir -v exports; cp ~/Templates/*video* ./' - alias init-prog='echo -e "#!/bin/bash\n# `date +%Y-%m-%d` by Hyperling\n# REASON\n\nexit 0\n"' + alias init-vid=init-video + alias init-program='echo -e "#!/bin/bash\n# `date +%Y-%m-%d` by Hyperling\n# REASON\n\nexit 0\n"' + alias init-prog=init-program + bye: | + alias bye="{{ shutdown_command }}" + alias goodbye="update -y && bye" - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -165,6 +170,7 @@ {{ sync }} {{ editor }} {{ init_aliases }} + {{ bye }} - name: General | Account Management | Users | Files | .bashrc blockinfile: diff --git a/tasks/general/software/packages.yml b/tasks/general/software/packages.yml index 855c23b..a61959c 100644 --- a/tasks/general/software/packages.yml +++ b/tasks/general/software/packages.yml @@ -50,6 +50,12 @@ - "{{ opensshd }}" state: present +- name: General | Software | Services | Install CROND (Looking at you, Fedora) + package: + name: cronie + state: present + when: ansible_pkg_mgr == "dnf" + - name: General | Software | Packages | Update Software (Disabled) package: name: diff --git a/tasks/server/software/gitlab.yml b/tasks/server/software/gitlab.yml index fc0369c..c81e776 100644 --- a/tasks/server/software/gitlab.yml +++ b/tasks/server/software/gitlab.yml @@ -1,3 +1,102 @@ --- -# Install a Gitlab server. -# https://about.gitlab.com/install/#ubuntu \ No newline at end of file +# Install a Gitlab server for hosting software projects. + +## Checks ## + +- name: "Server | Software | GitLab | Checks | Host Variable: {{ gitlab }}" + shell: echo "ERROR! Variable has an invalid value!" && exit 1 + when: gitlab not in ("ee", "ce") + +- name: Server | Software | GitLab | Checks | Play Variables + set_fact: + gitlab_bundle: "gitlab-{{ gitlab }}" + gitlab_config: /etc/gitlab/gitlab.rb + gitlab_url_prefix: "https://git" + +# Ensure other version is not installed. +- name: Server | Software | GitLab | Checks | Remove EE + package: + name: gitlab-ee + state: absent + when: gitlab == "ce" + +- name: Server | Software | GitLab | Checks | Remove CE + package: + name: gitlab-ce + state: absent + when: gitlab == "ee" + + +## Install ## +# https://about.gitlab.com/install/?version=ce#ubuntu +# https://about.gitlab.com/install/?version=ce#centos-8 (Fedora) + +- name: Server | Software | GitLab | Install | Check + shell: which gitlab-ctl + ignore_errors: yes + register: gitlab_installed + +- name: Server | Software | GitLab | Install | Pre-Reqs + package: + update_cache: yes + name: + - curl + - openssh-server + - ca-certificates + - tzdata + - perl + - postfix + state: present + when: gitlab_installed.failed + +- name: Server | Software | GitLab | Install | Add Repo (apt) + shell: curl https://packages.gitlab.com/install/repositories/gitlab/{{ gitlab_bundle }}/script.deb.sh | bash + when: gitlab_installed.failed and ansible_pkg_mgr == "apt" + +- name: Server | Software | GitLab | Install | Add Repo (dnf) + shell: curl https://packages.gitlab.com/install/repositories/gitlab/{{ gitlab_bundle }}/script.rpm.sh | bash + when: gitlab_installed.failed and ansible_pkg_mgr == "dnf" + +- name: Server | Software | GitLab | Install | Install + shell: EXTERNAL_URL="{{ gitlab_url_prefix }}.{{ domain }}" {{ ansible_pkg_mgr }} install -y {{ gitlab_bundle }} + when: gitlab_installed.failed + +- name: Server | Software | GitLab | Install | Get Password + shell: cat /etc/gitlab/initial_root_password && cp /etc/gitlab/initial_root_password ~/ + register: gitlab_passwd + when: gitlab_installed.failed + +- name: Server | Software | GitLab | Install | Print Password + debug: + var: gitlab_passwd.stdout_lines + when: gitlab_installed.failed + + +## Configuration ## +# https://docs.gitlab.com/ee/install/next_steps.html + +# Need to make server think it's https but not actually listen for it, otherwise reverse proxy doesn't work. +# https://www.itsfullofstars.de/2019/06/gitlab-behind-a-reverse-proxy/ + +- name: Server | Software | GitLab | Configure |Check External URL + lineinfile: + path: "{{ gitlab_config }}" + regexp: '^external_url ' + line: "external_url '{{ gitlab_url_prefix }}.{{ domain }}' # Managed by Ansible" + state: present + create: yes + backup: yes + +- name: Server | Software | GitLab | Configure | Turn Off Serving Local SSL + blockinfile: + path: "{{ gitlab_config }}" + block: | + nginx['listen_port'] = 80 + nginx['listen_https'] = false + marker: "# {mark} MANAGED BY ANSIBLE - {{ gitlab_config }}" + state: present + create: yes + backup: yes + +- name: Server | Software | GitLab | Configure | Reconfigure + shell: gitlab-ctl reconfigure diff --git a/tasks/workstation/freebsd/cron/ansible.yml b/tasks/workstation/freebsd/cron/ansible.yml index 6a08976..a0bcb13 100644 --- a/tasks/workstation/freebsd/cron/ansible.yml +++ b/tasks/workstation/freebsd/cron/ansible.yml @@ -8,4 +8,5 @@ special_time: daily job: "sudo freebsd-update cron -t me@hyperling.com" state: present - disabled: no \ No newline at end of file + disabled: no + \ No newline at end of file diff --git a/tasks/workstation/linux/software/dwm.yml b/tasks/workstation/linux/software/dwm.yml new file mode 100644 index 0000000..238fbb6 --- /dev/null +++ b/tasks/workstation/linux/software/dwm.yml @@ -0,0 +1,73 @@ +--- +# Nice, simple, and easy to use tiling window manager. +# https://dwm.suckless.org/ +# https://sites.google.com/site/lazyboxx/-articles/dwm-a-newbie-s-guide#TOC-Status-Bar + +## Pre-reqs ## + +- name: Workstation | Linux | Software | DWM | Pre-Reqs + package: + name: + - git + - "{{ make }}" + - "{{ dmenu }}" + - "{{ font_awesome }}" + update_cache: yes + + +## Download ## + +- name: Workstation | Linux | Software | DWM | Git Clone + git: + repo: https://git.suckless.org/dwm + dest: "{{ dwm_install_dir }}" + clone: yes + force: yes + +- name: Workstation | Linux | Software | DWM | Git Clone (st) + git: + repo: https://git.suckless.org/st + dest: "{{ st_install_dir }}" + clone: yes + force: yes + +## Configuration ## + +- name: Workstation | Linux | Software | DWM | Config File + copy: + src: dwm/config.h + dest: "{{ dwm_install_dir }}" + owner: root + group: "{{ root_group }}" + mode: 0755 + + +## Install ## + +- name: Workstation | Linux | Software | DWM | Install + shell: "cd {{ dwm_install_dir }}; {{ make }} clean install" + +- name: Workstation | Linux | Software | DWM | Install (st) + shell: "cd {{ st_install_dir }}; {{ make }} clean install" + + +## X Init Sript ## + +- name: Workstation | Linux | Software | DWM | Shell Script + copy: + src: dwm/dwm.sh + dest: "{{ global_bin }}" + owner: root + group: "{{ root_group }}" + mode: 0755 + + +## Desktop File ## + +- name: Workstation | Linux | Software | DWM | Desktop File + copy: + src: dwm/dwm.desktop + dest: "{{ x_desktops }}" + owner: root + group: "{{ root_group }}" + mode: 0644 diff --git a/tasks/workstation/linux/software/flatpaks.yml b/tasks/workstation/linux/software/flatpaks.yml index 1c0144a..2c01430 100644 --- a/tasks/workstation/linux/software/flatpaks.yml +++ b/tasks/workstation/linux/software/flatpaks.yml @@ -2,6 +2,7 @@ # Use flatpaks because they're consistent! :) ## Flatpak Pre-reqs ## + - name: Workstation | Linux | Flatpak Distro | Flatpak | Install package: name: flatpak @@ -14,23 +15,56 @@ method: system flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo +- name: Workstation | Linux | Flatpak Distro | Flatpak | Add Flathub for System (#2) + flatpak_remote: + name: flathub2 + state: present + method: system + flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo + ## Flatpak Installs ## - name: Workstation | Linux | Flatpak Distro | Flatpak | Variables set_fact: flatpak_exec_dir: "{{ user_ling.home }}/bin" + flatpak_exec: "flatpak run" -# Generic # -- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic Array +- name: Workstation | Linux | Flatpak Distro | Flatpak | Arrays set_fact: flatpaks_generic: - - { app: "org.libreoffice.LibreOffice", name: "office" } - - { app: "com.discordapp.Discord", name: "discord" } - - { app: "org.telegram.desktop", name: "telegram" } - - { app: "io.lbry.lbry-app", name: "lbry" } + - { app: "org.libreoffice.LibreOffice", name: "office", extra: "" } + - { app: "org.telegram.desktop", name: "telegram", extra: "" } + - { app: "io.lbry.lbry-app", name: "lbry", extra: "dbus-launch" } + - { app: "org.signal.Signal", name: "signal", extra: "" } + - { app: "io.gitlab.librewolf-community", name: "librewolf", extra: "" } + flatpaks_coding: + - { app: "com.vscodium.codium", name: "codium", extra: "" } + - { app: "com.google.AndroidStudio", name: "android-studio", extra: "" } + - { app: "com.jetbrains.PyCharm-Community", name: "pycharm", extra: "" } + - { app: "io.dbeaver.DBeaverCommunity", name: "dbeaver", extra: "" } + flatpaks_editing: + - { app: "org.shotcut.Shotcut", name: "shotcut", extra: "" } + - { app: "com.obsproject.Studio", name: "obs", extra: "" } + - { app: "org.gimp.GIMP", name: "gimp", extra: "" } + flatpaks_gaming: + - { app: "com.valvesoftware.Steam", name: "steam", extra: "" } + - { app: "com.play0ad.zeroad", name: "zeroad", extra: "" } + - { app: "net.supertuxkart.SuperTuxKart", name: "tuxkart", extra: "" } + flatpaks_remove: + - { app: "org.mozilla.firefox", name: "firefox", extra: "" } + - { app: "com.visualstudio.code", name: "vscode", extra: "" } # Why does this throw an error? It's the correct ID. + - { app: "com.visualstudio.code-oss", name: "code-oss", extra: "" } + - { app: "org.midori_browser.Midori", name: "midori", extra: "" } + - { app: "com.github.Eloston.UngoogledChromium", name: "unchrome", extra: "" } + - { app: "org.gnome.Evolution", name: "evolution", extra: "" } # Doesn't pick up GNOME theme since contained. + - { app: "org.mozilla.Thunderbird", name: "thunderbird", extra: "" } # Doesn't integrate with Nextcloud as well as Evolution. + - { app: "org.audacityteam.Audacity", name: "audacity", extra: "" } # Say "no thanks" to spyware. + - { app: "com.discordapp.Discord", name: "discord", extra: "" } # Stopped working, just spins and says Starting. -- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic Installs +# Generic # + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Installs flatpak: name: "{{ item.app }}" remote: flathub @@ -38,11 +72,11 @@ loop: "{{ flatpaks_generic }}" ignore_errors: yes -- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic Executables +- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Executables blockinfile: path: "{{ flatpak_exec_dir }}/{{ item.name }}" block: | - flatpak run {{ item.app }} + {{ item.extra }} {{ flatpak_exec }} {{ item.app }} marker: '{mark}' marker_begin: "#!{{ bash_exec.stdout }}" marker_end: "exit 0" @@ -51,7 +85,7 @@ loop: "{{ flatpaks_generic }}" become_user: ling -- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic Executable Permissions +- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Executable Permissions file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: file @@ -59,99 +93,177 @@ loop: "{{ flatpaks_generic }}" # Coding # -- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding Installs + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Installs flatpak: - name: "{{ item }}" + name: "{{ item.app }}" remote: flathub state: present - loop: - - com.vscodium.codium - - com.google.AndroidStudio - - com.jetbrains.PyCharm-Community - - io.dbeaver.DBeaverCommunity + loop: "{{ flatpaks_coding }}" ignore_errors: yes when: coding is defined -- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding Uninstalls +- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Executables + blockinfile: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + block: | + {{ item.extra }} {{ flatpak_exec }} {{ item.app }} + marker: '{mark}' + marker_begin: "#!{{ bash_exec.stdout }}" + marker_end: "exit 0" + state: present + create: yes + loop: "{{ flatpaks_coding }}" + become_user: ling + when: coding is defined + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Executable Permissions + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: file + mode: '0755' + loop: "{{ flatpaks_coding }}" + when: coding is defined + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Uninstall flatpak: - name: "{{ item }}" + name: "{{ item.app }}" remote: flathub state: absent - loop: - - com.vscodium.codium - - com.google.AndroidStudio - - com.jetbrains.PyCharm-Community - - io.dbeaver.DBeaverCommunity + loop: "{{ flatpaks_coding }}" + ignore_errors: yes + when: coding is not defined + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Remove Executables + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: absent + loop: "{{ flatpaks_coding }}" ignore_errors: yes when: coding is not defined # Media Editors # -- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editor Installs + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Installs flatpak: - name: "{{ item }}" + name: "{{ item.app }}" remote: flathub state: present - loop: - - org.shotcut.Shotcut - - com.obsproject.Studio - - org.gimp.GIMP + loop: "{{ flatpaks_editing }}" ignore_errors: yes when: editing is defined +- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executables + blockinfile: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + block: | + {{ item.extra }} {{ flatpak_exec }} {{ item.app }} + marker: '{mark}' + marker_begin: "#!{{ bash_exec.stdout }}" + marker_end: "exit 0" + state: present + create: yes + loop: "{{ flatpaks_editing }}" + become_user: ling + when: editing is defined + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executable Permissions + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: file + mode: '0755' + loop: "{{ flatpaks_editing }}" + when: editing is defined + - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editor Uninstalls flatpak: - name: "{{ item }}" + name: "{{ item.app }}" remote: flathub state: absent - loop: - - org.shotcut.Shotcut - - com.obsproject.Studio - - org.gimp.GIMP + loop: "{{ flatpaks_editing }}" + ignore_errors: yes + when: editing is not defined + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Remove Executables + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: absent + loop: "{{ flatpaks_editing }}" ignore_errors: yes when: editing is not defined # Gaming # -- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming Installs + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Installs flatpak: - name: "{{ item }}" + name: "{{ item.app }}" remote: flathub state: present - loop: - - com.valvesoftware.Steam + loop: "{{ flatpaks_gaming }}" ignore_errors: yes when: gaming is defined -- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming Uninstalls +- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Executables + blockinfile: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + block: | + {{ item.extra }} {{ flatpak_exec }} {{ item.app }} + marker: '{mark}' + marker_begin: "#!{{ bash_exec.stdout }}" + marker_end: "exit 0" + state: present + create: yes + loop: "{{ flatpaks_gaming }}" + become_user: ling + when: gaming is defined + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Executable Permissions + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: file + mode: '0755' + loop: "{{ flatpaks_gaming }}" + when: gaming is defined + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Uninstalls flatpak: - name: "{{ item }}" + name: "{{ item.app }}" remote: flathub state: absent - loop: - - com.valvesoftware.Steam + loop: "{{ flatpaks_gaming }}" + ignore_errors: yes + when: gaming is not defined + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Remove Executables + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: absent + loop: "{{ flatpaks_gaming }}" ignore_errors: yes when: gaming is not defined # Removals # -- name: Workstation | Linux | Flatpak Distro | Flatpak | Application Uninstalls + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Uninstalls | Uninstall flatpak: - name: "{{ item }}" + name: "{{ item.app }}" remote: flathub state: absent - loop: - - org.mozilla.firefox - - com.visualstudio.code # Why does this throw an error? It's the correct ID. - - com.visualstudio.code-oss - - org.midori_browser.Midori - - com.github.Eloston.UngoogledChromium - - org.gnome.Evolution # Doesn't pick up GNOME theme since contained. - - org.mozilla.Thunderbird # Doesn't integrate with Nextcloud as well as Evolution. - - org.audacityteam.Audacity # Say "no thanks" to spyware. + loop: "{{ flatpaks_remove }}" + ignore_errors: yes + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Uninstalls | Remove Executables + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: absent + loop: "{{ flatpaks_remove }}" ignore_errors: yes ## Other Stuff ## # Software not yet available or working properly in Flatpak form. + - name: Workstation | Linux | Flatpak Distro | Package Manager | Install From Repo package: name: @@ -170,12 +282,14 @@ when: firefox != firefox_esr # Lutris # + - name: Workstation | Linux | Flatpak Distro | Package Manager | Add Lutris PPA (Ubuntu) apt_repository: repo: ppa:lutris-team/lutris update_cache: yes state: present when: ansible_distribution == "Ubuntu" and gaming is defined + ignore_errors: yes - name: Workstation | Linux | Flatpak Distro | Package Manager | Add Lutris (besides ARM) package: @@ -183,14 +297,15 @@ - lutris state: present when: ansible_architecture != "aarch64" and gaming is defined + ignore_errors: yes - name: Workstation | Linux | Flatpak Distro | Package Manager | Remove Lutris (besides ARM) package: name: - lutris state: absent - ignore_errors: yes when: ansible_architecture != "aarch64" and gaming is not defined + ignore_errors: yes - name: Workstation | Linux | Flatpak Distro | Package Manager | Remove Lutris PPA (Ubuntu) apt_repository: @@ -198,8 +313,10 @@ update_cache: yes state: absent when: ansible_distribution == "Ubuntu" and gaming is not defined + ignore_errors: yes # Remove Repo Software # + - name: Workstation | Linux | Flatpak Distro | Package Manager | Remove Applications package: name: diff --git a/tasks/workstation/mac-os/software/dmg.yml b/tasks/workstation/mac-os/software/dmg.yml index c0dd90f..4d8b92b 100644 --- a/tasks/workstation/mac-os/software/dmg.yml +++ b/tasks/workstation/mac-os/software/dmg.yml @@ -2,3 +2,6 @@ # Download and install DMG files that are not yet in Homebrew. # macFUSE, sshfs, balena-etcher + +- name: Workstation | Mac OS | Software | DMGs | TBD + shell: echo TBD diff --git a/tasks/workstation/settings/gnome.yml b/tasks/workstation/settings/gnome.yml index 5dbbf7e..6a81654 100644 --- a/tasks/workstation/settings/gnome.yml +++ b/tasks/workstation/settings/gnome.yml @@ -2,7 +2,7 @@ # GNOME settings, extensions, and setup. # Check for special software that may need added to favorites. -- name: Workstation | Account Management | GNOME | Checks | Defaults +- name: Workstation | Account Management | GNOME | Facts | Defaults set_fact: browser: "com.github.Eloston.UngoogledChromium.desktop" @@ -13,9 +13,19 @@ - name: Workstation | Account Management | GNOME | Checks | Brave | Set As Browser set_fact: - browser: brave-browser.desktop + browser: "brave-browser.desktop" when: not brave.failed +#- name: Workstation | Account Management | GNOME | Checks | LibreWolf | Locate +# shell: which librewolf +# register: librewolf +# ignore_errors: yes +# +#- name: Workstation | Account Management | GNOME | Checks | LibreWolf | Set As Browser +# set_fact: +# browser: "io.gitlab.librewolf-community.desktop" +# when: not librewolf.failed or (flatpak_distro is defined and flatpak_distro) + # Make sure Gnome-Tweaks is installed - name: Workstation | Account Management | GNOME | Install Dependencies @@ -54,6 +64,7 @@ name: - "{{ make }}" - "{{ msgfmt }}" + - "{{ sassc }}" state: present when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed @@ -153,11 +164,11 @@ dconf: key: /org/gnome/shell/favorite-apps value: "['org.gnome.Terminal.desktop', 'gnome-system-monitor.desktop', 'org.gnome.Nautilus.desktop', - '{{ browser }}', 'org.gnome.Evolution.desktop', + 'io.gitlab.librewolf-community.desktop', '{{ browser }}', 'org.gnome.Evolution.desktop', 'com.vscodium.codium.desktop', 'org.shotcut.Shotcut.desktop', 'org.telegram.desktop.desktop', 'com.discordapp.Discord.desktop', - 'rhythmbox.desktop', 'io.lbry.lbry-app.desktop', - 'com.valvesoftware.Steam.desktop', 'net.lutris.Lutris.desktop']" + 'io.lbry.lbry-app.desktop', + 'com.valvesoftware.Steam.desktop']" state: present become_user: ling when: ansible_system == "Linux" diff --git a/tasks/workstation/settings/vnc.yml b/tasks/workstation/settings/vnc.yml index 741d47d..5486adb 100644 --- a/tasks/workstation/settings/vnc.yml +++ b/tasks/workstation/settings/vnc.yml @@ -1,2 +1,5 @@ --- # Allow remote viewing desktops via VNC. + +- name: General | Software | Services | VNC | TBD + shell: echo "TBD"