From 80d9b2aacb2de55dd549000a78f85094fa5d5556 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 15 Dec 2021 01:03:37 +0100 Subject: [PATCH] start creating ansible tasks --- defaults/main.yml | 2 ++ tasks/ansible_user.yml | 24 ++++++++++++++++++++++++ tasks/main.yml | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 defaults/main.yml create mode 100644 tasks/ansible_user.yml create mode 100644 tasks/main.yml diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..2531eff --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +win_base_init__ansible_password: '' diff --git a/tasks/ansible_user.yml b/tasks/ansible_user.yml new file mode 100644 index 0000000..9a01ad1 --- /dev/null +++ b/tasks/ansible_user.yml @@ -0,0 +1,24 @@ +--- +- name: Create Windows group ansible + become: true + ansible.windows.win_group: + name: 'Ansible' + description: 'Group for Ansible Management' + state: present + +- name: create ansible User + become: true + ansible.windows.win_user: + name: 'ansible' + state: present + password: + account_disabled: false + description: 'Account to run ansible commands at this WINDOWS host' + groups_action: 'add' + password_expired: false + password_never_expires: true + user_cannot_change_password: true + groups: + - 'Users' + - 'Administrator' + - 'Ansible' diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..423d8f4 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- name: create Ansible Windows Group and User + ansible.builtin.include_task: ansible_user.yml