Take a look at the stat module. It has slightly better examples of what you
are trying to do: http://docs.ansible.com/ansible/stat_module.html

On Mon, Jun 26, 2017 at 10:17 PM <bobby.ku...@gmail.com> wrote:

> Hello all,
>
> I'm *very* new to ansible, and hope that this is something very simple
> that has escaped me.
>
> Here's what I'm trying to accomplish: I'm doing a task on prior runs that
> shouldn't be repeated, so I'm dropping a flag on the system to pick up on
> future playbook runs.
>
> - name: Check for prior execution win_stat: path: c:\temp\dc.success
> register: file_flag - name: Debug Check debug: var: file_flag
>
> TASK [Check for prior execution]
> ***************************************************************************
> task path:
> /home/ctfadmin/MOONLIGHTWALK/ansible/playbooks/dc1_corp.stage0.yml:61
> Using module file
> /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_stat.ps1
> <172.16.1.50
> <https://l.facebook.com/l.php?u=http%3A%2F%2F172.16.1.50%2F&h=ATNP7PZJuawiLs1Hi_NtuR1_ptIQDmH8hsaItwmxsoFNheToML2BpIF735wHccNAov6NaxdkSG1frXTJehFLbof1DHnclFk7PdPBKEvkumgNWebmRHs0dCNY7JutGq2oxsK0hAN4lKaMLw>>
> ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5985 TO 172.16.1.50
> <https://l.facebook.com/l.php?u=http%3A%2F%2F172.16.1.50%2F&h=ATNP7PZJuawiLs1Hi_NtuR1_ptIQDmH8hsaItwmxsoFNheToML2BpIF735wHccNAov6NaxdkSG1frXTJehFLbof1DHnclFk7PdPBKEvkumgNWebmRHs0dCNY7JutGq2oxsK0hAN4lKaMLw>
> EXEC (via pipeline wrapper)
> ok: [172.16.1.50
> <https://l.facebook.com/l.php?u=http%3A%2F%2F172.16.1.50%2F&h=ATNP7PZJuawiLs1Hi_NtuR1_ptIQDmH8hsaItwmxsoFNheToML2BpIF735wHccNAov6NaxdkSG1frXTJehFLbof1DHnclFk7PdPBKEvkumgNWebmRHs0dCNY7JutGq2oxsK0hAN4lKaMLw>]
> => {
> "changed": false,
> "stat": {
> "attributes": "Archive",
> "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
> "creationtime": 1498507211.5576174,
> "exists": true,
> "extension": ".success",
> "filename": "dc.success",
> "isarchive": true,
> "isdir": false,
> "ishidden": false,
> "islnk": false,
> "isreadonly": false,
> "isshared": false,
> "lastaccesstime": 1498507211.5576174,
> "lastwritetime": 1498508973.9960954,
> "md5": "d41d8cd98f00b204e9800998ecf8427e",
> "owner": "BUILTIN\\Administrators",
> "path": "C:\\temp\\dc.success",
> "size": 0
> }
> }
>
> TASK [Debug Check]
> ***************************************************************************************************
> task path:
> /home/ctfadmin/MOONLIGHTWALK/ansible/playbooks/dc1_corp.stage0.yml:65
> ok: [172.16.1.50
> <https://l.facebook.com/l.php?u=http%3A%2F%2F172.16.1.50%2F&h=ATNP7PZJuawiLs1Hi_NtuR1_ptIQDmH8hsaItwmxsoFNheToML2BpIF735wHccNAov6NaxdkSG1frXTJehFLbof1DHnclFk7PdPBKEvkumgNWebmRHs0dCNY7JutGq2oxsK0hAN4lKaMLw>]
> => {
> "file_flag": "VARIABLE IS NOT DEFINED!"
> }
>
> I'm hoping that someone can point out a simple an obvious thing that I'm
> missing!
>
> Thank you in advance!
>
> -Bobby
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/6f1f40a7-1ab6-4a67-802b-ef05dcce42ae%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/6f1f40a7-1ab6-4a67-802b-ef05dcce42ae%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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKsMCETujxJSdoPTueJ4n2d8nB1wxhx_XQJSbx1EkZ7tybx37A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to