From the course: Learning HashiCorp Packer
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Use ansible to install the webserver - Packer Tutorial
From the course: Learning HashiCorp Packer
Use ansible to install the webserver
- [Instructor] Now that we've hooked in Ansible, we can use it to install our basic website instead of calling individual shell commands directly. We won't go into too much detail about how to work with Ansible, I've already covered that in the previous video. Lots of roles are provided by the community and made available on the Ansible Galaxy. So here we're going to use the Official NGINX Ansible role to install it. Now these go into a file called the requirements.yml, so that is the same bit that we have mentioned over here, so that's the nginxinc part of the command here. This file is provided for you. And what we do is, we ask Ansible to download this locally, so we can use this role. And we do that by typing ansible-galaxy install hyphen r and then the name of the file which is requirements.yml. And what that will do is go and download the NGINX role for us, brilliant, installed successfully. So here we have the NGINX yml file that I have written, and you can grab this from the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.