Creating the Ansible playbook for Jenkins

Start by navigating to our ansible roles directory:

$ cd ansible/roles  

This directory should contain the helloworld and nodejs directories, with the configurations that we created previously in Chapter 3, Treating Your Infrastructure as Code. We are now going to create our Jenkins role with the ansible-galaxy command:

$ ansible-galaxy init jenkins  

We are now going to edit the task definition for this new role by editing the file: jenkins/tasks/main.yml. Open up the file with your favorite text editor.

The goal of our task is to install and start Jenkins. In order to do this, since we are on a Linux-based operating system (AWS Amazon Linux, in our case), we are going to install an RPM package through ...

Get Effective DevOps with AWS - Second Edition 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.