Skip to content

Commit

Permalink
Add tags options
Browse files Browse the repository at this point in the history
Add -t OR --tags options to pass to ansible-playbook
  • Loading branch information
micaelmalta committed Nov 10, 2014
1 parent 6a85f3e commit a33dccf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/ansible-pull
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def main(args):
help="vault password file")
parser.add_option('-K', '--ask-sudo-pass', default=False, dest='ask_sudo_pass', action='store_true',
help='ask for sudo password')
parser.add_option('-t', '--tags', dest='tags', default=False,
help='only run plays and tasks tagged with these values')
options, args = parser.parse_args(args)

hostname = socket.getfqdn()
Expand Down Expand Up @@ -214,6 +216,8 @@ def main(args):
cmd += ' -e "%s"' % ev
if options.ask_sudo_pass:
cmd += ' -K'
if options.tags:
cmd += ' -t "%s"' % options.tags
os.chdir(options.dest)

# RUN THE PLAYBOOK COMMAND
Expand Down

0 comments on commit a33dccf

Please sign in to comment.