]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
public_facing: Create separate task yml for letsencrypt/nginx/ipv6 hosts 322/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 20 Jun 2017 13:44:41 +0000 (09:44 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 20 Jun 2017 13:44:41 +0000 (09:44 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/public_facing/tasks/download.ceph.com.yml
roles/public_facing/tasks/letsencrypt_nginx.yml [new file with mode: 0644]
roles/public_facing/tasks/www.ceph.com.yml

index 632b31cc37bece03112ffe634cd269f36989156d..e9b6b8624bb04cc872ccb9d3e140163f02996fed 100644 (file)
     minute: "0"
     job: "/usr/libexec/make_timestamp"
 
-- name: Cron entry for letsencrypt cert renewal
-  cron:
-    name: "Renew letsencrypt certificate"
-    minute: "0"
-    hour: "0"
-    day: "1,15"
-    job: "/usr/bin/letsencrypt renew >> /var/log/letsencrypt.log && service nginx reload"
-
-# Get letsencrypt authority server IPv4 address
-- local_action: shell dig -4 +short acme-v01.api.letsencrypt.org | tail -n 1
-  register: letsencrypt_ipv4_address
-
-# This task really only needs to be run the first time download.ceph.com is set up.
-# An entry matching *letsencrypt* in /etc/hosts is required for the cronjob in the next task however.
-- name: Create entry for letsencrypt authority server in /etc/hosts
-  lineinfile:
-    path: /etc/hosts
-    regexp: '(.*)letsencrypt(.*)'
-    line: '{{ letsencrypt_ipv4_address.stdout }}    acme-v01.api.letsencrypt.org'
-    state: present
-
-# 'letsencrypt renew' fails because it can't reach the letsencrypt authority server using IPv6
-- name: Create cron entry to force IPv4 connectivity to letsencrypt authority server
-  cron:
-    name: "Forces letsencrypt to use IPv4 when accessing acme-v01.api.letsencrypt.org"
-    hour: "0"
-    job: "IP=$(dig -4 +short acme-v01.api.letsencrypt.org | tail -n 1) && sed -i \"s/.*letsencrypt.*/$IP\tacme-v01.api.letsencrypt.org/g\" /etc/hosts"
+- include: letsencrypt_nginx.yml
diff --git a/roles/public_facing/tasks/letsencrypt_nginx.yml b/roles/public_facing/tasks/letsencrypt_nginx.yml
new file mode 100644 (file)
index 0000000..992ff30
--- /dev/null
@@ -0,0 +1,28 @@
+---
+- name: Cron entry for letsencrypt cert renewal
+  cron:
+    name: "Renew letsencrypt certificate"
+    minute: "0"
+    hour: "0"
+    day: "1,15"
+    job: "/usr/bin/letsencrypt renew >> /var/log/letsencrypt.log && service nginx reload"
+
+# Get letsencrypt authority server IPv4 address
+- local_action: shell dig -4 +short acme-v01.api.letsencrypt.org | tail -n 1
+  register: letsencrypt_ipv4_address
+
+# This task really only needs to be run the first time download.ceph.com is set up.
+# An entry matching *letsencrypt* in /etc/hosts is required for the cronjob in the next task however.
+- name: Create entry for letsencrypt authority server in /etc/hosts
+  lineinfile:
+    path: /etc/hosts
+    regexp: '(.*)letsencrypt(.*)'
+    line: '{{ letsencrypt_ipv4_address.stdout }}    acme-v01.api.letsencrypt.org'
+    state: present
+
+# 'letsencrypt renew' fails because it can't reach the letsencrypt authority server using IPv6
+- name: Create cron entry to force IPv4 connectivity to letsencrypt authority server
+  cron:
+    name: "Forces letsencrypt to use IPv4 when accessing acme-v01.api.letsencrypt.org"
+    hour: "0"
+    job: "IP=$(dig -4 +short acme-v01.api.letsencrypt.org | tail -n 1) && sed -i \"s/.*letsencrypt.*/$IP\tacme-v01.api.letsencrypt.org/g\" /etc/hosts"
index 26dfbe6ae9d150e3d0203efbcd2906dd8d1cdf90..f28e4200082fcc8501b20746d1d4436f0aa0f9d3 100644 (file)
@@ -1,20 +1,4 @@
 ---
-- name: Cron entry for letsencrypt cert renewal
-  cron:
-    name: "Renew letsencrypt certificate"
-    minute: "0"
-    hour: "0"
-    day: "1,15"
-    job: "/usr/bin/letsencrypt renew >> /var/log/letsencrypt.log"
-
-- name: Cron entry for reloading nginx
-  cron:
-    name: "Reload nginx to keep SSL cert updated"
-    minute: "5"
-    hour: "0"
-    day: "1,15"
-    job: "/bin/systemctl reload nginx"
-
 # Wordpress has its own cron system that only runs queued jobs when the site
 # is visited.  We want certain jobs to run regardless of page visits.
 # 5 minutes was used because that's the most frequent any job is queued.
@@ -24,3 +8,5 @@
     name: "Call wp-cron.php to run Wordpress cronjobs"
     minute: "*/5"
     job: "/usr/bin/wget -q -O - http://ceph.com/wp-cron.php?doing_wp_cron"
+
+- include: letsencrypt_nginx.yml