Compare commits

..
3 Commits
6 changed files with 79 additions and 19 deletions

No files matched your search

+19 -18
View File
@@ -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
+3
View File
@@ -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 }}"
+1 -1
View File
@@ -10,7 +10,7 @@
- name: General | Cron | Ansible | Facts
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
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