mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2026-08-22 07:50:43 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a49d4e63a1 | ||
|
|
7efc6a50f5 | ||
|
|
00dc226101 | ||
|
|
be44ac2dcd | ||
|
|
09b5bd20e9 | ||
|
|
6b519ffc4d |
+1
-1
@@ -7,9 +7,9 @@ env:
|
||||
- ROLE_NAME: certbot
|
||||
matrix:
|
||||
- MOLECULE_DISTRO: centos7
|
||||
MOLECULE_DOCKER_COMMAND: /usr/lib/systemd/systemd
|
||||
- MOLECULE_DISTRO: centos6
|
||||
MOLECULE_PLAYBOOK: playbook-source-install.yml
|
||||
- MOLECULE_DISTRO: ubuntu1804
|
||||
- MOLECULE_DISTRO: ubuntu1604
|
||||
- MOLECULE_DISTRO: ubuntu1404
|
||||
MOLECULE_PLAYBOOK: playbook-source-install.yml
|
||||
|
||||
@@ -16,8 +16,8 @@ The variable `certbot_install_from_source` controls whether to install Certbot f
|
||||
|
||||
certbot_auto_renew: true
|
||||
certbot_auto_renew_user: "{{ ansible_user | default(lookup('env', 'USER')) }}"
|
||||
certbot_auto_renew_hour: 3
|
||||
certbot_auto_renew_minute: 30
|
||||
certbot_auto_renew_hour: "3"
|
||||
certbot_auto_renew_minute: "30"
|
||||
certbot_auto_renew_options: "--quiet --no-self-upgrade"
|
||||
|
||||
By default, this role configures a cron job to run under the provided user account at the given hour and minute, every day. The defaults run `certbot renew` (or `certbot-auto renew`) via cron every day at 03:30:00 by the user you use in your Ansible playbook. It's preferred that you set a custom user/hour/minute so the renewal is during a low-traffic period and done by a non-root user account.
|
||||
@@ -26,7 +26,7 @@ By default, this role configures a cron job to run under the provided user accou
|
||||
|
||||
Currently there is one built-in method for generating new certificates using this role: `standalone`. Other methods (e.g. using nginx or apache and a webroot) may be added in the future.
|
||||
|
||||
**For a complete example**: see the fully functional test playbook in [tests/test-standalone-nginx-aws.yml](tests/test-standalone-nginx-aws.yml).
|
||||
**For a complete example**: see the fully functional test playbook in [molecule/default/playbook-standalone-nginx-aws.yml](molecule/default/playbook-standalone-nginx-aws.yml).
|
||||
|
||||
certbot_create_if_missing: false
|
||||
certbot_create_method: standalone
|
||||
@@ -91,8 +91,8 @@ None.
|
||||
|
||||
vars:
|
||||
certbot_auto_renew_user: your_username_here
|
||||
certbot_auto_renew_minute: 20
|
||||
certbot_auto_renew_hour: 5
|
||||
certbot_auto_renew_minute: "20"
|
||||
certbot_auto_renew_hour: "5"
|
||||
|
||||
roles:
|
||||
- geerlingguy.certbot
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
# Certbot auto-renew cron job configuration (for certificate renewals).
|
||||
certbot_auto_renew: true
|
||||
certbot_auto_renew_user: "{{ ansible_user | default(lookup('env', 'USER')) }}"
|
||||
certbot_auto_renew_hour: 3
|
||||
certbot_auto_renew_minute: 30
|
||||
certbot_auto_renew_hour: "3"
|
||||
certbot_auto_renew_minute: "30"
|
||||
certbot_auto_renew_options: "--quiet --no-self-upgrade"
|
||||
|
||||
# Parameters used when creating new Certbot certs.
|
||||
|
||||
@@ -9,8 +9,10 @@ lint:
|
||||
config-file: molecule/default/yaml-lint.yml
|
||||
platforms:
|
||||
- name: instance
|
||||
image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible
|
||||
command: ${MOLECULE_DOCKER_COMMAND:-"sleep infinity"}
|
||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
provisioner:
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import os
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
def test_hosts_file(host):
|
||||
f = host.file('/etc/hosts')
|
||||
|
||||
assert f.exists
|
||||
assert f.user == 'root'
|
||||
assert f.group == 'root'
|
||||
@@ -12,7 +12,7 @@
|
||||
with_items: "{{ certbot_create_standalone_stop_services }}"
|
||||
|
||||
- name: Generate new certificate if one doesn't exist.
|
||||
shell: "{{ certbot_create_command }}"
|
||||
command: "{{ certbot_create_command }}"
|
||||
when: not letsencrypt_cert.stat.exists
|
||||
|
||||
- name: Start services after cert has been generated.
|
||||
|
||||
Reference in New Issue
Block a user