1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
8 - name: install letsencrypt-bot
16 ignore_errors: "{{ignore_online_errors | bool}}"
19 - name: create letsencrypt user
22 home: "/var/lib/letsencrypt"
29 - name: create letsencrypt user's homedir
31 path: "/var/lib/letsencrypt"
38 - name: create letsencrypt challenge dir
40 path: "/var/www/html/dehydrated"
47 - name: create letsencrypt cert dir
49 path: "/etc/ssl/letsencrypt"
56 - name: create letsencrypt cert-rsa dir
58 path: "/etc/ssl/letsencrypt-rsa"
65 - name: fix dehydrated dir permissions
67 path: "/etc/dehydrated"
77 dest: "/etc/dehydrated/config"
82 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/config"
83 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/config"
84 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/config"
88 - name: copy config-rsa
91 dest: "/etc/dehydrated/config-rsa"
96 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/config-rsa"
97 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/config-rsa"
98 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/config-rsa"
99 - "default/config-rsa"
105 dest: "/etc/dehydrated/hook.sh"
110 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/hook.sh"
111 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/hook.sh"
112 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/hook.sh"
116 - name: copy domains.txt header
119 dest: "/etc/dehydrated/domains.txt"
124 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/domains.txt"
125 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/domains.txt"
126 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/domains.txt"
127 - "default/domains.txt"
131 - name: register with letsencrypt
132 command: "/usr/bin/dehydrated --register --accept-terms"
134 creates: "/var/lib/letsencrypt/accounts/"
136 become_user: "letsencrypt"
140 - name: copy crontab entry
143 dest: "/etc/cron.d/letsencrypt-dehydrated"
148 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/letsencrypt-dehydrated.cron"
149 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/letsencrypt-dehydrated.cron"
150 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/letsencrypt-dehydrated.cron"
151 - "default/letsencrypt-dehydrated.cron"