From d36eac4cebdf9d8ace6db1a8a5582e12c129f892 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 2 Oct 2026 10:21:04 -0700 Subject: [PATCH] local, fix indentation, add a few names, pass notify a variable. --- local.yml | 292 +++++++++++++++++++++++++++--------------------------- 1 file changed, 148 insertions(+), 144 deletions(-) diff --git a/local.yml b/local.yml index 56771e7..14dd09e 100644 --- a/local.yml +++ b/local.yml @@ -14,8 +14,8 @@ - name: Main | Lock block: - - include_tasks: tasks/general/tests/lock_check.yml - - include_tasks: tasks/general/tests/lock_create.yml + - include_tasks: tasks/general/tests/lock_check.yml + - include_tasks: tasks/general/tests/lock_create.yml ####### Gather ####### @@ -23,26 +23,24 @@ - name: Main | Gather block: - - include_tasks: facts/general/gather.yml - - include_tasks: tasks/general/acct_mgmt/provision_config.yml + - include_tasks: facts/general/gather.yml + - include_tasks: tasks/general/acct_mgmt/provision_config.yml - - include_tasks: facts/general/system.yml - - include_tasks: facts/general/package.yml - - include_tasks: facts/general/service.yml - - include_tasks: facts/general/user.yml + - include_tasks: facts/general/system.yml + - include_tasks: facts/general/package.yml + - include_tasks: facts/general/service.yml + - include_tasks: facts/general/user.yml - - include_tasks: tasks/general/tests/internet_check.yml + - include_tasks: tasks/general/tests/internet_check.yml ####### Start ####### - name: Main | Start block: - - name: Main | Start | Notify | Touch File - include_tasks: tasks/general/acct_mgmt/notify.yml - - - name: Main | Start | Notify | Add Message - shell : echo "'Ansible' 'Provisioning started @ `date`'" >> "{{ notify_log_file }}" + - include_tasks: tasks/general/acct_mgmt/notify.yml + vars: + notify_message: "Started" when: workstation @@ -51,37 +49,37 @@ - name: Main | NixOS Setup block: - - include_tasks: tasks/general/software/nixos.yml + - include_tasks: tasks/general/software/nixos.yml - # TBD if we are going to use this many, then just have IF statements - # and use blocks within the General area for NixOS vs not-NixOS. - - include_tasks: tasks/general/software/swap.yml + # TBD if we are going to use this many, then just have IF statements + # and use blocks within the General area for NixOS vs not-NixOS. + - include_tasks: tasks/general/software/swap.yml - - include_tasks: tasks/general/acct_mgmt/groups.yml - - include_tasks: tasks/general/acct_mgmt/users.yml - - include_tasks: tasks/general/acct_mgmt/sudo.yml - - include_tasks: tasks/general/acct_mgmt/doas.yml + - include_tasks: tasks/general/acct_mgmt/groups.yml + - include_tasks: tasks/general/acct_mgmt/users.yml + - include_tasks: tasks/general/acct_mgmt/sudo.yml + - include_tasks: tasks/general/acct_mgmt/doas.yml - - include_tasks: tasks/general/scripts/root.yml - - include_tasks: tasks/general/scripts/user.yml - - include_tasks: tasks/general/scripts/install.yml + - include_tasks: tasks/general/scripts/root.yml + - include_tasks: tasks/general/scripts/user.yml + - include_tasks: tasks/general/scripts/install.yml - - include_tasks: tasks/general/cron/ansible.yml + - include_tasks: tasks/general/cron/ansible.yml - # psutil does not work in NixOS. Cannot figure out how to fix it. Maybe - # time to start looking into home-manager but still not wanting to - # maintain two different GNOME setups. HMMMM! - - include_tasks: tasks/workstation/shared/settings/gnome.yml - when: workstation + # psutil does not work in NixOS. Cannot figure out how to fix it. Maybe + # time to start looking into home-manager but still not wanting to + # maintain two different GNOME setups. HMMMM! + - include_tasks: tasks/workstation/shared/settings/gnome.yml + when: workstation - # Try including these. Really need to get NixOS working with the rest! - #- include_tasks: tasks/general/software/telegraf.yml # "Could not find a module for unknown."" - - include_tasks: tasks/general/tests/services.yml - - include_tasks: tasks/general/tests/lynis.yml - - include_tasks: tasks/general/tests/nmap.yml + # Try including these. Really need to get NixOS working with the rest! + #- include_tasks: tasks/general/software/telegraf.yml # "Could not find a module for unknown."" + - include_tasks: tasks/general/tests/services.yml + - include_tasks: tasks/general/tests/lynis.yml + - include_tasks: tasks/general/tests/nmap.yml - - name: NixOS | Complete - meta: end_play + - name: NixOS | Complete + meta: end_play when: ansible_distribution == "NixOS" @@ -91,36 +89,36 @@ - name: Main | General Setup block: - - include_tasks: tasks/general/software/swap.yml - - include_tasks: tasks/general/software/packages.yml - - include_tasks: tasks/general/software/services.yml - - include_tasks: tasks/general/software/sendmail.yml - when: ansible_system == "FreeBSD" + - include_tasks: tasks/general/software/swap.yml + - include_tasks: tasks/general/software/packages.yml + - include_tasks: tasks/general/software/services.yml + - include_tasks: tasks/general/software/sendmail.yml + when: ansible_system == "FreeBSD" - - include_tasks: tasks/general/software/aur.yml - when: ansible_pkg_mgr == "pacman" + - include_tasks: tasks/general/software/aur.yml + when: internet and ansible_pkg_mgr == "pacman" - # Gather again in case missing programs have now been installed. - - include_tasks: facts/general/gather.yml + # Gather again in case missing programs have now been installed. + - include_tasks: facts/general/gather.yml - - include_tasks: tasks/general/settings/keyboard.yml + - include_tasks: tasks/general/settings/keyboard.yml - - include_tasks: tasks/general/acct_mgmt/groups.yml - - include_tasks: tasks/general/acct_mgmt/users.yml - - include_tasks: tasks/general/acct_mgmt/sudo.yml - - include_tasks: tasks/general/acct_mgmt/doas.yml + - include_tasks: tasks/general/acct_mgmt/groups.yml + - include_tasks: tasks/general/acct_mgmt/users.yml + - include_tasks: tasks/general/acct_mgmt/sudo.yml + - include_tasks: tasks/general/acct_mgmt/doas.yml - - include_tasks: tasks/general/scripts/root.yml - - include_tasks: tasks/general/scripts/user.yml - - include_tasks: tasks/general/scripts/install.yml + - include_tasks: tasks/general/scripts/root.yml + - include_tasks: tasks/general/scripts/user.yml + - include_tasks: tasks/general/scripts/install.yml - - include_tasks: tasks/general/cron/ansible.yml + - include_tasks: tasks/general/cron/ansible.yml - # TODO Need to refactor. Maybe tasks/general/cron/freebsd.yml - - include_tasks: tasks/workstation/freebsd/cron/ansible.yml - when: ansible_system == "FreeBSD" + # TODO Need to refactor. Maybe tasks/general/cron/freebsd.yml + - include_tasks: tasks/workstation/freebsd/cron/ansible.yml + when: ansible_system == "FreeBSD" - - include_tasks: tasks/general/software/metasploit.yml + - include_tasks: tasks/general/software/metasploit.yml when: provision @@ -130,77 +128,81 @@ - name: Main | Workstation Setup block: - - include_tasks: facts/workstation/package.yml + - include_tasks: facts/workstation/package.yml - ## Desktop Environments ## - - include_tasks: tasks/workstation/freebsd/software/gpu.yml - when: ansible_system == "FreeBSD" and bsd_gpu + ## Desktop Environments ## + - include_tasks: tasks/workstation/freebsd/software/gpu.yml + when: ansible_system == "FreeBSD" and bsd_gpu - # Window Managers without true Desktop Environments # - - include_tasks: tasks/workstation/shared/software/dwm.yml - - include_tasks: tasks/workstation/shared/software/i3.yml + # Window Managers without true Desktop Environments # + - include_tasks: tasks/workstation/shared/software/dwm.yml + - include_tasks: tasks/workstation/shared/software/i3.yml - # Polished Desktop Environments # - - include_tasks: tasks/workstation/freebsd/software/gnome.yml - when: ansible_system == "FreeBSD" + # Polished Desktop Environments # + - include_tasks: tasks/workstation/freebsd/software/gnome.yml + when: ansible_system == "FreeBSD" - - name: Main | Workstation | Fancy Desktop Environments - block: - - include_tasks: tasks/workstation/linux/software/gnome.yml - when: ansible_service_mgr == "systemd" - - include_tasks: tasks/workstation/linux/software/cinnamon.yml - - include_tasks: tasks/workstation/linux/software/lxqt.yml - when: ansible_system == "Linux" - # TBD: Implement this: and extra_desktops - - ## Software Tasks ## - - block: - - include_tasks: tasks/workstation/linux/software/packages.yml - - include_tasks: tasks/workstation/linux/software/tlp.yml - - include_tasks: tasks/workstation/linux/software/lutris.yml - - include_tasks: tasks/workstation/linux/software/vscodium.yml - - include_tasks: tasks/workstation/linux/software/vpn.yml - - include_tasks: tasks/workstation/linux/software/nodejs.yml - - include_tasks: tasks/workstation/linux/software/hugo.yml - - include_tasks: tasks/workstation/linux/software/brave.yml - when: ansible_pkg_mgr in ("apt", "dnf", "zypper") and not mobile - when: ansible_system == "Linux" - - - include_tasks: tasks/workstation/freebsd/software/packages.yml - when: ansible_system == "FreeBSD" - - - include_tasks: tasks/workstation/mac-os/software/brew.yml - when: ansible_system == "Darwin" - - ## Configuration Tasks ## - - block: - - include_tasks: tasks/workstation/shared/settings/gnome.yml - - include_tasks: tasks/workstation/shared/settings/cinnamon.yml - - include_tasks: tasks/workstation/shared/settings/xdg_autostart.yml - - - include_tasks: tasks/workstation/linux/cron/ansible.yml + - name: Main | Workstation | Fancy Desktop Environments + block: + - include_tasks: tasks/workstation/linux/software/gnome.yml + when: ansible_service_mgr == "systemd" + - include_tasks: tasks/workstation/linux/software/cinnamon.yml + - include_tasks: tasks/workstation/linux/software/lxqt.yml when: ansible_system == "Linux" - when: not mobile + # TBD: Implement this: and extra_desktops - - include_tasks: tasks/workstation/shared/settings/nfs.yml + ## Software Tasks ## - - include_tasks: tasks/workstation/shared/settings/rdp.yml - when: rdp + - name: Main | Workstation Setup | Linux + block: + - include_tasks: tasks/workstation/linux/software/packages.yml + - include_tasks: tasks/workstation/linux/software/tlp.yml + - include_tasks: tasks/workstation/linux/software/lutris.yml + - include_tasks: tasks/workstation/linux/software/vscodium.yml + - include_tasks: tasks/workstation/linux/software/vpn.yml + - include_tasks: tasks/workstation/linux/software/nodejs.yml + - include_tasks: tasks/workstation/linux/software/hugo.yml + - include_tasks: tasks/workstation/linux/software/brave.yml + when: ansible_pkg_mgr in ("apt", "dnf", "zypper") and not mobile + when: ansible_system == "Linux" - - include_tasks: tasks/workstation/shared/settings/vnc.yml - when: vnc + - include_tasks: tasks/workstation/freebsd/software/packages.yml + when: ansible_system == "FreeBSD" - - include_tasks: tasks/workstation/shared/settings/services.yml - - include_tasks: tasks/workstation/shared/settings/templates.yml + - include_tasks: tasks/workstation/mac-os/software/brew.yml + when: ansible_system == "Darwin" - ## Final Tasks (SLOW) ## - - block: - - include_tasks: tasks/workstation/linux/software/flatpaks.yml - when: flatpak_distro - - include_tasks: tasks/workstation/linux/software/java.yml - - include_tasks: tasks/workstation/linux/software/flutter.yml - - include_tasks: tasks/workstation/linux/software/android.yml - when: ansible_system == "Linux" + ## Configuration Tasks ## + - name: Main | Workstation Setup | Configuration + block: + - include_tasks: tasks/workstation/shared/settings/gnome.yml + - include_tasks: tasks/workstation/shared/settings/cinnamon.yml + - include_tasks: tasks/workstation/shared/settings/xdg_autostart.yml + + - include_tasks: tasks/workstation/linux/cron/ansible.yml + when: ansible_system == "Linux" + when: not mobile + + - include_tasks: tasks/workstation/shared/settings/nfs.yml + + - include_tasks: tasks/workstation/shared/settings/rdp.yml + when: rdp + + - include_tasks: tasks/workstation/shared/settings/vnc.yml + when: vnc + + - include_tasks: tasks/workstation/shared/settings/services.yml + - include_tasks: tasks/workstation/shared/settings/templates.yml + + ## Final Tasks (SLOW) ## + - name: Main | Workstation Setup | Linux [Slow] + block: + - include_tasks: tasks/workstation/linux/software/flatpaks.yml + when: flatpak_distro + - include_tasks: tasks/workstation/linux/software/java.yml + - include_tasks: tasks/workstation/linux/software/flutter.yml + - include_tasks: tasks/workstation/linux/software/android.yml + when: ansible_system == "Linux" when: workstation @@ -251,26 +253,26 @@ - name: Main | Server Setup block: - - include_tasks: tasks/server/software/services.yml + - include_tasks: tasks/server/software/services.yml - - block: - - include_tasks: tasks/server/software/certbot.yml - - include_tasks: tasks/server/cron/certbot.yml - when: certbot + - block: + - include_tasks: tasks/server/software/certbot.yml + - include_tasks: tasks/server/cron/certbot.yml + when: certbot - - block: - - include_tasks: tasks/server/software/onlyoffice.yml - when: onlyoffice - - include_tasks: tasks/server/software/influxdb1.yml - when: influxdb1 - - include_tasks: tasks/server/software/influxdb2.yml - when: influxdb2 - - include_tasks: tasks/server/software/grafana.yml - when: grafana - when: ansible_pkg_mgr == "apt" + - block: + - include_tasks: tasks/server/software/onlyoffice.yml + when: onlyoffice + - include_tasks: tasks/server/software/influxdb1.yml + when: influxdb1 + - include_tasks: tasks/server/software/influxdb2.yml + when: influxdb2 + - include_tasks: tasks/server/software/grafana.yml + when: grafana + when: ansible_pkg_mgr == "apt" - - include_tasks: tasks/server/software/hugo.yml - when: hugo + - include_tasks: tasks/server/software/hugo.yml + when: hugo when: server @@ -280,17 +282,19 @@ - name: Main | Reporting block: - - include_tasks: tasks/general/software/telegraf.yml + - include_tasks: tasks/general/software/telegraf.yml - - include_tasks: tasks/general/tests/services.yml - - include_tasks: tasks/general/tests/lynis.yml - - include_tasks: tasks/general/tests/nmap.yml + - include_tasks: tasks/general/tests/services.yml + - include_tasks: tasks/general/tests/lynis.yml + - include_tasks: tasks/general/tests/nmap.yml ####### Finish ####### - name: Main | Finish block: - - include_tasks: tasks/general/acct_mgmt/notify.yml + - include_tasks: tasks/general/acct_mgmt/notify.yml + vars: + notify_message: "Finished" - - include_tasks: tasks/general/tests/lock_remove.yml + - include_tasks: tasks/general/tests/lock_remove.yml