change inital VM password

This commit is contained in:
abrown38 committed 2024-04-07 17:54:47 +00:00
1 parent 61333650a7
commit 0f0867998b
3 files changed
+53 -2

No files matched your search

@@ -1,4 +1,27 @@
---
- name: Password
tags:
- password
- password_check
- always
block:
- name: Check for pending password status
set_fact:
ansible_password: "{{ vm_initial_password }}"
run_once: true
when: password_status == 'pending'
- name: Check for finished or change password status
set_fact:
ansible_password: "{{ vm_password }}"
run_once: true
when: password_status == 'finished' or
password_status == 'change'
- name: Test password
win_ping:
tags: initial_ping
- name: Ping Windows hosts
win_ping:
tags: initial_ping
@@ -30,6 +53,10 @@
path: "C:\\Users\\Admin"
state: absent
- name: Reboot VMs
win_reboot:
tags: reboot
- name: Create EIDF directory in system drive
win_file:
path: "C:\\eidf"
@@ -53,3 +80,26 @@
timezone: GMT Standard Time
tags: timezone
- name: Administrator Password
tags:
- password
- password_change
- always
block:
- name: Change Administrator password
win_user:
name: Administrator
password: "{{ vm_password }}"
- name: Set Password Status
vars:
ansible_connection: local
replace:
path: /deployments/{{ os_project }}-{{ win_project }}/PASSWORD
regexp: '^{{ password_status }}$'
replace: 'finished'
delegate_to: localhost
run_once: True
when: password_status == 'pending' or
password_status == 'change'