[service] make cron optional
parent
305c61b2fe
commit
2299dbd8f4
group_vars
host_vars/routeur-gulp.cachan-adm.crans.org
roles/service
tasks
templates/cron.d
|
@ -8,7 +8,8 @@ glob_service_dhcp:
|
|||
name: dhcp
|
||||
install_dir: /var/local/services/dhcp
|
||||
generated: yes
|
||||
frequency: "*/2 * * * *"
|
||||
options: -q
|
||||
cron:
|
||||
frequency: "*/2 * * * *"
|
||||
options: -q
|
||||
dependencies:
|
||||
- python3-jinja2
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
glob_service_firewall:
|
||||
name: firewall
|
||||
install_dir: /var/local/services/firewall
|
||||
frequency: "*/2 * * * *"
|
||||
options: -q
|
||||
cron:
|
||||
frequency: "*/2 * * * *"
|
||||
options: -q
|
||||
dependencies:
|
||||
- python3-iso8601
|
||||
- python3-jinja2
|
||||
|
|
|
@ -6,8 +6,9 @@ loc_service_prefix_delegation:
|
|||
user: services
|
||||
password: "{{ vault.re2o_service_password }}"
|
||||
name: prefix_delegation
|
||||
install_dir: /var/local/services/prefix_delegation
|
||||
frequency: "*/5 * * * *"
|
||||
cron:
|
||||
install_dir: /var/local/services/prefix_delegation
|
||||
frequency: "*/5 * * * *"
|
||||
dependencies:
|
||||
- python3-iso8601
|
||||
git:
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
register: apt_result
|
||||
retries: 3
|
||||
until: apt_result is succeeded
|
||||
when: service.dependencies is defined
|
||||
|
||||
- name: Create service directory
|
||||
file:
|
||||
|
@ -54,6 +55,7 @@
|
|||
template:
|
||||
src: cron.d/service.j2
|
||||
dest: "/etc/cron.d/services-{{ service.name }}"
|
||||
when: service.cron is defined
|
||||
|
||||
- name: Deploy service configuration
|
||||
template:
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
{{ ansible_header | comment }}
|
||||
{{ service.frequency }} root /usr/bin/python3 {{ service.install_dir }}/{{ service.name }}.py {{ service.options | default("") }}
|
||||
{{ service.cron.frequency }} root /usr/bin/python3 {{ service.install_dir }}/{{ service.name }}.py {{ service.cron.options | default("") }}
|
||||
|
|
Loading…
Reference in New Issue