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

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
主站蜘蛛池模板: 分宜县| 临潭县| 孝义市| 莱西市| 荆门市| 萝北县| 黔南| 黎平县| 喀喇沁旗| 丰台区| 丰都县| 行唐县| 南城县| 保定市| 滨海县| 镇原县| 老河口市| 高清| 上蔡县| 彰化市| 乌兰浩特市| 迁安市| 曲阜市| 日喀则市| 兰考县| 绵竹市| 满城县| 晋中市| 大冶市| 马尔康县| 屯留县| 丰原市| 固原市| 叙永县| 信阳市| 岳阳市| 焦作市| 广州市| 永修县| 且末县| 普安县|