#!/bin/bash # Define OneLab along with the Ansible logs directory directory="../onelab/logs/ansible" # Check if the directory structure exists if [ ! -d "$directory" ]; then # If it doesn't exist, create it mkdir -p "$directory" fi # To allow writing the logs chown -R $USER "$directory" ANSIBLE_LOG_PATH="$directory/$(date +%F)-ansible.log" ansible-playbook ./app/playbooks/install.yml