- 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.
推薦閱讀
- PPT,要你好看
- 32位嵌入式系統(tǒng)與SoC設(shè)計(jì)導(dǎo)論
- Visualforce Development Cookbook(Second Edition)
- 手把手教你玩轉(zhuǎn)RPA:基于UiPath和Blue Prism
- 大數(shù)據(jù)技術(shù)入門(第2版)
- 統(tǒng)計(jì)策略搜索強(qiáng)化學(xué)習(xí)方法及應(yīng)用
- 21天學(xué)通Java Web開發(fā)
- PowerMill 2020五軸數(shù)控加工編程應(yīng)用實(shí)例
- Puppet 3 Beginner’s Guide
- Learning OpenShift
- 深度學(xué)習(xí)之模型優(yōu)化:核心算法與案例實(shí)踐
- 多傳感器數(shù)據(jù)智能融合理論與應(yīng)用
- 服務(wù)科學(xué)概論
- 深度剖析:硬盤固件級(jí)數(shù)據(jù)恢復(fù)
- 華人動(dòng)畫師的法蘭西印象