add test scripts for crontab
This commit is contained in:
27
linux_edit_crontab.yml
Normal file
27
linux_edit_crontab.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Edit Cron jobs.
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: On modifie le Crontab
|
||||
ansible.builtin.cron:
|
||||
day: "{{ lookup('env', 'VMWARE_HOST') }}"
|
||||
username: "{{ lookup('env', 'VMWARE_USER') }}"
|
||||
password: "{{ lookup('env', 'VMWARE_PASSWORD') }}"
|
||||
datacenter: "{{ esxi_host }}"
|
||||
uuid: "{{ vm_uuid }}"
|
||||
state: "{{ snap_state }}"
|
||||
snapshot_name: "{{ snap_name }}"
|
||||
description: "{{ snap_descr }}"
|
||||
register: mkcron
|
||||
|
||||
- name: move backup file
|
||||
copy:
|
||||
remote_src: yes
|
||||
src: "{{ mkcron.backup_file }}"
|
||||
dest: /tmp/cron_backup
|
||||
|
||||
- name: remove original file
|
||||
file:
|
||||
path: "{{ mkcron.backup_file }}"
|
||||
state: absent
|
||||
Reference in New Issue
Block a user