Hi  Brian ,

Still getting errors.

[root@station1 ansible]# ansible-playbook c2.yml
 [WARNING]: While constructing a mapping from /etc/ansible/c2.yml, line 5,
column 7, found a duplicate dict key (register). Using last
defined value only.


PLAY [localhost]
***************************************************************

TASK [setup]
*******************************************************************
ok: [localhost]

TASK [capture linux_os]
********************************************************
changed: [localhost] => (item=uname -a)
changed: [localhost] => (item=cat /etc/resolv.conf)

TASK [creating db_inventory_dir]
***********************************************
ok: [localhost]

TASK [copy]
********************************************************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args'
has an invalid value, which appears to include a variable that is
undefined. The error was: 'petch1' is undefined\n\nThe error appears to
have been in '/etc/ansible/c2.yml': line 17, column 7, but may\nbe
elsewhere in the file depending on the exact syntax problem.\n\nThe
offending line appears to be:\n\n        state: directory\n    - copy:
content={{ prepatch.results|selectattr('stdout')|join('\\n') }}
dest=/tmp/{{petch1}}-prepatch.txt\n      ^ here\nWe could be wrong, but
this one looks like it might be an issue with\nmissing quotes.  Always
quote template expression brackets when they\nstart a value. For
instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written
as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}
        to retry, use: --limit @/etc/ansible/c2.retry

PLAY RECAP
*********************************************************************
localhost                  : ok=3    changed=1    unreachable=0    failed=1


On Mon, Aug 27, 2018 at 9:15 PM, Brian Coca <[email protected]> wrote:

> sorry, missing 1/2 of previous, here would be the final 'copy':
>
>
>
> - copy: content={{ prepatch.results|selectattr('stdout')|join('\n') }}
>  dest=/tmp/{{petch1}}-prepatch.txt
>
> This will put into the destination file the output fo both commands
> separated by a new line, which I think is your intention.
>
> --
> ----------
> Brian Coca
>
> --
> 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/CACVha7cBTJDKr5EUgNZownc8fAGyk
> o6nk3__o7kmv2NysriNbQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Regards:

*Deepak*

*REDUCE     -        REUSE      -       RECYCLE*

P
*Save Earth. Think about the Environment before printing this e-mail!!*

-- 
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/CA%2BFVkN6w__1u7%3D2rNo3yMPZZYDB3W8zf_wLSpmuaoAJNz28WWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to