Skip to content

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:

$ xcode-select --install

Agree Xcode's license

You need to agree to Xcode's license.

$ sudo xcodebuild -license

Starting from a brand-new machine.

  1. Download this repository to your local drive.

  2. Install requirements:

    Create a temporary virtualenv, activate the virtualenv and install ansible:

    /usr/bin/python3 -m venv .venv. .venv/bin/activatepip3 install ansibleInstalled

  3. 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

  4. Copy inventory.example into inventory and set the desired <target-os> (macos):

    [<target-os>]
    127.0.0.1 ansible_connection=local ansible_python_interpreter=/usr/bin/python3
    

    to e.g.:

    [macos]
    127.0.0.1 ansible_connection=local ansible_python_interpreter=/usr/bin/python3
    
  5. 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)

  1. Clone this repository.

  2. Install dependencies:

    poetry install --no-rootUsing python3.10 (3.10.8)
    Creating virtualenv .venv
    Installing dependencies from lock file

    Package operations: 97 installs, 0 updates, 0 removals

    ...

  3. Activate the virtual environment:

    poetry shellUsing python3.10 (3.10.8)
    Spawning shell within .venv
    (dev-setup)$

  4. Install required Ansible roles:

    inv galaxy-installStarting galaxy role install process
    ...
    Starting galaxy collection install process
    ...
    fedejaure.dev_setup was installed successfully

  5. 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'

    1. Go to System Preferences > Sharing.
    2. Enable 'Remote Login'.
    You can also enable remote login on the command line

    sudo systemsetup -setremotelogin on

  6. 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]

    ...

Linux

Warning

Linux support is in development and will be added in a future release.