Mirrormanager: get a unique job name in move-to-archive
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
parent
a30ae9f17a
commit
e7cfb0ea69
2 changed files with 8 additions and 2 deletions
|
@ -16,6 +16,8 @@
|
|||
- /srv/web/infra/ansible/vars/apps/mirrormanager.yml
|
||||
handlers:
|
||||
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
||||
vars:
|
||||
job_name: move-to-archive-{{ product|lower|replace(" ", "-") }}-{{ version|lower|replace(" ", "-") }}-{{ ansible_date_time.epoch }}
|
||||
|
||||
pre_tasks:
|
||||
- name: Validate the product {{ product }}
|
||||
|
@ -39,4 +41,8 @@
|
|||
|
||||
tasks:
|
||||
- debug:
|
||||
msg: "Job started. You can watch the logs with:\noc -n mirrormanager logs -f job/move-to-archive-{{product|lower|replace(' ', '-')}}-{{version|lower|replace(' ', '-')}}"
|
||||
msg: "Job started. You can watch the logs with:\noc -n mirrormanager logs -f job/{{job_name}}"
|
||||
- debug:
|
||||
msg: "You can cancel it with:\noc -n mirrormanager delete job/{{job_name}}"
|
||||
- debug:
|
||||
msg: "When it's done, clean it up with:\noc -n mirrormanager delete job/{{job_name}}"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: move-to-archive-{{ product|lower|replace(" ", "-") }}-{{ version|lower|replace(" ", "-") }}
|
||||
name: "{{ job_name }}"
|
||||
spec:
|
||||
parallelism: 1
|
||||
completions: 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue