- Ansible 2 Cloud Automation Cookbook
- Aditya Patawari Vikas Aggarwal
- 141字
- 2021-06-24 18:43:40
How to do it…
- In a previous recipe, we created an Elastic IP and registered the value of the output. We are going to use that and add it to a group called phonebook-infra:
- name: Adding Elastic IP to the phonebook-infra
add_host:
hostname: "{{ eip.public_ip }}"
groups: phonebook-infra
- Once we are done with the add_host task in the EC2 role, our playbook can deploy the application by calling both the EC2 role and phonebook role like this:
---
- hosts: localhost
roles:
- ec2
- hosts: phonebook-infra
roles:
- phonebook
To understand the phonebook role better, we can refer to Chapter 1, Getting Started with Ansible and Cloud Management of this book. This playbook will create an EC2 instance and deploy the phonebook application on that instance. Since we are using a single instance, we will use SQLite as the database.
推薦閱讀
- 三菱FX3U/5U PLC從入門到精通
- Visualforce Development Cookbook(Second Edition)
- 腦動力:C語言函數速查效率手冊
- 網上生活必備
- Learning Apache Cassandra(Second Edition)
- Pig Design Patterns
- 四向穿梭式自動化密集倉儲系統的設計與控制
- Grome Terrain Modeling with Ogre3D,UDK,and Unity3D
- 傳感器與新聞
- Excel 2007常見技法與行業應用實例精講
- 網站入侵與腳本攻防修煉
- 嵌入式GUI開發設計
- 生物3D打印:從醫療輔具制造到細胞打印
- Hands-On Geospatial Analysis with R and QGIS
- 單片機與微機原理及應用