]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/dehydrated/tasks/main.yml
Fix(apache): Add dummy `ServerName` to start `Apache`
[ansible.git] / playbooks / debian / roles / dehydrated / tasks / main.yml
1 - name: Test if dehydrated is already cloned
2   local_action:
3     module: stat
4     path: /usr/local/src/LetsEncrypt/dehydrated/.git/config
5   register: dehydrated
6   changed_when: not dehydrated.stat.exists
7
8 - name: Install git
9   local_action:
10     module: apt
11     autoclean: yes
12     autoremove: yes
13     install_recommends: no
14     name: git
15     purge: yes
16     state: latest
17     update_cache: yes
18   when: not dehydrated.stat.exists
19
20 - name: Prepare to clone dehydrated
21   local_action:
22     module: file
23     path: /usr/local/src/LetsEncrypt
24     state: directory
25   when: not dehydrated.stat.exists
26
27 - name: Clone dehydrated
28   local_action:
29     module: git
30     repo: https://github.com/lukas2511/dehydrated.git
31     dest: /usr/local/src/LetsEncrypt/dehydrated
32   when: not dehydrated.stat.exists
33
34 - name: Prepare the server to syncronize dehydrated
35   become: true
36   file:
37     path: /usr/local/src/LetsEncrypt
38     state: directory
39     owner: root
40     group: staff
41     mode: "ug+rwx,o+rx,g+s"
42
43 - name: Syncronize dehydrated to the server
44   synchronize:
45     src: /usr/local/src/LetsEncrypt/dehydrated
46     dest: /usr/local/src/LetsEncrypt
47
48 - name: Configure dehydrated weekly run
49   become: true
50   copy:
51     src: dehydrated
52     dest: /etc/cron.weekly
53     owner: root
54     group: root
55     mode: '0700'