feat(role): Change local account password

This commit is contained in:
2022-06-12 01:54:03 +02:00
parent 2e551bdd7c
commit 511862e8d2
10 changed files with 79 additions and 10 deletions

View File

@@ -1,6 +1 @@
root_home_dir_abs: '/root'
ansible_hashi_vault_auth_method: 'token'
ansible_hashi_vault_token: 'hvs.xxxxxxxxxx'
ansible_hashi_vault_engine_mount_point: 'kv'
ansible_hashi_vault_token_validate: 'false'
ansible_hashi_vault_url: 'http://localhost:8200/'

View File

@@ -3,12 +3,25 @@
loop_control:
loop_var: 'server'
with_community.hashi_vault.vault_kv2_get:
- '{{ inventory_hostname | split(".") | reverse | join("/") }}/os/root/creds'
- '{{ inventory_hostname | split(".") | reverse | join("/") }}/os/{{ reset_password_for_account }}/creds'
ansible.builtin.set_fact:
vault_data: '{{ server.secret }}'
- name: 'If a secret is missing fail progress'
tags:
- 'first_run'
- 'never'
include_role:
name: '10-include-40-check-if-vault-var'
vars:
- inc_vault_data: '{{ vault_data }}'
- fail_check:
- 'initial_password'
- name: 'If first run: set SSH password'
tags:
- 'first_run'