adding user

This commit is contained in:
L3D 2021-12-20 18:48:05 +01:00
parent 630130a84d
commit aa51fb36bf
Signed by: l3d
GPG key ID: CD08445BFF4313D1
3 changed files with 12 additions and 8 deletions

View file

@ -10,3 +10,6 @@ WINDOWS Ansible role to create a little base Setup for my Ansible Managed Window
+ **Pass or gopass** is required to store passwords.
+ See [ansible docs](https://docs.ansible.com/ansible/latest/collections/community/general/passwordstore_lookup.html)
+ Have a password store setup. Either create a symlink from pass to gopass or use pass nativly.
+ **Language: DE**
+ We work with the German Group Names!

View file

@ -1,17 +1,15 @@
---
- name: Create Windows group ansible
become: true
- name: Create Windows group ansibles
ansible.windows.win_group:
name: 'Ansible'
name: 'Ansibles'
description: 'Group for Ansible Management'
state: present
- name: create ansible User
become: true
ansible.windows.win_user:
name: 'ansible'
state: present
password: "{{ lookup('community.general.passwordstore', win_base_init__pass_prefix + '/' + inventory_hostname + '/password create=true length=16 nosymbols=true')}}"
password: "{{ lookup('community.general.passwordstore', win_base_init__pass_prefix + '/' + inventory_hostname + '/password create=true length=16 nosymbols=true') }}"
account_disabled: false
description: 'Account to run ansible commands at this WINDOWS host'
groups_action: 'add'
@ -19,5 +17,8 @@
password_never_expires: true
user_cannot_change_password: true
groups:
- 'Users'
- 'Ansible'
- 'Ansibles'
- 'Administratoren'
- 'Benutzer'

View file

@ -1,5 +1,5 @@
---
- name: create Ansible Windows Group and User
ansible.builtin.include_task: ansible_user.yml
ansible.builtin.include_tasks: ansible_user.yml