Add initial user configuration

This commit is contained in:
Jesper Hess 2018-05-08 21:31:12 +02:00
parent 76e9cba31a
commit 24d0ffd087
Signed by untrusted user: graffen
GPG key ID: 351A89E40D763F0F
5 changed files with 8 additions and 9 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
playbook.retry

2
ansible.cfg Normal file
View file

@ -0,0 +1,2 @@
[defaults]
remote_user = root

View file

@ -5,5 +5,4 @@ users:
key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCbxFVukt5TIzoB0HX2q8b8lHJmXD1juzsWOu5XkexVDlCsvupa1cZ/OVkrIEAbDKk6RmJQj0TJ2O5+v9hbf0TDi0Pi+V8ADZIgO+OW5a4EeXsU72a4CN0nEocQhUPfQuC4IU+F7icoG2/I9jXg7U6p1LhBr8vlC3cNHnrH3yqrakrUR51/iRVIwo4FKvQg7jutaKTyOjlYa1uTdaczvAzNHWEdytCQgFnkzpR9fHvzkA79qHUD9n32rIpJicRJsHY3NnyDGfBcDv+4sLq15sM9jN83duGnSuMMtZgfSriwMUd/UwVReU2ZKxjMLe3WHB7+ZE/p39OJk/gjVfWJVh/za1/teTAwaLLmxh/HFt+AVYWkCj22fUxscl0dh2zy6Ki1Ua3ApChn6v6Gvng6khobFlxawSJZ49+0KoAl1qqFMR1o9EGWvqgDPuITAqJFN+ik0jxcxfmKrG3mbOYM1ikhJd0ER8wbS8e6NowHUBV7PUyDqxP5VM2gum58IYrDqaP2RYYi9vWWnXJJA8J1t+Wp3bF7fdktyVgkd7HQk02uVkxdMQQ802GCrQQuvJhWTCzrgkgrjPY8p0KcbCNt6jYQOUKV0T2vp6PbTJ5XWKb5u7gVXW1xiP9dYzgAr0DroiTK4xIuF80mv1Rfst0ceHAIQVcQ3GcGbh000QUYzbHT2Q== openpgp:0x265EE03C (Graffen)
password: $6$6bgPWZ76LvB$DZ3ipFsFtL2b1nSC0AQ63k8ibJidyIE9iIsWWzY0fux0ynz9L/o7b2sR2XYSaDuG.jewFV36IGStTF3NCZRC30
groups:
- docker
- sudo

View file

@ -1,3 +1,3 @@
---
include_tasks: upgrade.yml
include_tasks: users.yml
- import_tasks: upgrade.yml
- import_tasks: users.yml

View file

@ -1,18 +1,15 @@
---
- name: "Add users (set password to 'changeme')"
- name: "Add users"
user:
name: "{{ item.key }}"
comment: "{{ item.value.comment }}"
password: "$1$gbSjoDr0$NgvOjcEBSzdK.WqjWGEfw0"
password: "{{ item.value.password }}"
update_password: "on_create"
groups:
- {{ item.groups }}
groups: "{{ item.value.groups }}"
with_dict: "{{ users | default({}) }}"
tags: usermanagement
- name: "Add ssh authorized_keys"
authorized_key:
user: "{{ item.key }}"
key: "{{ item.value.key }}"
with_dict: "{{ users | default({}) }}"
tags: usermanagement