Hi,

I keep getting errors related to my 'when' conditionals in my following 
playbook:

---
- hosts: all

  become: yes

  vars_prompt:
   - name: "remove_user"
     prompt: "Type name of user to delete:"
     private: no
#     when: remove_user != "root"

  tasks:

   - name: Create new user account
     command: "userdel {{ remove_user }}"
        when: "{{remove_user}}" != "root"

Ansible prompts me that my not equals indicator needs to be in quotes but I 
know that's wrong. I'm trying to add a check to where the playbook won't 
execute if the root account is specified. Any ideas?

-- 
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/e16c9991-a005-4f51-8fc1-6376c356c146%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to