mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2026-08-22 07:50:43 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
574c0843c8 | ||
|
|
f00a0ba181 | ||
|
|
01d801c4b7 | ||
|
|
3b47bfb39e | ||
|
|
da3ad13935 | ||
|
|
932214698b | ||
|
|
2f8a0f06d5 | ||
|
|
24d40c7b10 | ||
|
|
1ca3e00b46 | ||
|
|
065d889858 | ||
|
|
da5a6738d5 | ||
|
|
e82a68e331 | ||
|
|
92ef96faff | ||
|
|
c82468099b | ||
|
|
1f89316182 | ||
|
|
141dd08882 | ||
|
|
ef18833af5 | ||
|
|
afa993333f | ||
|
|
33724b0a93 | ||
|
|
b82eeeed79 | ||
|
|
f3a260e94e | ||
|
|
35ceee9f1b | ||
|
|
3dedd45961 | ||
|
|
806d612fab | ||
|
|
52dbc87e22 | ||
|
|
222d57cb2e | ||
|
|
7c8e2e5735 | ||
|
|
b5ff8d4886 | ||
|
|
bca9164582 | ||
|
|
353747a915 | ||
|
|
d76e3915fe | ||
|
|
a2f63847fd | ||
|
|
18e2752f0e | ||
|
|
ea45b22546 | ||
|
|
565678e559 | ||
|
|
c84f967a08 | ||
|
|
373fa29f60 | ||
|
|
ca23b73996 | ||
|
|
7daaa25cf2 | ||
|
|
e9f5e5e30f | ||
|
|
eece6540a2 | ||
|
|
c762892bb1 | ||
|
|
65071dd992 | ||
|
|
444064222b |
@@ -0,0 +1,2 @@
|
|||||||
|
*.retry
|
||||||
|
tests/test.sh
|
||||||
+14
-44
@@ -1,53 +1,23 @@
|
|||||||
---
|
---
|
||||||
sudo: required
|
services: docker
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- distribution: centos
|
- distro: centos7
|
||||||
version: 6
|
- distro: centos6
|
||||||
init: /sbin/init
|
playbook: test-source-install.yml
|
||||||
run_opts: ""
|
- distro: ubuntu1604
|
||||||
- distribution: centos
|
- distro: ubuntu1404
|
||||||
version: 7
|
playbook: test-source-install.yml
|
||||||
init: /usr/lib/systemd/systemd
|
- distro: debian8
|
||||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
playbook: test-source-install.yml
|
||||||
- distribution: ubuntu
|
|
||||||
version: 14.04
|
|
||||||
init: /sbin/init
|
|
||||||
run_opts: ""
|
|
||||||
- distribution: ubuntu
|
|
||||||
version: 12.04
|
|
||||||
init: /sbin/init
|
|
||||||
run_opts: ""
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
# Pull container
|
|
||||||
- 'sudo docker pull ${distribution}:${version}'
|
|
||||||
# Customize container
|
|
||||||
- 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- container_id=$(mktemp)
|
# Download test shim.
|
||||||
# Run container in detached state
|
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
|
||||||
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"'
|
- chmod +x ${PWD}/tests/test.sh
|
||||||
|
|
||||||
# Ansible syntax check.
|
# Run tests.
|
||||||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check'
|
- ${PWD}/tests/test.sh
|
||||||
|
|
||||||
# Test role.
|
|
||||||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml'
|
|
||||||
|
|
||||||
# Test role idempotence.
|
|
||||||
- >
|
|
||||||
sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml
|
|
||||||
| grep -q 'changed=0.*failed=0'
|
|
||||||
&& (echo 'Idempotence test: pass' && exit 0)
|
|
||||||
|| (echo 'Idempotence test: fail' && exit 1)
|
|
||||||
|
|
||||||
# Clean up
|
|
||||||
- 'sudo docker stop "$(cat ${container_id})"'
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2017 Jeff Geerling
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
@@ -1,16 +1,39 @@
|
|||||||
# Ansible Role: Let's Encrypt
|
# Ansible Role: Certbot (for Let's Encrypt)
|
||||||
|
|
||||||
[](https://travis-ci.org/geerlingguy/ansible-role-letsencrypt)
|
[](https://travis-ci.org/geerlingguy/ansible-role-certbot)
|
||||||
|
|
||||||
Installs Let's Encrypt for RHEL/CentOS or Debian/Ubuntu.
|
Installs and configures Certbot (for Let's Encrypt).
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
Let's Encrypt requires `git` to be installed. You can install using the `geerlingguy.git` role.
|
If installing from source, Git is required. You can install Git using the `geerlingguy.git` role.
|
||||||
|
|
||||||
## Role Variables
|
## Role Variables
|
||||||
|
|
||||||
None.
|
The variable `certbot_install_from_source` controls whether to install Certbot from Git or package management. The latter is the default, so the variable defaults to `no`.
|
||||||
|
|
||||||
|
certbot_auto_renew: true
|
||||||
|
certbot_auto_renew_user: "{{ ansible_user }}"
|
||||||
|
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.
|
||||||
|
|
||||||
|
### Source Installation from Git
|
||||||
|
|
||||||
|
You can install Certbot from it's Git source repository if desired. This might be useful in several cases, but especially when older distributions don't have Certbot packages available (e.g. CentOS < 7, Ubuntu < 16.10 and Debian < 8).
|
||||||
|
|
||||||
|
certbot_install_from_source: no
|
||||||
|
certbot_repo: https://github.com/certbot/certbot.git
|
||||||
|
certbot_version: master
|
||||||
|
certbot_keep_updated: yes
|
||||||
|
|
||||||
|
Certbot Git repository options. To install from source, set `certbot_install_from_source` to `yes`. This clones the configured `certbot_repo`, respecting the `certbot_version` setting. If `certbot_keep_updated` is set to `yes`, the repository is updated every time this role runs.
|
||||||
|
|
||||||
|
certbot_dir: /opt/certbot
|
||||||
|
|
||||||
|
The directory inside which Certbot will be cloned.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
@@ -19,8 +42,44 @@ None.
|
|||||||
## Example Playbook
|
## Example Playbook
|
||||||
|
|
||||||
- hosts: servers
|
- hosts: servers
|
||||||
|
|
||||||
|
vars:
|
||||||
|
certbot_auto_renew_user: your_username_here
|
||||||
|
certbot_auto_renew_minute: 20
|
||||||
|
certbot_auto_renew_hour: 5
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- geerlingguy.letsencrypt
|
- geerlingguy.certbot
|
||||||
|
|
||||||
|
### Creating certificates with certbot
|
||||||
|
|
||||||
|
After installation, you can create certificates using the `certbot` (or `certbot-auto`) script (use `letsencrypt` on Ubuntu 16.04, or use `/opt/certbot/certbot-auto` if installing from source/Git. Here are some example commands to configure certificates with Certbot:
|
||||||
|
|
||||||
|
# Automatically add certs for all Apache virtualhosts (use with caution!).
|
||||||
|
certbot --apache
|
||||||
|
|
||||||
|
# Generate certs, but don't modify Apache configuration (safer).
|
||||||
|
certbot --apache certonly
|
||||||
|
|
||||||
|
If you want to fully automate the process of adding a new certificate, you can do so using the command line options to register, accept the terms of service, and then generate a cert using the standalone server:
|
||||||
|
|
||||||
|
1. Make sure any services listening on port 80 (Apache, Nginx, Varnish, etc.) are stopped.
|
||||||
|
2. Register with something like `certbot register --agree-tos --email [your-email@example.com]`
|
||||||
|
- Note: You won't need to do this step in the future, when generating additional certs on the same server.
|
||||||
|
3. Generate a cert for a domain whose DNS points to this server: `certbot certonly --noninteractive --standalone -d example.com -d www.example.com`
|
||||||
|
4. Re-start whatever was listening on port 80 before.
|
||||||
|
5. Update your webserver's virtualhost TLS configuration to point at the new certificate (`fullchain.pem`) and private key (`privkey.pem`) Certbot just generated for the domain you passed in the `certbot` command.
|
||||||
|
6. Restart your webserver so it uses the new HTTPS virtualhost configuration.
|
||||||
|
|
||||||
|
### Certbot certificate auto-renewal
|
||||||
|
|
||||||
|
By default, this role adds a cron job that will renew all installed certificates once per day at the hour and minute of your choosing.
|
||||||
|
|
||||||
|
You can test the auto-renewal (without actually renewing the cert) with the command:
|
||||||
|
|
||||||
|
/opt/certbot/certbot-auto renew --dry-run
|
||||||
|
|
||||||
|
See full documentation and options on the [Certbot website](https://certbot.eff.org/).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
@@ -28,4 +87,4 @@ MIT / BSD
|
|||||||
|
|
||||||
## Author Information
|
## Author Information
|
||||||
|
|
||||||
This role was created in 2016 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/).
|
This role was created in 2016 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
|
||||||
|
|||||||
+15
-4
@@ -1,6 +1,17 @@
|
|||||||
---
|
---
|
||||||
letsencrypt_repo: https://github.com/letsencrypt/letsencrypt
|
# Certbot auto-renew cron job configuration (for certificate renewals).
|
||||||
letsencrypt_version: master
|
certbot_auto_renew: true
|
||||||
letsencrypt_keep_updated: yes
|
certbot_auto_renew_user: "{{ ansible_user }}"
|
||||||
|
certbot_auto_renew_hour: 3
|
||||||
|
certbot_auto_renew_minute: 30
|
||||||
|
certbot_auto_renew_options: "--quiet --no-self-upgrade"
|
||||||
|
|
||||||
letsencrypt_dir: /opt/letsencrypt
|
# To install from source (on older OSes or if you need a specific or newer
|
||||||
|
# version of Certbot), set this variable to `yes` and configure other options.
|
||||||
|
certbot_install_from_source: no
|
||||||
|
certbot_repo: https://github.com/certbot/certbot.git
|
||||||
|
certbot_version: master
|
||||||
|
certbot_keep_updated: yes
|
||||||
|
|
||||||
|
# Where to put Certbot when installing from source.
|
||||||
|
certbot_dir: /opt/certbot
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# TODO
|
|
||||||
+11
-2
@@ -3,15 +3,18 @@ dependencies: []
|
|||||||
|
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: geerlingguy
|
author: geerlingguy
|
||||||
description: "Let's Encrypt for RHEL/CentOS and Debian/Ubuntu."
|
description: "Installs and configures Certbot (for Let's Encrypt)."
|
||||||
company: "Midwestern Mac, LLC"
|
company: "Midwestern Mac, LLC"
|
||||||
license: "license (BSD, MIT)"
|
license: "license (BSD, MIT)"
|
||||||
min_ansible_version: 1.8
|
min_ansible_version: 2.0
|
||||||
platforms:
|
platforms:
|
||||||
- name: EL
|
- name: EL
|
||||||
versions:
|
versions:
|
||||||
- 6
|
- 6
|
||||||
- 7
|
- 7
|
||||||
|
- name: Fedora
|
||||||
|
versions:
|
||||||
|
- all
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
- all
|
- all
|
||||||
@@ -22,3 +25,9 @@ galaxy_info:
|
|||||||
- networking
|
- networking
|
||||||
- system
|
- system
|
||||||
- web
|
- web
|
||||||
|
- certbot
|
||||||
|
- letsencrypt
|
||||||
|
- encryption
|
||||||
|
- certificates
|
||||||
|
- ssl
|
||||||
|
- https
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: Load a variable file based on the OS type, or a default if not found.
|
||||||
|
include_vars: "{{ item }}"
|
||||||
|
with_first_found:
|
||||||
|
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
|
||||||
|
- "{{ ansible_distribution }}.yml"
|
||||||
|
- "{{ ansible_os_family }}.yml"
|
||||||
|
- "default.yml"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
- name: Clone Certbot into configured directory.
|
||||||
|
git:
|
||||||
|
repo: "{{ certbot_repo }}"
|
||||||
|
dest: "{{ certbot_dir }}"
|
||||||
|
version: "{{ certbot_version }}"
|
||||||
|
update: "{{ certbot_keep_updated }}"
|
||||||
|
force: yes
|
||||||
|
|
||||||
|
- name: Set Certbot script variable.
|
||||||
|
set_fact:
|
||||||
|
certbot_script: "{{ certbot_dir }}/certbot-auto"
|
||||||
|
|
||||||
|
- name: Ensure certbot-auto is executable.
|
||||||
|
file:
|
||||||
|
path: "{{ certbot_script }}"
|
||||||
|
mode: 0755
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: Install Certbot.
|
||||||
|
package: "name={{ certbot_package }} state=present"
|
||||||
|
|
||||||
|
- name: Set Certbot script variable.
|
||||||
|
set_fact:
|
||||||
|
certbot_script: "{{ certbot_package }}"
|
||||||
+10
-6
@@ -1,7 +1,11 @@
|
|||||||
---
|
---
|
||||||
- name: Clone Let's Encrypt into configured directory.
|
- include: include-vars.yml
|
||||||
git:
|
|
||||||
repo: "{{ letsencrypt_repo }}"
|
- include: install-with-package.yml
|
||||||
dest: "{{ letsencrypt_dir }}"
|
when: not certbot_install_from_source
|
||||||
version: "{{ letsencrypt_version }}"
|
|
||||||
update: "{{ letsencrypt_keep_updated }}"
|
- include: install-from-source.yml
|
||||||
|
when: certbot_install_from_source
|
||||||
|
|
||||||
|
- include: renew-cron.yml
|
||||||
|
when: certbot_auto_renew
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: Add cron job for certbot renewal (if configured).
|
||||||
|
cron:
|
||||||
|
name: Certbot automatic renewal.
|
||||||
|
job: "{{ certbot_script }} renew {{ certbot_auto_renew_options }}"
|
||||||
|
minute: "{{ certbot_auto_renew_minute }}"
|
||||||
|
hour: "{{ certbot_auto_renew_hour }}"
|
||||||
|
user: "{{ certbot_auto_renew_user }}"
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
FROM centos:6
|
|
||||||
|
|
||||||
# Install Ansible
|
|
||||||
RUN yum -y update; yum clean all;
|
|
||||||
RUN yum -y install epel-release
|
|
||||||
RUN yum -y install git python-setuptools gcc sudo libffi-devel python-devel openssl-devel
|
|
||||||
RUN yum clean all
|
|
||||||
RUN easy_install pip
|
|
||||||
RUN pip install ansible
|
|
||||||
|
|
||||||
|
|
||||||
# Disable requiretty
|
|
||||||
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
|
|
||||||
|
|
||||||
# Install Ansible inventory file
|
|
||||||
RUN mkdir - p /etc/ansible
|
|
||||||
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
|
|
||||||
|
|
||||||
CMD ["/usr/sbin/init"]
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
FROM centos:7
|
|
||||||
|
|
||||||
# Install systemd -- See https://hub.docker.com/_/centos/
|
|
||||||
RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs
|
|
||||||
RUN yum -y update; yum clean all; \
|
|
||||||
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
|
||||||
rm -f /lib/systemd/system/multi-user.target.wants/*; \
|
|
||||||
rm -f /etc/systemd/system/*.wants/*; \
|
|
||||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
|
||||||
rm -f /lib/systemd/system/basic.target.wants/*; \
|
|
||||||
rm -f /lib/systemd/system/anaconda.target.wants/*;
|
|
||||||
|
|
||||||
# Install Ansible
|
|
||||||
RUN yum -y install git python-setuptools gcc sudo libffi-devel python-devel openssl-devel
|
|
||||||
RUN yum clean all
|
|
||||||
RUN easy_install pip
|
|
||||||
RUN pip install ansible
|
|
||||||
|
|
||||||
# Disable requiretty
|
|
||||||
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
|
|
||||||
|
|
||||||
# Install Ansible inventory file
|
|
||||||
RUN mkdir - p /etc/ansible
|
|
||||||
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
|
|
||||||
|
|
||||||
VOLUME ["/sys/fs/cgroup"]
|
|
||||||
CMD ["/usr/sbin/init"]
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
FROM ubuntu:12.04
|
|
||||||
RUN apt-get update
|
|
||||||
|
|
||||||
# Install Ansible
|
|
||||||
RUN apt-get install -y software-properties-common python-software-properties git
|
|
||||||
RUN apt-add-repository -y ppa:ansible/ansible
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get install -y ansible
|
|
||||||
|
|
||||||
# Install Ansible inventory file
|
|
||||||
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
FROM ubuntu:14.04
|
|
||||||
RUN apt-get update
|
|
||||||
|
|
||||||
# Install Ansible
|
|
||||||
RUN apt-get install -y software-properties-common git
|
|
||||||
RUN apt-add-repository -y ppa:ansible/ansible
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get install -y ansible
|
|
||||||
|
|
||||||
# Install Ansible inventory file
|
|
||||||
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Ansible Role tests
|
||||||
|
|
||||||
|
To run the test playbook(s) in this directory:
|
||||||
|
|
||||||
|
1. Install and start Docker.
|
||||||
|
1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`:
|
||||||
|
- `wget -O tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/`
|
||||||
|
1. Make the test shim executable: `chmod +x tests/test.sh`.
|
||||||
|
1. Run (from the role root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh`
|
||||||
|
|
||||||
|
If you don't want the container to be automatically deleted after the test playbook is run, add the following environment variables: `cleanup=false container_id=$(date +%s)`
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- src: geerlingguy.git
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
|
||||||
|
vars:
|
||||||
|
certbot_install_from_source: yes
|
||||||
|
|
||||||
|
pre_tasks:
|
||||||
|
- name: Update apt cache.
|
||||||
|
apt: update_cache=yes cache_valid_time=600
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Install cron (RedHat).
|
||||||
|
yum: name=cronie state=present
|
||||||
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
|
- name: Install cron (Debian).
|
||||||
|
apt: name=cron state=present
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- geerlingguy.git
|
||||||
|
- role_under_test
|
||||||
@@ -1,5 +1,19 @@
|
|||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
|
|
||||||
|
pre_tasks:
|
||||||
|
- name: Update apt cache.
|
||||||
|
apt: update_cache=yes cache_valid_time=600
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Install cron (RedHat).
|
||||||
|
yum: name=cronie state=present
|
||||||
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
|
- name: Install cron (Debian).
|
||||||
|
apt: name=cron state=present
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role_under_test
|
- role_under_test
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
samba_daemon: smbd
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
samba_daemon: smb
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
certbot_package: letsencrypt
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
certbot_package: certbot
|
||||||
Reference in New Issue
Block a user