- 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
推薦閱讀
- 大數(shù)據(jù)項目管理:從規(guī)劃到實現(xiàn)
- LabVIEW虛擬儀器從入門到測控應(yīng)用130例
- 極簡AI入門:一本書讀懂人工智能思維與應(yīng)用
- Windows XP中文版應(yīng)用基礎(chǔ)
- SharePoint 2010開發(fā)最佳實踐
- 統(tǒng)計策略搜索強化學(xué)習(xí)方法及應(yīng)用
- 水晶石精粹:3ds max & ZBrush三維數(shù)字靜幀藝術(shù)
- Visual Studio 2010 (C#) Windows數(shù)據(jù)庫項目開發(fā)
- MATLAB-Simulink系統(tǒng)仿真超級學(xué)習(xí)手冊
- Hands-On Dashboard Development with QlikView
- 三菱FX/Q系列PLC工程實例詳解
- 工業(yè)機器人力覺視覺控制高級應(yīng)用
- Photoshop CS4數(shù)碼照片處理入門、進(jìn)階與提高
- 企業(yè)級Web開發(fā)實戰(zhàn)
- PHP求職寶典