mg
0f22b2af23
Aufgabe: become: true Aufgabe wieder verschoben Bugfix: bootstrap Syntax Syntax Syntax become zu Rolle gepackt Passwort mg ändern in Rolle Co-authored-by: Michael Grote <38253905+quotengrote@users.noreply.github.com> Reviewed-on: mg/ansible#9
33 lines
1.2 KiB
YAML
33 lines
1.2 KiB
YAML
---
|
|
- hosts: all
|
|
gather_facts: false
|
|
max_fail_percentage: 20%
|
|
roles:
|
|
- { role: robertdebock.bootstrap, tags: "bootstrap", become: yes}
|
|
- { role: ryandaniels.create_users, tags: "user", become: yes}
|
|
- { role: nickjj.ansible-user, tag: "ansible", become: yes }
|
|
|
|
vars:
|
|
### nickjj.ansible-users
|
|
user_name: "ansible-user"
|
|
user_local_ssh_key_path: "/home/mg/ansible/id_rsa_ansible_user_pub"
|
|
user_enable_passwordless_sudo: True
|
|
### reobertdebock.bootstrap
|
|
bootstrap_user: mg
|
|
bootstrap_wait_for_host: no
|
|
bootstrap_timeout: 1
|
|
### ansible
|
|
ansible_user: "mg"
|
|
ansible_password: "hallowelt"
|
|
ansible_become_password: "hallowelt"
|
|
ansible_ssh_common_args: "'-o StrictHostKeyChecking=no'"
|
|
|
|
tasks:
|
|
- name: Change user password
|
|
become: true
|
|
user:
|
|
name: mg
|
|
update_password: always
|
|
password: "{{ lookup('keepass', 'linux_mg_user_password_hash', 'password') }}"
|
|
|
|
# Nach dem ersten durchlaufen ist keine Anmeldung mehr per Passwort & ssh möglich. Somit scheitert auch der Versuch das Playbook ein zweites mal durchlaufen zu lassen.
|