Hello,
Lately, I've started to use Ansible. I'm trying to write a script that pass
a device as a parameter, and then chain a star sign for it.
For example, if the device name is */dev/sda*, i would like to count the
count of line of the command: *ls -l /dev/sda*. *I get an error after
running my script.
Here is my script:
- name: Get Hitachi Devices device details
shell: lsscsi | grep HITACHI | awk '{print $6}'
register: hitachiDevice
- name: Check if the volume is partitioned
shell: ls -l "{{ hitachiDevice.rc }}"* | wc -l
failed_when: hitachiDevice.rc != 1
Here is the error:
FAILED! => {"changed": true, "cmd": "ls -l \"0\"* | wc -l", "delta":
"0:00:00.027338", "end": "2016-08-10 14:15:12.200415", "failed": true,
"failed_when_result": true, "rc": 0, "start": "2016-08-10 14:15:12.173077",
"stderr": "ls: cannot access 0*: No such file or directory", "stdout": "0",
"stdout_lines": ["0"], "warnings": []}
Can someone tell my what is the issue, and how can i fix it?
--
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/62bb12c5-0ab0-48dc-8d36-5ddfe7fbe8ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.