Skip to content

Instantly share code, notes, and snippets.

@andrewdaluz
Last active May 9, 2019 21:15
Show Gist options
  • Save andrewdaluz/634f8517a18585ee05974d8427b82ea8 to your computer and use it in GitHub Desktop.
Save andrewdaluz/634f8517a18585ee05974d8427b82ea8 to your computer and use it in GitHub Desktop.
Ansible

Ansible Playbook complete option

You can simply define the key to use directly when running the command

ansible-playbook \
        \ # Super verbose output incl. SSH-Details:
    -vvvv \
        \ # The Server to target: (Keep the trailing comma!)
    -i "000.000.0.000," \
        \ # Define the key to use:
    --private-key=~/.ssh/id_rsa_ansible \
        \ # The `env` var is needed if `python` is not available:
    -e 'ansible_python_interpreter=/usr/bin/python3' \ # Needed if `python` is not available
        \ # Dry–Run:
    --check \
    deploy.yml

Copy/ Paste:

ansible-playbook -vvvv --private-key=/Users/you/.ssh/your_key deploy.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment