官术网_书友最值得收藏!

How to do it...

Consider the following playbook which we can execute without an inventory:

---
- hosts: localhost
tasks:
- name: get value
debug:
msg: "The value is: secret-value"

To execute this, we can just run the ansible-playbook command with this playbook:

$ ansible-playbook playbook.yml
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
PLAY [localhost] ***************************************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [include secret] **********************************************************
ok: [localhost]
TASK [get value] ***************************************************************
ok: [localhost] => {
"msg": "The value is: secret-value"
}
PLAY RECAP *********************************************************************
localhost : ok=3 changed=0 unreachable=0 failed=0
主站蜘蛛池模板: 府谷县| 新乐市| 安化县| 宁晋县| 保德县| 罗定市| 尉氏县| 辽阳市| 广河县| 红河县| 张家港市| 富川| 林甸县| 吴旗县| 分宜县| 大新县| 米易县| 普洱| 车险| 烟台市| 巴彦县| 克什克腾旗| 铅山县| 上杭县| 龙江县| 万源市| 内黄县| 新营市| 建水县| 江阴市| 邢台市| 休宁县| 永胜县| 毕节市| 铜山县| 嘉义市| 翁牛特旗| 邓州市| 眉山市| 晴隆县| 石泉县|