'Ansible AWX : playbook run successfully for create directory in localhost but when go and check to that location that directory not available
I new with ansible AWX I wanted to create directory on my localhost for that create playbook as given below when I run playbook it shows that successful massage and changed on localhost but when i go to that location the Directory isn't available there.
playbook:
---
- hosts: localhost
tasks:
- name: Create Directory
file:
path: ~/newDir1
mode: "0755"
state: directory
output:
TASK [Create Directory] ********************************************************
20:16:58
10
changed: [localhost]
PLAY RECAP *********************************************************************
20:17:00
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
location got through output:
{
"path": "/var/lib/awx/newDir1",
"changed": true,
"diff": {
"before": {
"path": "/var/lib/awx/newDir1",
"state": "absent"
},
"after": {
"path": "/var/lib/awx/newDir1",
"state": "directory"
}
},
"uid": 975,
"gid": 975,
"owner": "awx",
"group": "awx",
"mode": "0755",
"state": "directory",
"secontext": "system_u:object_r:tmp_t:s0",
"size": 6,
"invocation": {
"module_args": {
"path": "/var/lib/awx/newDir1",
"mode": "0755",
"state": "directory",
"recurse": false,
"force": false,
"follow": true,
"modification_time_format": "%Y%m%d%H%M.%S",
"access_time_format": "%Y%m%d%H%M.%S",
"_original_basename": null,
"_diff_peek": null,
"src": null,
"modification_time": null,
"access_time": null,
"owner": null,
"group": null,
"seuser": null,
"serole": null,
"selevel": null,
"setype": null,
"attributes": null,
"content": null,
"backup": null,
"remote_src": null,
"regexp": null,
"delimiter": null,
"directory_mode": null,
"unsafe_writes": null
}
},
"_ansible_no_log": false
}
Solution 1:[1]
If you are using awx docker image then you need to check created directory inside that container. Get inside container and search. :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Chris |