- 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.
推薦閱讀
- 大學計算機基礎:基礎理論篇
- PostgreSQL 11 Server Side Programming Quick Start Guide
- Cinema 4D R13 Cookbook
- JavaScript實例自學手冊
- Getting Started with Clickteam Fusion
- 并行數據挖掘及性能優化:關聯規則與數據相關性分析
- Blockchain Quick Start Guide
- Zabbix Network Monitoring(Second Edition)
- JMAG電機電磁仿真分析與實例解析
- Python Data Science Essentials
- 愛犯錯的智能體
- 人工智能趣味入門:光環板程序設計
- 工業機器人運動仿真編程實踐:基于Android和OpenGL
- R Data Analysis Projects
- 計算智能算法及其生產調度應用