官术网_书友最值得收藏!

Deploying the phonebook application

Our phonebook application can be deployed to the instances that we have created. When deploying an application to an instance, we either need to know the IP address of the instance and prepare the inventory, or we can figure out the IP address at runtime. Preparing the inventory is often simple, however, it requires manual intervention. We have to run tasks to boot an EC2 instance with the required parameters and copy the IP address of the instance to the inventory file. After this, we can run the playbook for deploying the application.

Manually adding IPs to the inventory is not possible for unattended setups. In certain cases, the infrastructure is dynamic to the extent that managing IPs might not even be possible. For such cases, there are two possibilities: we can use Ansible's add_host module to deploy an application when we boot up a new instance without adding anything manually anywhere. Or we can use dynamic inventory, where we query the API of the cloud provider and build an in-memory inventory every time. For this chapter, we are going to look at using the add_host module and discuss the dynamic inventory in the next chapter. 

主站蜘蛛池模板: 新兴县| 宁都县| 大宁县| 翁牛特旗| 三河市| 温宿县| 广南县| 石屏县| 梅州市| 昌图县| 灵寿县| 元江| 龙川县| 拜城县| 温州市| 温泉县| 雷州市| 逊克县| 广元市| 芷江| 杭锦后旗| 游戏| 永嘉县| 寿宁县| 衡东县| 徐闻县| 汉寿县| 赤壁市| 罗源县| 武平县| 南丰县| 二连浩特市| 屏南县| 永和县| SHOW| 莫力| 阿巴嘎旗| 大宁县| 钟山县| 揭东县| 洪洞县|