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> ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5985 TO 172.16.1.50
EXEC (via pipeline wrapper)
ok: [172.16.1.50] => {
“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] => {
“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