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

We have already seen this in our LEMP stack setup, and it's very similar. But here, we have to use the required modules for working with WordPress. The following code snippet shows how we can use templating to perform configuration updates in the server:

- name: installing apache2 server  apt:    name: "apache2"    update_cache: yes    state: present- name: updating customized templates for apache2 configuration  template:    src: "{{ item.src }}"    dest: "{{ item.dst }}"    mode: 0644    with_tems:    - { src: apache2.conf.j2, dst: /etc/apache2/conf.d/apache2.conf }    - { src: 000-default.conf.j2, dst: /etc/apache2/sites-available/000-default.conf }    - { src: default-ssl.conf.j2, dst: /etc/apache2/sites-available/default-ssl.conf }- name: ...
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