Files
env-ansible/tasks/header.yml
T

163 lines
5.1 KiB
YAML

---
####### Lock #######
# Ensure a process is not already running.
- name: Main | Lock
block:
- name: Main | Lock | Check
ansible.builtin.include_tasks: tasks/general/tests/lock_check.yml
- name: Main | Lock | Create
ansible.builtin.include_tasks: tasks/general/tests/lock_create.yml
####### Gather #######
# Load facts for all systems.
- name: Main | Gather
block:
- name: Main | Gather | Facts
ansible.builtin.include_tasks: facts/general/gather.yml
- name: Main | Gather | Account Management
ansible.builtin.include_tasks: tasks/general/acct_mgmt/provision_config.yml
- name: Main | Gather | System
ansible.builtin.include_tasks: facts/general/system.yml
- name: Main | Gather | Package
ansible.builtin.include_tasks: facts/general/package.yml
- name: Main | Gather | Service
ansible.builtin.include_tasks: facts/general/service.yml
- name: Main | Gather | User
ansible.builtin.include_tasks: facts/general/user.yml
- name: Main | Gather | Internet Check
ansible.builtin.include_tasks: tasks/general/tests/internet_check.yml
####### Start #######
- name: Main | Start
block:
- name: Main | Start | Notify
ansible.builtin.include_tasks: tasks/general/acct_mgmt/notify.yml
vars:
notify_message: "Provisioning Started"
when: workstation
####### NixOS #######
# Install the .nix files and do a little data setup.
- name: Main | NixOS
block:
- name: Main | NixOS | Config
ansible.builtin.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.
- name: Main | NixOS | Swap
ansible.builtin.include_tasks: tasks/general/software/swap.yml
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/groups.yml
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/users.yml
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/sudo.yml
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/doas.yml
- ansible.builtin.include_tasks: tasks/general/scripts/root.yml
- ansible.builtin.include_tasks: tasks/general/scripts/user.yml
- ansible.builtin.include_tasks: tasks/general/scripts/install.yml
- ansible.builtin.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!
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/gnome.yml
when: workstation
# Try including these. Really need to get NixOS working with the rest!
#- ansible.builtin.include_tasks: tasks/general/software/telegraf.yml # "Could not find a module for unknown.""
- ansible.builtin.include_tasks: tasks/general/tests/services.yml
- ansible.builtin.include_tasks: tasks/general/tests/lynis.yml
- ansible.builtin.include_tasks: tasks/general/tests/nmap.yml
- name: Main | NixOS | Complete
ansible.builtin.meta: end_play
when: ansible_distribution == "NixOS"
####### General #######
# Basic setup for all enabled systems.
- name: Main | General
block:
- name: Main | General | Swap
ansible.builtin.include_tasks: tasks/general/software/swap.yml
- name: Main | General | runit
ansible.builtin.include_tasks: tasks/general/software/runit.yml
- name: Main | General | Packages
ansible.builtin.include_tasks: tasks/general/software/packages.yml
when: internet
- name: Main | General | Services
ansible.builtin.include_tasks: tasks/general/software/services.yml
- name: Main | General | Sendmail
ansible.builtin.include_tasks: tasks/general/software/sendmail.yml
when: ansible_system == "FreeBSD"
and internet
- ansible.builtin.include_tasks: tasks/general/software/aur.yml
when: internet and ansible_pkg_mgr == "pacman"
# Gather again in case missing programs have now been installed.
- ansible.builtin.include_tasks: facts/general/gather.yml
- ansible.builtin.include_tasks: tasks/general/settings/keyboard.yml
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/groups.yml
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/users.yml
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/sudo.yml
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/doas.yml
when: internet
- ansible.builtin.include_tasks: tasks/general/software/env-shared.yml
when: internet
- ansible.builtin.include_tasks: tasks/general/scripts/root.yml
- ansible.builtin.include_tasks: tasks/general/scripts/user.yml
- ansible.builtin.include_tasks: tasks/general/scripts/install.yml
- ansible.builtin.include_tasks: tasks/general/cron/ansible.yml
# TODO Need to refactor. Maybe tasks/general/cron/freebsd.yml
- ansible.builtin.include_tasks: tasks/workstation/freebsd/cron/ansible.yml
when: ansible_system == "FreeBSD"
- ansible.builtin.include_tasks: tasks/general/software/metasploit.yml
when: internet
when: provision