From 1c20173b8b9feb12c25ee48a89c366b246e6a8c8 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 29 Sep 2026 09:48:33 -0700 Subject: [PATCH] main, add lock file scripts and clean some areas up. --- local.yml | 37 +++++++++++++++--------------- tasks/general/acct_mgmt/notify.yml | 3 +++ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/local.yml b/local.yml index 8dbee3d..a226854 100644 --- a/local.yml +++ b/local.yml @@ -9,16 +9,27 @@ tasks: + ####### Lock ####### + # Ensure a process is not already running. + - name: Main | Lock + block: + + - include_tasks: tasks/general/tests/lock_check.yml + - include_tasks: tasks/general/tests/lock_create.yml + + ####### Gather ####### # Load facts for all systems. + - 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 ####### Start ####### @@ -35,13 +46,11 @@ ####### NixOS ####### # Install the .nix files and do a little data setup. - - name: Main | NixOS Setup block: - 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 @@ -77,7 +86,6 @@ ####### General ####### # Basic setup for all enabled systems. - - name: Main | General Setup block: @@ -117,7 +125,6 @@ ####### Workstations ####### # Additional setup for systems with GUI. - - name: Main | Workstation Setup block: @@ -163,7 +170,6 @@ - include_tasks: tasks/workstation/mac-os/software/brew.yml when: ansible_system == "Darwin" - ## Configuration Tasks ## - block: - include_tasks: tasks/workstation/shared/settings/gnome.yml @@ -240,7 +246,6 @@ ####### Servers ####### # Easy to deploy server configurations. - - name: Main | Server Setup block: @@ -284,10 +289,6 @@ - name: Main | Finish block: - - name: Main | Finish | Notify | Touch File - include_tasks: tasks/general/acct_mgmt/notify.yml + - include_tasks: tasks/general/acct_mgmt/notify.yml - - name: Main | Finish | Notify | Add Message - shell : echo "'Ansible' 'Provisioning finished @ `date`'" >> "{{ notify_log_file }}" - - when: workstation == true + - include_tasks: tasks/general/tests/lock_remove.yml diff --git a/tasks/general/acct_mgmt/notify.yml b/tasks/general/acct_mgmt/notify.yml index 462ddcb..546b84c 100644 --- a/tasks/general/acct_mgmt/notify.yml +++ b/tasks/general/acct_mgmt/notify.yml @@ -6,3 +6,6 @@ loop: - touch "{{ notify_log_file }}" - chmod 777 "{{ notify_log_file }}" + +- name: General | Notify | Add Message + shell : echo "'Ansible' 'Provisioning finished @ `date`'" >> "{{ notify_log_file }}"