]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/install-dehydrated/tasks/main.yml
Fix(cleanup-tmp): Use `shell` instead of `command`
[ansible.git] / playbooks / debian / roles / install-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
7 - name: Install git
8   local_action:
9     module: apt
10     autoclean: yes
11     autoremove: yes
12     install_recommends: no
13     name: git
14     purge: yes
15     state: latest
16     update_cache: yes
17   when: not dehydrated.stat.exists
18
19 - name: Prepare to clone dehydrated
20   local_action:
21     module: file
22     path: /usr/local/src/LetsEncrypt
23     state: directory
24   when: not dehydrated.stat.exists
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 syncronize 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: Syncronize 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'