I want to be able to run a task only when I pass a tag to the playbook. 
 Namely, I want to have a tag that allows for decoming a user and one would 
normally never run that as part of normal playbook run.  

I found the conditional 'what: tags is defined' but it doesnt seem to work. 
 My task looks like this...

- name: decom user

  shell:  echo test

  when: tag is defined

  tags: decom


When I run it, I get this in the verbose output...


TASK [vyatta : decom user] 
*****************************************************

skipping: [10.10.10.54] => {"changed": false, "skip_reason": "Conditional 
check failed", "skipped": true}


I cant sort out why this is failing.  Im passing the tag as part of the 
run...


ansible-playbook test.yml -t decom -v


Any ideas?  Thanks!



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/615adb01-e32d-4463-8304-b4207a0f9f12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to