-- name: Test if dehydrated is already cloned
- local_action:
- module: stat
- path: /usr/local/src/LetsEncrypt/dehydrated/.git/config
- register: dehydrated
- changed_when: not dehydrated.stat.exists
-
-- block:
- - name: Install git
- become: true
- local_action:
- module: apt
- autoclean: yes
- autoremove: yes
- cache_valid_time: 3600
- install_recommends: no
- name: git
- state: latest
- update_cache: yes
-
- - name: Prepare to clone dehydrated
- local_action:
- module: file
- path: /usr/local/src/LetsEncrypt
- state: directory
-
- - name: Clone dehydrated
- local_action:
- module: git
- repo: https://github.com/lukas2511/dehydrated.git
- dest: /usr/local/src/LetsEncrypt/dehydrated
- when: not dehydrated.stat.exists
-
-- name: Prepare the server to synchronize dehydrated
- become: true
- file:
- path: /usr/local/src/LetsEncrypt
- state: directory
- owner: root
- group: staff
- mode: "ug+rwx,o+rx,g+s"
-
-- name: Synchronize dehydrated to the server
- synchronize:
- src: /usr/local/src/LetsEncrypt/dehydrated
- dest: /usr/local/src/LetsEncrypt
-
-- name: Configure dehydrated weekly run
- become: true
- copy:
- src: dehydrated
- dest: /etc/cron.weekly
- owner: root
- group: root
- mode: '0700'