From 3430ece1aaedfcdb8a951e4618cdf737e6f148a6 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 14 Aug 2019 15:08:35 -0500 Subject: [PATCH] Modify Lets Encrypt example to work correctly for non-root users. --- https-letsencrypt/README.md | 8 ++++++++ https-letsencrypt/main.yml | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/https-letsencrypt/README.md b/https-letsencrypt/README.md index 6aba1d2..96ccb9f 100644 --- a/https-letsencrypt/README.md +++ b/https-letsencrypt/README.md @@ -29,6 +29,14 @@ Run the Ansible playbook to automatically generate a Let's Encrypt certificate a ansible-playbook -i inventory main.yml +### 5 - Verify the certificate works + +After the playbook completes, visit your site at the https URL and verify it works with a valid certificate: `https://domain.example.com/` + +Or use openssl on the command line to verify the certificate details: + + openssl s_client -showcerts -connect domain.example.com:443 + ## About the Author This project was created by [Jeff Geerling](https://www.jeffgeerling.com/) as an example for [Ansible for DevOps](https://www.ansiblefordevops.com/). diff --git a/https-letsencrypt/main.yml b/https-letsencrypt/main.yml index e2048bf..f7757be 100644 --- a/https-letsencrypt/main.yml +++ b/https-letsencrypt/main.yml @@ -1,6 +1,7 @@ --- - hosts: all - gather_facts: no + gather_facts: false + become: true vars_files: - vars/main.yml @@ -8,7 +9,7 @@ pre_tasks: - name: Install Python if not already present. raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) - changed_when: False + changed_when: false - name: Gather facts after Python is definitely present. setup: