optionally create user and setup directories
This commit is contained in:
parent
289faf4905
commit
96e17c50a3
9
defaults/main.yml
Normal file
9
defaults/main.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
certbot_work_dir: /var/lib/letsencrypt
|
||||||
|
certbot_config_dir: /etc/letsencrypt
|
||||||
|
certbot_log_dir: /var/log/letsencrypt
|
||||||
|
certbot_environment:
|
||||||
|
- {{ certbot_work_dir }}
|
||||||
|
- {{ certbot_config }}
|
||||||
|
- {{ certbot_log_dir }}
|
||||||
|
certbot_user: root
|
27
tasks/install.yml
Normal file
27
tasks/install.yml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- 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
|
||||||
|
path: /etc/some_directory
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
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 }}"
|
2
tasks/main.yml
Normal file
2
tasks/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: install.yml
|
Loading…
Reference in New Issue
Block a user