mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-05-18 10:40:33 +02:00
Added datetime logs
This commit is contained in:
parent
2478e4013f
commit
9c45d070b4
4
main.py
4
main.py
@ -10,6 +10,8 @@ def run_ansible_vault(action, filename, password_file):
|
|||||||
subprocess.run(cmd, check=True)
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
def run_ansible_playbook(inventory: str, playbook: str, modes: dict, limit: str = None, password_file: str = None, verbose: int = 0, skip_tests: bool = False):
|
def run_ansible_playbook(inventory: str, playbook: str, modes: dict, limit: str = None, password_file: str = None, verbose: int = 0, skip_tests: bool = False):
|
||||||
|
start_time = datetime.datetime.now().isoformat()
|
||||||
|
print(f"\n▶️ Script started at: {start_time}\n")
|
||||||
print("\n🛠️ Building project (make build)...\n")
|
print("\n🛠️ Building project (make build)...\n")
|
||||||
subprocess.run(["make", "build"], check=True)
|
subprocess.run(["make", "build"], check=True)
|
||||||
|
|
||||||
@ -39,6 +41,8 @@ def run_ansible_playbook(inventory: str, playbook: str, modes: dict, limit: str
|
|||||||
print("\n🚀 Launching Ansible Playbook...\n")
|
print("\n🚀 Launching Ansible Playbook...\n")
|
||||||
subprocess.run(cmd, check=True)
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
|
end_time = datetime.datetime.now().isoformat()
|
||||||
|
print(f"\n✅ Script ended at: {end_time}\n")
|
||||||
def main():
|
def main():
|
||||||
# Change to script dir to execute all folders relative to their
|
# Change to script dir to execute all folders relative to their
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user