Usage Guide¶
This guide provides detailed instructions on how to set up and run the Ansible playbooks on the differents supported targets.
MacOS¶
Ensure Apple's command line tools are installed
On a terminal launch the installer:
Starting from a brand-new machine.¶
-
Download this repository to your local drive.
-
Install requirements:
Create a temporary virtualenv, activate the virtualenv and install ansible:
/usr/bin/python3 -m venv .venv. .venv/bin/activatepip3 install ansibleInstalled -
Install required Ansible roles:
ansible-galaxy install -r requirements.ymlStarting galaxy role install process
...
Starting galaxy collection install process
...
fedejaure.dev_setup was installed successfully -
Copy
inventory.example
intoinventory
and set the desired<target-os>
(macos
):to e.g.:
-
Run the playbook:
ansible-playbook playbooks/main.yml --ask-become-pass -i inventoryBECOME password[defaults to SSH password]:
PLAY [Mac OSX Playbook] ***************************************************
TASK [Gathering Facts] ****************************************************
ok: [127.0.0.1]
...
Starting from a configured machine (Configuring a remote one)¶
-
Clone this repository.
-
Install dependencies:
poetry install --no-rootUsing python3.11 (3.11.11)
Creating virtualenv .venv
Installing dependencies from lock file
Package operations: 97 installs, 0 updates, 0 removals
... -
Activate the virtual environment:
poetry shellUsing python3.11 (3.11.11)
Spawning shell within .venv
(dev-setup)$ -
Install required Ansible roles:
inv galaxy-installStarting galaxy role install process
...
Starting galaxy collection install process
...
fedejaure.dev_setup was installed successfully -
Configure the
inventory
file and set the desired<target-os>
(macos
):[<target-os>] <ip address or hostname of the target> ansible_user=<target user> ansible_python_interpreter=/usr/bin/python3
Enable 'Remote Login'
- Go to System Preferences > Sharing.
- Enable 'Remote Login'.
You can also enable remote login on the command line
sudo systemsetup -setremotelogin on -
Run the playbook:
inv playbook --ask-pass --ask-become-passSSH password:
BECOME password[defaults to SSH password]:
PLAY [Mac OSX Playbook] ***************************************************
TASK [Gathering Facts] ****************************************************
ok: [127.0.0.1]
...
Homebrew Cask Apps Failing with 'sudo'?
If you're installing Homebrew Cask apps on a remote macOS machine and encounter permission issues requiring sudo
, a workaround is available — but it's not recommended for general use.
You can try:
- Defining
ansible_become_password
directly in yourinventory
file. - Reviewing this related GitHub issue for context and alternatives.
⚠️ This workaround is only suggested if you're stuck and working on a remote Mac. It is better to ensure proper local privilege escalation via --ask-become-pass
whenever possible.
Linux¶
Warning
Linux support is in development and will be added in a future release.