2018-06-22 19:18:48 +00:00
|
|
|
---
|
|
|
|
- name: Create certbot user '{{ certbot_user }}'
|
|
|
|
user:
|
|
|
|
name: "{{ certbot_user }}"
|
|
|
|
become: True
|
|
|
|
become_user: root
|
|
|
|
when: not certbot_user == root
|
|
|
|
|
|
|
|
- name: Deploy certbot
|
|
|
|
block:
|
|
|
|
- name: Install certbot
|
|
|
|
package:
|
|
|
|
name: certbot
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Create certbot environment
|
2018-06-22 19:39:52 +00:00
|
|
|
file:
|
|
|
|
path: "{{ item.name }}"
|
2018-06-22 19:18:48 +00:00
|
|
|
state: directory
|
2018-06-22 19:39:52 +00:00
|
|
|
mode: "{{ item.mode }}"
|
2018-06-22 19:18:48 +00:00
|
|
|
with_items: "{{ certbot_environment }}"
|
|
|
|
|
|
|
|
- name: Deploy config file
|
|
|
|
template:
|
|
|
|
src: etc/ssh/sshd_config.j2
|
|
|
|
dest: /etc/ssh/sshd_config
|
|
|
|
become: True
|
|
|
|
become_user: "{{ certbot_user }}"
|