Generally we consider any traceback like the above to be a bug, regardless
of the cause, so please do open a github issue for this. Beyond that, as
Brian mentioned, apparently it's having trouble executing the date command
as it is specified. I tested the above syntax with this small playbook:
$ cat test_pipe_date.yml
- hosts: localhost
connection: local
gather_facts: no
vars:
datestamp: "{{ lookup('pipe', 'date +%Y%m%d-%H%M%S') }}"
tasks:
- debug: var=datestamp
And it worked as expected (with the current devel branch):
TASK: [debug var=datestamp]
***************************************************
ok: [127.0.0.1] => {
"datestamp": "20140606-204031"
}
So this appears to be something specific to your platform or environment.
On Fri, Jun 6, 2014 at 2:36 PM, Daniel W. Ottey <[email protected]> wrote:
> Thanks Mark. Unfortunately that still did not work for me. Here is the
> new error (I wish the ansible errors were a little more straight-forward)
>
> GATHERING FACTS
> ***************************************************************
> fatal: [labadmin.lab.boomi.com] => Traceback (most recent call last):
> File "/usr/lib/python2.6/site-packages/ansible/runner/__init__.py", line
> 532, in _executor
> exec_rc = self._executor_internal(host, new_stdin)
> File "/usr/lib/python2.6/site-packages/ansible/runner/__init__.py", line
> 564, in _executor_internal
> module_vars = template.template(self.basedir, self.module_vars,
> host_variables)
> File "/usr/lib/python2.6/site-packages/ansible/utils/template.py", line
> 349, in template
> d[k] = template(basedir, v, vars, lookup_fatal, depth, expand_lists,
> fail_on_undefined=fail_on_undefined)
> File "/usr/lib/python2.6/site-packages/ansible/utils/template.py", line
> 321, in template
> varname = template_from_string(basedir, varname, vars,
> fail_on_undefined)
> File "/usr/lib/python2.6/site-packages/ansible/utils/template.py", line
> 562, in template_from_string
> res = jinja2.utils.concat(rf)
> File "<template>", line 8, in root
> File "/usr/lib64/python2.6/site-packages/jinja2/runtime.py", line 179,
> in call
> return __obj(*args, **kwargs)
> File "/usr/lib/python2.6/site-packages/ansible/utils/template.py", line
> 554, in my_lookup
> return lookup(*args, basedir=basedir, **kwargs)
> File "/usr/lib/python2.6/site-packages/ansible/utils/template.py", line
> 91, in lookup
> ran = instance.run(*args, inject=vars, **kwargs)
> File
> "/usr/lib/python2.6/site-packages/ansible/runner/lookup_plugins/pipe.py",
> line 35, in run
> p = subprocess.Popen(term, cwd=self.basedir, shell=False,
> stdin=subprocess.PIPE, stdout=subprocess.PIPE)
> File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
> errread, errwrite)
> File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory
>
>
> FATAL: all hosts have already failed -- aborting
>
>
> On Fri, Jun 6, 2014 at 3:20 PM, Matt Martz <[email protected]> wrote:
>
>> datestamp: "{{ lookup('pipe', 'date +%Y%m%d-%H%M%S') }}"
>>
>> That should be the updated syntax for what you are trying to do.
>>
>>
>> On Fri, Jun 6, 2014 at 2:18 PM, Daniel Ottey <[email protected]>
>> wrote:
>>
>>> Thanks all. I was finally able to narrow the error down to this
>>> variable file /etc/ansible/roles/common/vars/main.yml
>>>
>>> ---
>>> datestamp: $PIPE(date +%Y%m%d-%H%M%S)
>>>
>>> I'm pretty sure that $PIPE worked previously. So I don't know if
>>> something broke in an updated ansible package.
>>>
>>> Does anyone have a recommendation for a replacement?
>>>
>>> On Friday, June 6, 2014 8:28:14 AM UTC-4, Michael DeHaan wrote:
>>>
>>>> What about a "with_pipe" ?
>>>>
>>>> Did you check both the templates and the playbooks? It seems to be in
>>>> a template.
>>>>
>>>>
>>>> On Tue, Jun 3, 2014 at 3:03 PM, Daniel W. Ottey <[email protected]>
>>>> wrote:
>>>>
>>>>> I copied some code from some place (which previously worked). My
>>>>> code does not have the word "pipe" anywhere. The only part that has
>>>>> "lookup" is here:
>>>>>
>>>>> - name: Configure ansible users SSH key
>>>>> authorized_key: user=ansible key="{{ lookup('file',
>>>>> '/etc/ansible/roles/common/files/ansible-id_rsa.pub') }}"
>>>>> tags: ansible-user-setup
>>>>>
>>>>> But that tag shouldn't be called when I use "--tags zabbix-agent".
>>>>> Also that particular file is set permissions 644.
>>>>>
>>>>>
>>>>> On Tue, Jun 3, 2014 at 12:36 PM, James Cammarata <[email protected]
>>>>> > wrote:
>>>>>
>>>>>> Did you download a role from Galaxy or somewhere else? From the
>>>>>> output of the error, it looks like somewhere in your play this appears:
>>>>>>
>>>>>> {{ lookup('pipe','some_executable_name_here') }}
>>>>>>
>>>>>>
>>>>>> So you may want to grep for 'lookup' or 'pipe' in your files.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Jun 3, 2014 at 11:00 AM, Daniel Ottey <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Thanks for your response. Sorry for not being sure... But you're
>>>>>>> saying I'm calling an executable via a pipe lookup ... And I have no
>>>>>>> idea
>>>>>>> what that means. I'm certainly not doing it intentionally. You ask me
>>>>>>> to
>>>>>>> validate "the binary is there" but I don't know what binary to look for.
>>>>>>>
>>>>>>> Is this happening during the "Gathering Facts" or afterward?
>>>>>>>
>>>>>>> Is the error happening on the local side or the remote side?
>>>>>>>
>>>>>>>
>>>>>>> On Tuesday, June 3, 2014 11:56:21 AM UTC-4, James Cammarata wrote:
>>>>>>>
>>>>>>>> Correct, the warning message can be ignored, and there is a
>>>>>>>> configuration setting (system_warnings in your ansible.cfg) that can
>>>>>>>> be set
>>>>>>>> to "False" to disable it.
>>>>>>>>
>>>>>>>> The fatal error appears to be reporting that the executable you're
>>>>>>>> trying to call via the pipe lookup is not being found at the path
>>>>>>>> specified. Can you share what that is, and validate that the binary is
>>>>>>>> there and executable by the user that the play is running with to make
>>>>>>>> sure
>>>>>>>> there are no security issues?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Jun 3, 2014 at 8:34 AM, Daniel Ottey <[email protected]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> A couple errors have recently cropped up when using Ansible, and
>>>>>>>>> the latest is causing me to not be able to use it at all. I tried
>>>>>>>>> searching for the fatal error(s), but was not able to find anythin
>>>>>>>>> mysef,
>>>>>>>>> I'm hopeful that this forum can help me out.
>>>>>>>>>
>>>>>>>>> My OS is RHEL 6.4 and it also pulls packages from EPEL. My
>>>>>>>>> ansible is "ansible 1.5.5" from EPEL.
>>>>>>>>>
>>>>>>>>> *Command:*
>>>>>>>>>
>>>>>>>>> ANSIBLE_SSH_ARGS="" ansible-playbook -T 30 -c ssh -s -K -i
>>>>>>>>> ~/my_ansible_inventory.txt -l labadmin.lab.boomi.com --tags
>>>>>>>>> zabbix-agent /etc/ansible/site.yml
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> The first warning message I have been able to find documented
>>>>>>>>> elsewhere, and I think it is not related to the fatal error.
>>>>>>>>>
>>>>>>>>> *Warning:*
>>>>>>>>>
>>>>>>>>> /usr/lib64/python2.6/site-packages/pycrypto-2.6.1-py2.6-linu
>>>>>>>>> x-x86_64.egg/Crypto/Util/number.py:57: PowmInsecureWarning: Not
>>>>>>>>> using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid
>>>>>>>>> timing
>>>>>>>>> attack vulnerability.
>>>>>>>>> _warn("Not using mpz_powm_sec. You should rebuild using libgmp
>>>>>>>>> >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
>>>>>>>>> sudo password:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> So I think from what I read elsewhere that I can ignore that
>>>>>>>>> warning until the version of libgmp is updated.
>>>>>>>>>
>>>>>>>>> *But here is the fatal error:*
>>>>>>>>>
>>>>>>>>> PLAY [apply common configuration to all nodes]
>>>>>>>>> ********************************
>>>>>>>>>
>>>>>>>>> GATHERING FACTS ******************************
>>>>>>>>> *********************************
>>>>>>>>> fatal: [labadmin.lab.boomi.com] => Traceback (most recent call
>>>>>>>>> last):
>>>>>>>>> File "/usr/lib/python2.6/site-packages/ansible/runner/__init__.py",
>>>>>>>>> line 532, in _executor
>>>>>>>>> exec_rc = self._executor_internal(host, new_stdin)
>>>>>>>>> File "/usr/lib/python2.6/site-packages/ansible/runner/__init__.py",
>>>>>>>>> line 564, in _executor_internal
>>>>>>>>> module_vars = template.template(self.basedir,
>>>>>>>>> self.module_vars, host_variables)
>>>>>>>>> File "/usr/lib/python2.6/site-packages/ansible/utils/
>>>>>>>>> template.py", line 349, in template
>>>>>>>>> d[k] = template(basedir, v, vars, lookup_fatal, depth,
>>>>>>>>> expand_lists, fail_on_undefined=fail_on_undefined)
>>>>>>>>> File "/usr/lib/python2.6/site-packages/ansible/utils/
>>>>>>>>> template.py", line 331, in template
>>>>>>>>> m = _legacy_varFind(basedir, varname, vars, lookup_fatal,
>>>>>>>>> depth, expand_lists)
>>>>>>>>> File "/usr/lib/python2.6/site-packages/ansible/utils/
>>>>>>>>> template.py", line 245, in _legacy_varFind
>>>>>>>>> replacement = instance.run(args, inject=vars)
>>>>>>>>> File
>>>>>>>>> "/usr/lib/python2.6/site-packages/ansible/runner/lookup_plugins/pipe.py",
>>>>>>>>> line 35, in run
>>>>>>>>> p = subprocess.Popen(term, cwd=self.basedir, shell=False,
>>>>>>>>> stdin=subprocess.PIPE, stdout=subprocess.PIPE)
>>>>>>>>> File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
>>>>>>>>> errread, errwrite)
>>>>>>>>> File "/usr/lib64/python2.6/subprocess.py", line 1234, in
>>>>>>>>> _execute_child
>>>>>>>>> raise child_exception
>>>>>>>>> OSError: [Errno 2] No such file or directory
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> FATAL: all hosts have already failed -- aborting
>>>>>>>>>
>>>>>>>>> PLAY RECAP ******************************
>>>>>>>>> **************************************
>>>>>>>>> to retry, use: --limit @/home/dottey/site.retry
>>>>>>>>>
>>>>>>>>> labadmin.lab.boomi.com : ok=0 changed=0 unreachable=1
>>>>>>>>> failed=0
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Any insight into what is causing the fatal error - and if there is
>>>>>>>>> anything I can do to resolve 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/52b74376-
>>>>>>>>> 888b-4423-a56b-42da16f7d4a5%40googlegroups.com
>>>>>>>>> <https://groups.google.com/d/msgid/ansible-project/52b74376-888b-4423-a56b-42da16f7d4a5%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>> 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/
>>>>>>> e6a15408-3b47-4f9d-9d2d-3cfeafd0299f%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/ansible-project/e6a15408-3b47-4f9d-9d2d-3cfeafd0299f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> 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/CAMFyvFg4MR9oBT8WnCQ%3DWORt5H0peevpYnStJJd%
>>>>>> 3DxVHcOXs%2BfQ%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/ansible-project/CAMFyvFg4MR9oBT8WnCQ%3DWORt5H0peevpYnStJJd%3DxVHcOXs%2BfQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> --
>>>>> 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/CABTuA1%3DhhR8AcNvcXb%
>>>>> 2BE8ptxsbnkMY4VVSZ2HfyBqaXc6LdhJg%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/ansible-project/CABTuA1%3DhhR8AcNvcXb%2BE8ptxsbnkMY4VVSZ2HfyBqaXc6LdhJg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>>> 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/1da62da0-44e8-4666-b3bc-a189fb4b1245%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/1da62da0-44e8-4666-b3bc-a189fb4b1245%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Matt Martz
>> [email protected]
>> http://sivel.net/
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/DL7_u_rWauA/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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/CAD8N0v9HVdXBLOk0AJLKA_rPLtm_70eMod2NndDFmASNW11qEg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAD8N0v9HVdXBLOk0AJLKA_rPLtm_70eMod2NndDFmASNW11qEg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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/CABTuA1k5v4jEvmtBVBDnDFVTF3w%2BoJbCTJgHnoz3hXLXeaZeLw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CABTuA1k5v4jEvmtBVBDnDFVTF3w%2BoJbCTJgHnoz3hXLXeaZeLw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAMFyvFjCr0O2_C_twFH4N_UzyP9t%2BreG%3D--_2-nyTTT2bxwhhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.