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 nginx web server

Setting up nginx is as simple as sudo apt-get install nginx, but configuring for our use case and managing the configuration's automated way is where Ansible gives the power. Let's look at the following snippet of nginx's role from the playbook:

- name: adding nginx signing key  apt_key:    url: http://nginx.org/keys/nginx_signing.key    state: present- name: adding sources.list deb url for nginx  lineinfile:    dest: /etc/apt/sources.list    line: "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx"- name: update the cache and install nginx server  apt:    name: nginx    update_cache: yes    state: present- name: updating customized templates for nginx configuration  template:    src: "{{ item.src }}"    dest: "{{ item.dst }}" with_items: ...
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