Skip to content

Commit

Permalink
Do some refactorin'.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Sep 24, 2024
1 parent 56abadc commit cc1cc58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions roles/deploy_website/tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@

- name: 'Ensure website crontab file exists'
block:
- name: 'Set release crontab file name variable'
ansible.builtin.set_fact:
__release_crontab: 'website-{{ deploy_website__site_domain | replace(".", "-") }}'

- name: 'Ensure existing website crontab file is cleared'
ansible.builtin.file:
path: '/etc/cron.d/website-{{ deploy_website__site_domain | replace(".", "-") }}'
path: '/etc/cron.d/{{ __release_crontab }}'
state: 'absent'

- name: 'Ensure base website crontab file exists'
ansible.builtin.cron:
cron_file: 'website-{{ deploy_website__site_domain | replace(".", "-") }}'
cron_file: '{{ __release_crontab }}'
env: true
job: '{{ item.job }}'
name: '{{ item.name }}'
Expand All @@ -54,7 +58,3 @@
name: 'BASH_ENV'
- job: '{{ deploy_website__administrator_email }}'
name: 'MAILTO'

- name: 'Set release crontab file name variable'
ansible.builtin.set_fact:
__release_crontab: 'website-{{ deploy_website__site_domain | replace(".", "-") }}'
7 changes: 4 additions & 3 deletions roles/development/tasks/entr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
when: __entr_binary.stat.exists
block:
- name: 'Get entr usage output'
ansible.builtin.command:
cmd: '/usr/local/bin/entr'
ansible.builtin.shell:
# entr does not have a help flag, but will display its version
# if you run entr incorrectly without any arguments.
cmd: '/usr/local/bin/entr || /bin/true'
changed_when: false
ignore_errors: true
register: __entr_output

- name: 'Get the version of entr that is currently installed (if available)'
Expand Down

0 comments on commit cc1cc58

Please sign in to comment.