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

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. 

主站蜘蛛池模板: 民权县| 田阳县| 穆棱市| 曲靖市| 资中县| 陆川县| 新密市| 东阳市| 南皮县| 尚义县| 个旧市| 牡丹江市| 汉寿县| 洛隆县| 界首市| 萨迦县| 易门县| 本溪市| 来安县| 东城区| 宁陵县| 延长县| 广西| 汝南县| 榆中县| 顺平县| 漯河市| 荥阳市| 荣昌县| 边坝县| 石嘴山市| 富川| 抚松县| 城口县| 临潭县| 桃园市| 呼伦贝尔市| 夹江县| 阳朔县| 大英县| 宝丰县|