Skip to Content
Security Automation with Ansible 2
book

Security Automation with Ansible 2

by Akash Mahajan, MADHU AKULA
December 2017
Intermediate to advanced
364 pages
7h 30m
English
Packt Publishing
Content preview from Security Automation with Ansible 2

Setting up Jenkins

Let's use an Ansible playbook to install Jenkins and get started with it. 

The following code snippet is a snippet of an Ansible playbook we wrote for setting up Jenkins in the Ubuntu 16.04 OS.

Once the setup has been done, playbook returns the default administrator password required to log in to the application for the first time:

- name: installing jenkins in ubuntu 16.04  hosts: "192.168.1.7"  remote_user: ubuntu  gather_facts: False  become: Truetasks:  - name: install python 2    raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)  - name: install curl and git    apt: name={{ item }} state=present update_cache=yes    with_items:      - curl      - git
  - name: adding jenkins gpg key
    apt_key:
      url: https://pkg.jenkins.io/debian/jenkins-ci.org.key ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Implementing DevOps with Ansible 2

Implementing DevOps with Ansible 2

Jonathan McAllister
Practical Ansible 2

Practical Ansible 2

Daniel Oh, James Freeman, Fabio Alessandro Locati

Publisher Resources

ISBN: 9781788394512Supplemental Content