mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 17:17:21 +00:00
Fixed scheduled task creation
This commit is contained in:
1 parent
7b6450a1c2
commit
bf4e24c40d
1 file changed
+15
-6
@@ -15,19 +15,27 @@
|
|||||||
- name: Create Scheduled Tasks
|
- name: Create Scheduled Tasks
|
||||||
tags: create_scheduled_tasks
|
tags: create_scheduled_tasks
|
||||||
block:
|
block:
|
||||||
|
- name: Get date +5 minutes for task start time
|
||||||
|
vars:
|
||||||
|
ansible_connection: local
|
||||||
|
shell: /usr/bin/date --date="+5 minutes" "+%Y-%m-%dT%T"
|
||||||
|
delegate_to: localhost
|
||||||
|
register: task_start_time
|
||||||
|
|
||||||
- name: Create export scheduled task
|
- name: Create export scheduled task
|
||||||
community.windows.win_scheduled_task:
|
community.windows.win_scheduled_task:
|
||||||
name: Export
|
name: Export
|
||||||
description: Move files from Windows projects on S:\ to the folders on T:\ for Transfer
|
description: Move files from Windows projects on S:\ to the folders on T:\ for Transfer
|
||||||
username: "{{ win_project }}\\{{ filetransfer_user }}"
|
username: "{{ win_project }}\\{{ filetransfer_user }}"
|
||||||
password: "{{ transfer_user_password }}"
|
password: "{{ transfer_user_password }}"
|
||||||
logon_type: password
|
logon_type: s4u
|
||||||
path: "{{ scheduled_task_path }}"
|
path: "{{ scheduled_task_path }}"
|
||||||
actions:
|
actions:
|
||||||
- path: "{{ powershell_path }}"
|
- path: "{{ powershell_path }}"
|
||||||
arguments: "{{ script_folder }}\\{{ export_script }}"
|
arguments: "-NonInteractive -File {{ script_folder }}\\{{ export_script }}"
|
||||||
triggers:
|
triggers:
|
||||||
- type: registration
|
- type: daily
|
||||||
|
start_boundary: "{{ task_start_time.stdout }}"
|
||||||
repetition:
|
repetition:
|
||||||
interval: PT5M
|
interval: PT5M
|
||||||
|
|
||||||
@@ -37,13 +45,14 @@
|
|||||||
description: Move files from Windows projects on T:\ to the folders on S:\ for Transfer
|
description: Move files from Windows projects on T:\ to the folders on S:\ for Transfer
|
||||||
username: "{{ win_project }}\\{{ filetransfer_user }}"
|
username: "{{ win_project }}\\{{ filetransfer_user }}"
|
||||||
password: "{{ transfer_user_password }}"
|
password: "{{ transfer_user_password }}"
|
||||||
logon_type: password
|
logon_type: s4u
|
||||||
path: "{{ scheduled_task_path }}"
|
path: "{{ scheduled_task_path }}"
|
||||||
actions:
|
actions:
|
||||||
- path: "{{ powershell_path }}"
|
- path: "{{ powershell_path }}"
|
||||||
arguments: "{{ script_folder }}\\{{ import_script }}"
|
arguments: "-NonInteractive -File {{ script_folder }}\\{{ import_script }}"
|
||||||
triggers:
|
triggers:
|
||||||
- type: registration
|
- type: daily
|
||||||
|
start_boundary: "{{ task_start_time.stdout }}"
|
||||||
repetition:
|
repetition:
|
||||||
interval: PT5M
|
interval: PT5M
|
||||||
when: inventory_hostname in groups['meta-name_fs01']
|
when: inventory_hostname in groups['meta-name_fs01']
|
||||||
Reference in new issue
Block a user