Skip to content

Instantly share code, notes, and snippets.

@bugcy013
Last active March 21, 2019 17:40
Show Gist options
  • Save bugcy013/c8c4ac81c5ea603b628fcf5c0a6ca24c to your computer and use it in GitHub Desktop.
Save bugcy013/c8c4ac81c5ea603b628fcf5c0a6ca24c to your computer and use it in GitHub Desktop.
Run Ansible Role
---
# Runs an ansible role
# Usage:
# ansible-playbook ./run_role.yml -e "role=dv_sysctl target=localhost"
# ansible-playbook ./run_role.yml -e "role=dv_inventory_update target=Hera" -i inventories/dv_inventry.py
# ansible-playbook ./run_role.yml -e "role=dv_inventory_update target=all" -i inventories/dv_inventry.py -l 172.16.30.150
#
- hosts: "{{ target }}"
become: "{{ sudo }}"
gather_facts: True
remote_user: rdansible
roles:
- "{{ role }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment