homeserver/playbooks/base/1_bootstrap.yml

44 lines
1.4 KiB
YAML
Raw Normal View History

2020-08-18 11:57:53 +02:00
---
- hosts: all
2020-08-18 11:57:53 +02:00
become: yes
gather_facts: false
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,
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') }}"
2020-08-18 11:57:53 +02:00
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
2020-10-06 14:19:52 +02:00
bootstrap_timeout: 1
2020-09-02 13:18:27 +02:00
### ansible
ansible_user: "mg"
ansible_password: "hallowelt"
ansible_become_password: "hallowelt"
2020-08-18 11:57:53 +02:00
ansible_ssh_common_args: "'-o StrictHostKeyChecking=no'"
# 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.