I am two days now into ansible and I love everything it can do. My problem 
is that ansible does not like my yaml :-). My below playbook keeps throwing 
errors when I run a --check on it. Basically I want the update rpm pulled 
down and put in /tmp. Then I want to check if a user account exists. If not 
I want it to stop and inform me that the user doesn't exist. I looked at 
the fail instructions and I followed it but I guess I am missing something. 
Thank you in advanced for your help. 


*error*
*The offending line appears to be:*

*- fail:*
*msg: "User Splunk does not exist, stopping install"*
*^ here*

playbook
- name: install splunk forwarder Binaries
  hosts: all
  gather_facts: True

  tasks:
     - name: download splunk forwarder RPM
       get_url:
       url: http://server/RPM/update-6.5.3-36937ad027d4-linux-2.6-x86_64.rpm
       dest: /tmp/update-6.5.3-36937ad027d4-linux-2.6-x86_64.rpm
       mode: 777

       action: shell /usr/bin/getent passwd nix| /usr/bin/wc -l | tr -d ''
       register: user_exist
#       when: user_exist.stdout == 0

- fail:
msg: "User nix does not exist, stopping install"
when: user_exist.stdout == 0

-- 
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/bd089f80-3438-46a4-8278-a22756e2d3e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to