mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-11-01 20:20:15 +00:00
Added win_user role
This commit is contained in:
1 parent
e44a1566ad
commit
13f8c7fc20
5 files changed
+77
No files matched your search
@@ -0,0 +1,44 @@
|
||||
---
|
||||
- name: Check user
|
||||
tags: check_user
|
||||
block:
|
||||
- name: Verify study group exists
|
||||
win_domain_group:
|
||||
name: "{{ study_code }}"
|
||||
description: "{{ study_code }} study"
|
||||
path: "ou=Project Groups,dc={{ win_project }},dc=loc"
|
||||
scope: domainlocal
|
||||
category: security
|
||||
state: present
|
||||
check_mode: true
|
||||
changed_when: false
|
||||
register: group
|
||||
|
||||
- name: Check if study folder already exists
|
||||
win_stat:
|
||||
path: "{{ study_folder }}"
|
||||
register: folder
|
||||
delegate_to: "{{ os_project }}-{{ win_project }}-fs01"
|
||||
|
||||
- name: Verify User does not already exist
|
||||
win_domain_user:
|
||||
name: "{{ username }}"
|
||||
state: query
|
||||
register: user
|
||||
|
||||
- name: Duplicate User Detected
|
||||
fail:
|
||||
msg="This study has not been created yet"
|
||||
when: group.created == true or
|
||||
folder.stat.exists == false
|
||||
|
||||
- name: Duplicate User Detected
|
||||
fail:
|
||||
msg="This User already exists"
|
||||
when: user.state == "present"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user