Compare commits

...
3 Commits
6 changed files with 73 additions and 13 deletions

No files matched your search

+13 -12
View File
@@ -9,8 +9,19 @@
tasks: 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 ####### ####### Gather #######
# Load facts for all systems. # Load facts for all systems.
- name: Main | Gather
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
@@ -35,13 +46,11 @@
####### NixOS ####### ####### NixOS #######
# Install the .nix files and do a little data setup. # Install the .nix files and do a little data setup.
- 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
@@ -77,7 +86,6 @@
####### General ####### ####### General #######
# Basic setup for all enabled systems. # Basic setup for all enabled systems.
- name: Main | General Setup - name: Main | General Setup
block: block:
@@ -117,7 +125,6 @@
####### Workstations ####### ####### Workstations #######
# Additional setup for systems with GUI. # Additional setup for systems with GUI.
- name: Main | Workstation Setup - name: Main | Workstation Setup
block: block:
@@ -163,7 +170,6 @@
- include_tasks: tasks/workstation/mac-os/software/brew.yml - include_tasks: tasks/workstation/mac-os/software/brew.yml
when: ansible_system == "Darwin" when: ansible_system == "Darwin"
## Configuration Tasks ## ## Configuration Tasks ##
- block: - block:
- include_tasks: tasks/workstation/shared/settings/gnome.yml - include_tasks: tasks/workstation/shared/settings/gnome.yml
@@ -240,7 +246,6 @@
####### Servers ####### ####### Servers #######
# Easy to deploy server configurations. # Easy to deploy server configurations.
- name: Main | Server Setup - name: Main | Server Setup
block: block:
@@ -284,10 +289,6 @@
- name: Main | Finish - name: Main | Finish
block: 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 - include_tasks: tasks/general/tests/lock_remove.yml
shell : echo "'Ansible' 'Provisioning finished @ `date`'" >> "{{ notify_log_file }}"
when: workstation == true
+3
View File
@@ -6,3 +6,6 @@
loop: loop:
- touch "{{ notify_log_file }}" - touch "{{ notify_log_file }}"
- chmod 777 "{{ notify_log_file }}" - chmod 777 "{{ notify_log_file }}"
- name: General | Notify | Add Message
shell : echo "'Ansible' 'Provisioning finished @ `date`'" >> "{{ notify_log_file }}"
+1 -1
View File
@@ -10,7 +10,7 @@
- name: General | Cron | Ansible | Facts - name: General | Cron | Ansible | Facts
set_fact: set_fact:
ansible_cron_log: "~/{{ ansible_hostname }}.ansible-pull.latest.log" ansible_cron_log: "~/{{ ansible_hostname }}.ansible-pull.`date +'%Y%m%d-%H%M%S'`.log"
- name: General | Cron | Ansible | Create Subscriber Job - name: General | Cron | Ansible | Create Subscriber Job
cron: cron:
+16
View File
@@ -0,0 +1,16 @@
---
# 20260929 - Hyperling
# Ensure an existing run is not active, otherwise bail.
- name: General | Tests | Existing Run | Facts
set_fact:
lock_file: "/tmp/ansible-playbook.lock"
- name: General | Tests | Existing Run | Check
stat:
path: "{{ lock_file }}"
register: lock_exists
- name: General | Tests | Existing Run | Exit
meta: end_play
when: lock_exists.stat.exists
+22
View File
@@ -0,0 +1,22 @@
---
# 20260929 - Hyperling
# Ensure an existing run is not active, otherwise bail.
- name: General | Tests | Existing Run | Lock | Create
shell: "date +'%Y-%m-%d %H:%M:%S' >> {{lock_file }}"
- name: General | Tests | Existing Run | Lock | Create
file:
name: "{{ lock_file }}"
mode: '0777'
- name: General | Tests | Existing Run | Lock | Create | Check
stat:
path: "{{ lock_file }}"
register: lock_exists
- name: General | Tests | Existing Run | Lock | Create | Fail
fail:
msg: "ERROR: Lock file does not exist."
when: not lock_exists.stat.exists
+18
View File
@@ -0,0 +1,18 @@
---
# 20260929 - Hyperling
# Ensure an existing run is not active, otherwise bail.
- name: General | Tests | Existing Run | Lock | Remove
file:
name: "{{ lock_file }}"
state: absent
- name: General | Tests | Existing Run | Lock | Remove | Check
stat:
path: "{{ lock_file }}"
register: lock_exists
- name: General | Tests | Existing Run | Lock | Remove | Fail
fail:
msg: "ERROR: Lock file still exists!"
when: lock_exists.stat.exists