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

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. 

主站蜘蛛池模板: 萨迦县| 商洛市| 华阴市| 永新县| 合山市| 沙湾县| 盐源县| 武强县| 盐城市| 廊坊市| 遂川县| 卓尼县| 海兴县| 富川| 福泉市| 博客| 玉环县| 北安市| 克什克腾旗| 安化县| 深水埗区| 舞阳县| 湘潭市| 敦煌市| 永登县| 若尔盖县| 巴青县| 万盛区| 道孚县| 桐梓县| 灌南县| 灵寿县| 祥云县| 夏邑县| 西乌珠穆沁旗| 柳州市| 鹰潭市| 宜兰县| 彭州市| 阜南县| 阜新|