Skip to content

Running Playbooks

Use the root README for installation and initial setup, then use the commands below when you want to run playbooks/setup.yml directly from the repository.

  • Run the commands from the repository root.
  • Install host dependencies first as described in the root README.
  • Use --check first when you want a dry run before applying changes.
  • Adjust the inventory or pass extra variables on the CLI as needed for your environment.
  • When using sailwright provision, configure additional local or Git-backed role roots with Ansible Role Sources.

For the wrapper-based localhost flow, use Local Provisioning.

On macOS or Linux, direct localhost commands look like this.

Dry run:

Terminal window
ansible-playbook playbooks/setup.yml -i inventory/localhost.yaml --check

Apply:

Terminal window
ansible-playbook playbooks/setup.yml -i inventory/localhost.yaml

Dry run:

Terminal window
HOST="192.168.179.21"
cat <<EOF > inventory/remote.yml
all:
hosts:
$HOST:
ansible_user: admin
EOF
ansible-playbook playbooks/setup.yml -i inventory/remote.yml -l "$HOST" --ask-pass --ask-become-pass --check

Apply:

Terminal window
ansible-playbook playbooks/setup.yml -i inventory/remote.yml -l "$HOST" --ask-pass --ask-become-pass

If the Windows target does not already have remote access configured, start with Windows Ansible Access.

If you want the wrapper-managed localhost flow instead of direct ansible-playbook, use Local Provisioning.

If you run ansible-playbook directly with inventory/localhost_windows_winrm.yml, you are responsible for supplying your own secure WinRM connection variables and credentials.

If you run ansible-playbook directly with inventory/localhost_windows_ssh.yml, you are responsible for supplying your own secure SSH user, key, and shell variables. Make sure the Windows OpenSSH server is configured with HKLM:\SOFTWARE\OpenSSH\DefaultShell set to C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe as described in Windows Ansible Access, or Ansible may connect through cmd.exe instead of PowerShell.

Terminal window
$SailwrightPath = "C:\path\to\sailwright"
C:\\cygwin64\\bin\\bash.exe -l -c "cd $SailwrightPath && ansible-playbook playbooks/setup.yml -i inventory/localhost_windows_ssh.yml -l windows_host -e ansible_user=admin -e ansible_ssh_private_key_file=/path/to/key -e ansible_shell_type=powershell -e ansible_shell_executable=powershell.exe -vvv"