From 3976546fa77dbc1fb50b12699d1790a312038b54 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Tue, 14 Jan 2020 17:29:03 +0500 Subject: [PATCH] Rename Certbot executable --- files/certbot/{certbot => certbot-auto} | 0 molecule/default/tests/test_default.py | 10 ++++++++++ tasks/certbot.yml | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) rename files/certbot/{certbot => certbot-auto} (100%) diff --git a/files/certbot/certbot b/files/certbot/certbot-auto similarity index 100% rename from files/certbot/certbot rename to files/certbot/certbot-auto diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py index 2da6532..b7f0194 100644 --- a/molecule/default/tests/test_default.py +++ b/molecule/default/tests/test_default.py @@ -56,6 +56,16 @@ def test_nginx_default_removed(host): assert not host.file('/etc/nginx/sites-enabled/default').exists +def test_certbot_exe(host): + f = host.file('/usr/local/bin/certbot-auto') + + assert f.exists + assert f.is_file + assert f.user == 'root' + assert f.group == 'root' + assert f.mode == 0o755 + + def test_certbot_cli_config(host): f = host.file('/etc/letsencrypt/cli.ini') diff --git a/tasks/certbot.yml b/tasks/certbot.yml index 38302ea..09f9029 100644 --- a/tasks/certbot.yml +++ b/tasks/certbot.yml @@ -1,8 +1,8 @@ --- - name: Install Certbot copy: - src: files/certbot/certbot - dest: /usr/local/bin/certbot + src: files/certbot/certbot-auto + dest: /usr/local/bin/certbot-auto mode: 'u=rwx,g=rx,o=rx' owner: root group: root @@ -32,7 +32,7 @@ group: root - name: Obtain Let's Encrypt certificate - command: 'certbot certonly' + command: 'certbot-auto certonly' register: common__certbot__result when: common__certbot__run|bool changed_when: >-