Passwort (#77)

* Set Password mg - untested

* Playbook set Password mg

* Keepass - Kennwort Update: User linux: mg + private Key ansible-user

* Passwort Var Linux user mg umbenannt

* Bootstrap: KennwörterVars angepasst + setze Password mg IMMER
This commit is contained in:
Quotengrote 2020-12-02 10:49:08 +01:00 committed by GitHub
parent 84c1c7bd0e
commit 4818ef25ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 5 deletions

View file

@ -32,7 +32,7 @@
### ryandaniels.create_users
users:
- username: mg
password: "{{ lookup('keepass', 'linux_mg_user_password', 'password') }}"
password: "{{ lookup('keepass', 'linux_mg_user_password_hash', 'password') }}"
update_password: on_create
ssh_key: "{{ lookup('keepass', 'ssh_pubkey_mg', 'password') }}"
use_sudo: yes

View file

@ -20,7 +20,7 @@
### ryandaniels.create_users
users:
- username: mg
password: "{{ lookup('keepass', 'linux_mg_user_password', 'password') }}"
password: "{{ lookup('keepass', 'linux_mg_user_password_hash', 'password') }}"
update_password: on_create
ssh_key: "{{ lookup('keepass', 'ssh_pubkey_mg', 'password') }}"
use_sudo: yes

Binary file not shown.

View file

@ -5,9 +5,25 @@
max_fail_percentage: 20%
roles:
- { role: robertdebock.bootstrap, tags: "bootstrap" }
- { role: ryandaniels.create_users, tags: "user", become: yes }
- { role: nickjj.ansible-user, tag: "ansible", become: yes }
- { role: robertdebock.bootstrap,
tags: "bootstrap"
}
- { role: ryandaniels.create_users,
tags: "user",
become: yes
}
- { role: nickjj.ansible-user,
tag: "ansible",
become: yes,
ansible_password: "{{ lookup('keepass', 'linux_mg_user_password_cleartext', 'password') }}",
ansible_become_password: "{{ lookup('keepass', 'linux_mg_user_password_cleartext', 'password') }}"
}
tasks:
- name: Change user password
user:
name: mg
update_password: always
password: "{{ lookup('keepass', 'linux_mg_user_password_hash', 'password') }}"
vars:
### nickjj.ansible-users

View file

@ -0,0 +1,14 @@
---
- hosts: all
become: yes
tasks:
- name: Change user password
user:
name: mg
update_password: always
password: "{{ lookup('keepass', 'linux_mg_user_password_hash', 'password') }}" #hier muss der hash rein
# Hash erstellen
# python -c 'import crypt,getpass; print(getpass.getpass("Name: ")+":"+crypt.crypt(getpass.getpass(),crypt.mksalt(crypt.METHOD_SHA512)))'
# oder
# mkpasswd --method=SHA-512 <passwort>