Ansible playbooks for setting up mac
git clone https://github.com/tensult/mac-setup-playbooks.git
Copy the folder and paste it to the Desktop.
Open the terminal and type in the following commands:
- $ cd mac-setup-playbooks
- $ ./install.sh Enter password when prompted.
The shell script will install Homebrew, Git, Pip, Ansible and AWS CLI with it's commands. Then it'll run the ansible playbook called mainplaybook which will install Firefox, Google Chrome, Postman, Slack and Visual Code Studio. The playbook will download the application installer from the website and depending on the type of file it will carry out the required installation steps.
You can reconfigure the code to install other apps based on your needs by editing the following:-
- Go the playbooks folder. Create a new YAML file with the following details
---
- hosts: local
become: yes
vars:
app_name: <Enter app nam here>
app_url: <Enter app download URL here>
installer_type: app
install_method:
download_file_type:
roles:
- setup
- installer
- cleanup
Depending on the type of file being downloaded enter the download_file_type as "app", "dmg" or "zip" Depening on the file obtained after unzipping, enter the install_method as "dmg", "app" or "pkg".
- Save the YAML file and insert the following line into the mainplaybook YAML file
- import_playbook : playbooks/<app-playbook>.yml
- Run the install shell script in the terminal to run the ansible code.
$ ./install.sh