- name: make a folder for backup scripts
win_file:
path: C:\backupscripts
state: directory
- name: set permissions for backup script folder
win_acl:
path: C:\backupscripts
user: Administrator
type: allow
rights:
- FullControl
- name: set permissions for backup script folder
win_acl:
path: C:\backupscripts
user: Users
type: deny
rights:
- FullControl
- name: upload backup script
win_template:
src: sync.bat.j2
dest: C:\backupscripts\sync.bat
TASK [upload backup script] ****************************************************
fatal: [wc]: FAILED! => {"changed": false, "checksum": "992922fbb15e0a8402e5d47e92e23d2503bd6ac6", "module_stderr": "Exception calling \"Run\" with \"1\" argument(s): \"Exception calling \"Invoke\" with \r\n\"0\" argument(s): \"The running command stopped because the preference variable \r\n\"ErrorActionPreference\" or common parameter is set to Stop: Access to the path \r\n'C:\\backupscripts\\sync.bat' is denied.\"\"\r\nAt line:65 char:5\r\n+ $output = $entrypoint.Run($payload)\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordE \r\n xception\r\n + FullyQualifiedErrorId : ScriptMethodRuntimeException\r\n \r\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
- name: disable inheritance on backupscripts
win_acl_inheritance:
path: C:\backupscripts
state: absent
- name: set administrator permissions for backup folder
win_acl:
path: C:\backupscripts
user: Administrators
type: allow
rights:
- FullControl
- name: set SYSTEM permissions for backup folder
win_acl:
path: C:\backupscripts
user: SYSTEM
type: allow
rights:
- FullControl