I stripped it down to the most basic diff command and made your suggested 
change, but nothing! I am using ansible version 2.1.2.0 for what it's worth 
to anyone. It actually generated the diff on the remote, so I am just going 
to turn on ignore_errors for now :/ Thanks for the help.

On Wednesday, November 30, 2016 at 3:23:52 PM UTC-8, [email protected] wrote:
>
> Hello - 
>
> I solved a similar problem before by following a suggestion on the shell 
> module <http://docs.ansible.com/ansible/shell_module.html> page.
>
> To sanitize any variables passed to the shell module, you should use “{{ 
>> var | quote }}” instead of just “{{ var }}” to make sure they don’t include 
>> evil things like semicolons.
>
>
> Based on the _raw_params in the verbose output, your variables do contain 
> hyphens, colons, etc. Ansible might be interpreting these as something you 
> don't want.
>
> Maybe. Give it a shot. :)
>
> On Wednesday, November 30, 2016 at 5:08:35 PM UTC-6, colin byrne wrote:
>>
>> I am trying to use the shell module to generate a diff between two remote 
>> files, but it is erring out without giving me a warning or error: 
>>
>> - name: create diff of old settings file and new settings file
>>   shell: diff /home/deploy/{{ application_name 
>> }}/shared/config/settings.yml /home/deploy/{{ application_name 
>> }}/shared/config/settings.yml.ansible_old_version >> /home/deploy/{{ 
>> application_name }}/shared/config/settings.yml_diffs_1
>>   when: settings_file.changed
>>
>>
>> It executes totally fine when run directly in a shell on the remote 
>> machine... 
>>
>> Here is the verbose error output, which doesn't seem to give much of use:
>>
>> Thanks for any help or workaround! I've spent too much time on this...
>>
>> fatal: [staging]: FAILED! => {"changed": true, "cmd": "diff 
>> /home/deploy/app_name/shared/config/settings.yml 
>> /home/deploy/app_name/shared/config/settings.yml.ansible_old_version 
>> > 
>> /home/deploy/coverhound/shared/config/settings.yml_diffs/settings.yml_2016-11-30_14:45:54",
>>  
>> "delta": "0:00:00.002778", "end": "2016-11-30 14:45:57.198400", "failed": 
>> true, "invocation": {"module_args": {"_raw_params": "diff 
>> /home/deploy/coverhound/shared/config/settings.yml 
>> /home/deploy/app_name/shared/config/settings.yml.ansible_old_version > 
>> /home/deploy/app_name/shared/config/settings.yml_diffs/settings.yml_2016-11-30_14:45:54",
>>  
>> "_uses_shell": true, "chdir": null, "creates": null, "executable": 
>> "/bin/bash", "removes": null, "warn": true}, "module_name": "command"}, 
>> "rc": 1, "start": "2016-11-30 14:45:57.195622", "stderr": "", "stdout": "", 
>> "stdout_lines": [], "warnings": []}
>>
>

-- 
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/509d2eb7-7e80-4737-a26b-d08aa094f851%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to