- Ansible 2 Cloud Automation Cookbook
- Aditya Patawari Vikas Aggarwal
- 97字
- 2021-06-24 18:43:35
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
推薦閱讀
- 繪制進程圖:可視化D++語言(第1冊)
- 樂高機器人:WeDo編程與搭建指南
- Python Artificial Intelligence Projects for Beginners
- AWS:Security Best Practices on AWS
- Dreamweaver CS3網(wǎng)頁制作融會貫通
- Getting Started with MariaDB
- Mobile DevOps
- Mastering D3.js
- 21天學通Visual Basic
- 3D Printing for Architects with MakerBot
- 自動控制理論(非自動化專業(yè))
- 21天學通C語言
- Windows Server 2003系統(tǒng)安全管理
- 單片機技能與實訓
- 單片機原理實用教程