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

Configuring the Let's Encrypt service

We can use a command-line tool offered by Let's Encrypt to get free SSL/TLS certificates in an open, automated manner. 

The tool is capable of reading and understanding an nginx virtual host file and generating the relevant certificates completely automatically, without any kind of manual intervention: 

- name: adding certbot ppa  apt_repository:    repo: "ppa:certbot/certbot"- name: install certbot  apt:    name: "{{ item }}"    update_cache: yes    state: present  with_items:    - python-certbot-nginx- name: check if we have generated a cert already  stat:    path: "/etc/letsencrypt/live/{{ website_domain_name }}/fullchain.pem"    register: cert_stats- name: run certbot to generate the certificates shell: "certbot certonly ...
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