Hello All,

I've been working with Ansible a few weeks. I am trying to create a list of 
yum file updates. I ordinarily run 
"sudo yum update --assume --changelog | tee /tmp/hostname | cut -d'.' 
-f1`.txt" 
to get the update list created in the tmp directory. 

In the play book I have this:
- name: create yum update list on server
    command: yum update --assumeno --changelog | tee /tmp/`hostname | cut 
-d'.' -f1`.txt


Partial output i get is:
fatal: [rvavpmgt02.asd.local]: FAILED! => {"changed": true, "cmd": ["yum", 
"update", "--assumeno", "--changelog", "|", "tee", "/tmp/`hostname", "|", 
"cut", "-d.", "-f1`.txt"], "delta": "0:00:00.115751", "end": "2017-08-29 
13:06:19.590748", "failed": true, "rc": 1, "start": "2017-08-29 
13:06:19.474997", "stderr": "CRITICAL:yum.cli:Command line error: option 
-d: invalid integer value: '.'", "stderr_lines": ["CRITICAL:yum.cli:Command 
line error: option -d: invalid integer value: '.'"], "stdout": "Usage: yum 
[options] COMMAND\n\nList of Commands:\n\ncheck

I've have tried surrounding the command with double and have also tried 
singe quotes to no avail. Not sure how to format.

Any Advice?

Thanks,

- jerry

-- 
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/587480f0-603c-4c4f-b4c6-e40f843c22af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to