]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/dehydrated/tasks/main.yml
0b7ae4d9901c72c960c72a1e9614cc2f3e7c69d3
[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 - block:
9     - name: Install git
10       become: true
11       local_action:
12         module: apt
13         autoclean: yes
14         autoremove: yes
15         install_recommends: no
16         name: git
17         state: latest
18         update_cache: yes
19
20     - name: Prepare to clone dehydrated
21       local_action:
22         module: file
23         path: /usr/local/src/LetsEncrypt
24         state: directory
25
26     - name: Clone dehydrated
27       local_action:
28         module: git
29         repo: https://github.com/lukas2511/dehydrated.git
30         dest: /usr/local/src/LetsEncrypt/dehydrated
31   when: not dehydrated.stat.exists
32
33 - name: Prepare the server to synchronize dehydrated
34   become: true
35   file:
36     path: /usr/local/src/LetsEncrypt
37     state: directory
38     owner: root
39     group: staff
40     mode: "ug+rwx,o+rx,g+s"
41
42 - name: Synchronize dehydrated to the server
43   synchronize:
44     src: /usr/local/src/LetsEncrypt/dehydrated
45     dest: /usr/local/src/LetsEncrypt
46
47 - name: Configure dehydrated weekly run
48   become: true
49   copy:
50     src: dehydrated
51     dest: /etc/cron.weekly
52     owner: root
53     group: root
54     mode: '0700'