Skip to content

Instantly share code, notes, and snippets.

@rsvalerio
Created August 19, 2015 03:45
Show Gist options
  • Save rsvalerio/45c5e1403a6e81fdff1d to your computer and use it in GitHub Desktop.
Save rsvalerio/45c5e1403a6e81fdff1d to your computer and use it in GitHub Desktop.
Shortcut to run playbooks wihtout the need of -i 'localhost,'
#!/bin/bash
ansible-playbook "$1" -i 'localhost,'
@rsvalerio
Copy link
Author

Create a synlink in /usr/local/bin to this file then:

ansible-playbook-local local-playbook.yml

Example local-playbook.yml:


---
- hosts: all
  connection: local
  sudo: false
  gather_facts: false

  vars_prompt:

    - name: "my_var"
      prompt: "Wahts up?"
      private: no

  tasks:
  - name: Just running
    command: 'echo {{my_var}}'

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