local, fix indentation, add a few names, pass notify a variable.
This commit is contained in:
@@ -14,8 +14,8 @@
|
|||||||
- name: Main | Lock
|
- name: Main | Lock
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- include_tasks: tasks/general/tests/lock_check.yml
|
- include_tasks: tasks/general/tests/lock_check.yml
|
||||||
- include_tasks: tasks/general/tests/lock_create.yml
|
- include_tasks: tasks/general/tests/lock_create.yml
|
||||||
|
|
||||||
|
|
||||||
####### Gather #######
|
####### Gather #######
|
||||||
@@ -23,26 +23,24 @@
|
|||||||
- name: Main | Gather
|
- name: Main | Gather
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- include_tasks: facts/general/gather.yml
|
- include_tasks: facts/general/gather.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/provision_config.yml
|
- include_tasks: tasks/general/acct_mgmt/provision_config.yml
|
||||||
|
|
||||||
- include_tasks: facts/general/system.yml
|
- include_tasks: facts/general/system.yml
|
||||||
- include_tasks: facts/general/package.yml
|
- include_tasks: facts/general/package.yml
|
||||||
- include_tasks: facts/general/service.yml
|
- include_tasks: facts/general/service.yml
|
||||||
- include_tasks: facts/general/user.yml
|
- include_tasks: facts/general/user.yml
|
||||||
|
|
||||||
- include_tasks: tasks/general/tests/internet_check.yml
|
- include_tasks: tasks/general/tests/internet_check.yml
|
||||||
|
|
||||||
|
|
||||||
####### Start #######
|
####### Start #######
|
||||||
- name: Main | Start
|
- name: Main | Start
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Main | Start | Notify | Touch File
|
- include_tasks: tasks/general/acct_mgmt/notify.yml
|
||||||
include_tasks: tasks/general/acct_mgmt/notify.yml
|
vars:
|
||||||
|
notify_message: "Started"
|
||||||
- name: Main | Start | Notify | Add Message
|
|
||||||
shell : echo "'Ansible' 'Provisioning started @ `date`'" >> "{{ notify_log_file }}"
|
|
||||||
|
|
||||||
when: workstation
|
when: workstation
|
||||||
|
|
||||||
@@ -51,37 +49,37 @@
|
|||||||
- name: Main | NixOS Setup
|
- name: Main | NixOS Setup
|
||||||
block:
|
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
|
# 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.
|
# and use blocks within the General area for NixOS vs not-NixOS.
|
||||||
- include_tasks: tasks/general/software/swap.yml
|
- include_tasks: tasks/general/software/swap.yml
|
||||||
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/groups.yml
|
- include_tasks: tasks/general/acct_mgmt/groups.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/users.yml
|
- include_tasks: tasks/general/acct_mgmt/users.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/sudo.yml
|
- include_tasks: tasks/general/acct_mgmt/sudo.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/doas.yml
|
- include_tasks: tasks/general/acct_mgmt/doas.yml
|
||||||
|
|
||||||
- include_tasks: tasks/general/scripts/root.yml
|
- include_tasks: tasks/general/scripts/root.yml
|
||||||
- include_tasks: tasks/general/scripts/user.yml
|
- include_tasks: tasks/general/scripts/user.yml
|
||||||
- include_tasks: tasks/general/scripts/install.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
|
# 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
|
# time to start looking into home-manager but still not wanting to
|
||||||
# maintain two different GNOME setups. HMMMM!
|
# maintain two different GNOME setups. HMMMM!
|
||||||
- include_tasks: tasks/workstation/shared/settings/gnome.yml
|
- include_tasks: tasks/workstation/shared/settings/gnome.yml
|
||||||
when: workstation
|
when: workstation
|
||||||
|
|
||||||
# Try including these. Really need to get NixOS working with the rest!
|
# 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/software/telegraf.yml # "Could not find a module for unknown.""
|
||||||
- include_tasks: tasks/general/tests/services.yml
|
- include_tasks: tasks/general/tests/services.yml
|
||||||
- include_tasks: tasks/general/tests/lynis.yml
|
- include_tasks: tasks/general/tests/lynis.yml
|
||||||
- include_tasks: tasks/general/tests/nmap.yml
|
- include_tasks: tasks/general/tests/nmap.yml
|
||||||
|
|
||||||
- name: NixOS | Complete
|
- name: NixOS | Complete
|
||||||
meta: end_play
|
meta: end_play
|
||||||
|
|
||||||
when: ansible_distribution == "NixOS"
|
when: ansible_distribution == "NixOS"
|
||||||
|
|
||||||
@@ -91,36 +89,36 @@
|
|||||||
- name: Main | General Setup
|
- name: Main | General Setup
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/swap.yml
|
- include_tasks: tasks/general/software/swap.yml
|
||||||
- include_tasks: tasks/general/software/packages.yml
|
- include_tasks: tasks/general/software/packages.yml
|
||||||
- include_tasks: tasks/general/software/services.yml
|
- include_tasks: tasks/general/software/services.yml
|
||||||
- include_tasks: tasks/general/software/sendmail.yml
|
- include_tasks: tasks/general/software/sendmail.yml
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/aur.yml
|
- include_tasks: tasks/general/software/aur.yml
|
||||||
when: ansible_pkg_mgr == "pacman"
|
when: internet and ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
# Gather again in case missing programs have now been installed.
|
# Gather again in case missing programs have now been installed.
|
||||||
- include_tasks: facts/general/gather.yml
|
- 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/groups.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/users.yml
|
- include_tasks: tasks/general/acct_mgmt/users.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/sudo.yml
|
- include_tasks: tasks/general/acct_mgmt/sudo.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/doas.yml
|
- include_tasks: tasks/general/acct_mgmt/doas.yml
|
||||||
|
|
||||||
- include_tasks: tasks/general/scripts/root.yml
|
- include_tasks: tasks/general/scripts/root.yml
|
||||||
- include_tasks: tasks/general/scripts/user.yml
|
- include_tasks: tasks/general/scripts/user.yml
|
||||||
- include_tasks: tasks/general/scripts/install.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
|
# TODO Need to refactor. Maybe tasks/general/cron/freebsd.yml
|
||||||
- include_tasks: tasks/workstation/freebsd/cron/ansible.yml
|
- include_tasks: tasks/workstation/freebsd/cron/ansible.yml
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/metasploit.yml
|
- include_tasks: tasks/general/software/metasploit.yml
|
||||||
|
|
||||||
when: provision
|
when: provision
|
||||||
|
|
||||||
@@ -130,77 +128,81 @@
|
|||||||
- name: Main | Workstation Setup
|
- name: Main | Workstation Setup
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- include_tasks: facts/workstation/package.yml
|
- include_tasks: facts/workstation/package.yml
|
||||||
|
|
||||||
## Desktop Environments ##
|
## Desktop Environments ##
|
||||||
- include_tasks: tasks/workstation/freebsd/software/gpu.yml
|
- include_tasks: tasks/workstation/freebsd/software/gpu.yml
|
||||||
when: ansible_system == "FreeBSD" and bsd_gpu
|
when: ansible_system == "FreeBSD" and bsd_gpu
|
||||||
|
|
||||||
# Window Managers without true Desktop Environments #
|
# Window Managers without true Desktop Environments #
|
||||||
- include_tasks: tasks/workstation/shared/software/dwm.yml
|
- include_tasks: tasks/workstation/shared/software/dwm.yml
|
||||||
- include_tasks: tasks/workstation/shared/software/i3.yml
|
- include_tasks: tasks/workstation/shared/software/i3.yml
|
||||||
|
|
||||||
# Polished Desktop Environments #
|
# Polished Desktop Environments #
|
||||||
- include_tasks: tasks/workstation/freebsd/software/gnome.yml
|
- include_tasks: tasks/workstation/freebsd/software/gnome.yml
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- name: Main | Workstation | Fancy Desktop Environments
|
- name: Main | Workstation | Fancy Desktop Environments
|
||||||
block:
|
block:
|
||||||
- include_tasks: tasks/workstation/linux/software/gnome.yml
|
- include_tasks: tasks/workstation/linux/software/gnome.yml
|
||||||
when: ansible_service_mgr == "systemd"
|
when: ansible_service_mgr == "systemd"
|
||||||
- include_tasks: tasks/workstation/linux/software/cinnamon.yml
|
- include_tasks: tasks/workstation/linux/software/cinnamon.yml
|
||||||
- include_tasks: tasks/workstation/linux/software/lxqt.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
|
|
||||||
when: ansible_system == "Linux"
|
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
|
- name: Main | Workstation Setup | Linux
|
||||||
when: rdp
|
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
|
- include_tasks: tasks/workstation/freebsd/software/packages.yml
|
||||||
when: vnc
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/shared/settings/services.yml
|
- include_tasks: tasks/workstation/mac-os/software/brew.yml
|
||||||
- include_tasks: tasks/workstation/shared/settings/templates.yml
|
when: ansible_system == "Darwin"
|
||||||
|
|
||||||
## Final Tasks (SLOW) ##
|
## Configuration Tasks ##
|
||||||
- block:
|
- name: Main | Workstation Setup | Configuration
|
||||||
- include_tasks: tasks/workstation/linux/software/flatpaks.yml
|
block:
|
||||||
when: flatpak_distro
|
- include_tasks: tasks/workstation/shared/settings/gnome.yml
|
||||||
- include_tasks: tasks/workstation/linux/software/java.yml
|
- include_tasks: tasks/workstation/shared/settings/cinnamon.yml
|
||||||
- include_tasks: tasks/workstation/linux/software/flutter.yml
|
- include_tasks: tasks/workstation/shared/settings/xdg_autostart.yml
|
||||||
- include_tasks: tasks/workstation/linux/software/android.yml
|
|
||||||
when: ansible_system == "Linux"
|
- 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
|
when: workstation
|
||||||
|
|
||||||
@@ -251,26 +253,26 @@
|
|||||||
- name: Main | Server Setup
|
- name: Main | Server Setup
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/services.yml
|
- include_tasks: tasks/server/software/services.yml
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- include_tasks: tasks/server/software/certbot.yml
|
- include_tasks: tasks/server/software/certbot.yml
|
||||||
- include_tasks: tasks/server/cron/certbot.yml
|
- include_tasks: tasks/server/cron/certbot.yml
|
||||||
when: certbot
|
when: certbot
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- include_tasks: tasks/server/software/onlyoffice.yml
|
- include_tasks: tasks/server/software/onlyoffice.yml
|
||||||
when: onlyoffice
|
when: onlyoffice
|
||||||
- include_tasks: tasks/server/software/influxdb1.yml
|
- include_tasks: tasks/server/software/influxdb1.yml
|
||||||
when: influxdb1
|
when: influxdb1
|
||||||
- include_tasks: tasks/server/software/influxdb2.yml
|
- include_tasks: tasks/server/software/influxdb2.yml
|
||||||
when: influxdb2
|
when: influxdb2
|
||||||
- include_tasks: tasks/server/software/grafana.yml
|
- include_tasks: tasks/server/software/grafana.yml
|
||||||
when: grafana
|
when: grafana
|
||||||
when: ansible_pkg_mgr == "apt"
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/hugo.yml
|
- include_tasks: tasks/server/software/hugo.yml
|
||||||
when: hugo
|
when: hugo
|
||||||
|
|
||||||
when: server
|
when: server
|
||||||
|
|
||||||
@@ -280,17 +282,19 @@
|
|||||||
- name: Main | Reporting
|
- name: Main | Reporting
|
||||||
block:
|
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/services.yml
|
||||||
- include_tasks: tasks/general/tests/lynis.yml
|
- include_tasks: tasks/general/tests/lynis.yml
|
||||||
- include_tasks: tasks/general/tests/nmap.yml
|
- include_tasks: tasks/general/tests/nmap.yml
|
||||||
|
|
||||||
|
|
||||||
####### Finish #######
|
####### Finish #######
|
||||||
- name: Main | Finish
|
- name: Main | Finish
|
||||||
block:
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user