ansible-awx - Ansible AWX:playbook 成功运行以在 localhost 中创建目录,但是当转到该位置时,该目录不可用
问题描述
我是ansible AWX的新手,我想在我的本地主机上为该创建剧本创建目录,如下所示,当我运行剧本时,它显示成功按摩并在本地主机上进行了更改,但是当我转到该位置时,目录在那里不可用。
剧本:
---
- hosts: localhost
tasks:
- name: Create Directory
file:
path: ~/newDir1
mode: "0755"
state: directory
输出:
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
位置通过输出获得:
{
"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
}
解决方案
推荐阅读
- python - 如何调试 AttributeError:“列表”对象没有属性“匹配”
- reactjs - 将数据从孩子传递给父母会影响性能吗?(反应)
- angular - Mat芯片列表选择单个ExpressionChangedAfterItHasBeenCheckedError
- python - 如何在 Serial.Tools.List (Python) 中仅获取 COMx?
- stata - webuse drugtr 代码在 Stata 中不起作用
- makefile - 如何让了解文件夹?
- javascript - 我怎样才能从不同的标签中获取然后发送 id?
- discord.py - 如何在我的代码中指定不和谐的文本通道?
- javascript - 当小数因精度而被截断时,如何使用 parseFloat 向下舍入?
- node.js - discord.js 尝试赋予角色时无法读取未定义的属性添加