我创建了自定义事实 ---> /etc/ansible/facts.d/hdfs.fact
当我使用以下命令运行剧本时
- debug: var=ansible_local.hdfs
run_once: true
Run Code Online (Sandbox Code Playgroud)
我得到了以下答案:
PLAY [all] *********************************************************************
TASK [setup] *******************************************************************
ok: [cdh-2]
ok: [cdh-3]
ok: [cdh-1]
TASK [preparation : debug] *****************************************************
ok: [cdh-1] => {
"ansible_local.hdfs": {
"items": [
{
"base": true,
"config": {
"items": []
},
"displayName": "Failover Controller Default Group",
"name": "hdfs-FAILOVERCONTROLLER-BASE",
"roleType": "FAILOVERCONTROLLER",
"serviceRef": {
"clusterName": "cluster",
"serviceName": "hdfs"
}
},
{
"base": true,
"config": {
"items": [
{
"name": "balancer_java_heapsize",
"value": "491782144"
}
]
},
"displayName": "Balancer Default Group",
"name": …Run Code Online (Sandbox Code Playgroud)