Chapter 7. Patterns for Managing Server Templates

This chapter builds on the previous chapters on provisioning and server creation to discuss ways to manage server templates.

Using server templates can help to build new servers consistently and repeatably. However, it requires good processes for managing the templates. Templates need to be built and kept up to date with patches and improvements. The process and tooling for this should follow the principles of infrastructure as code. Templates themselves should be built through a repeatable, transparent, self-documenting, and self-testing process.

Stock Templates: Can’t Someone Else Do It?

The simplest way to manage templates is to let someone else do it. Many OS vendors and cloud services provide prepackaged, stock templates, like those in Figure 7-1. These will have a base OS installation, plus default configurations, tools, and user accounts to make servers ready to use with the hosting provider. For example, the server template may be configured to use local DNS servers and OS package repositories, and may have utilities installed for finding metadata about the hosting environment.

Using stock images offloads the hassle and complexity of managing your own templates. This can be especially helpful in the early days of setting up and running a new infrastructure. Over time, the team may want to push provisioning activities from server creation into the template, and so decide to move to managing their own templates to gain ...

Get Infrastructure as Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.