Initial commit

This commit is contained in:
Jesper Hess 2018-05-08 21:09:24 +02:00
commit 76e9cba31a
Signed by untrusted user: graffen
GPG key ID: 351A89E40D763F0F
7 changed files with 59 additions and 0 deletions

10
datacoop_hosts Normal file
View file

@ -0,0 +1,10 @@
######################################
### All hosts
10.0.0.140
10.0.0.145
######################################
### Application servers
[kubernetes_servers]
10.0.0.140
10.0.0.145

0
deploy.sh Normal file
View file

9
group_vars/all.yml Normal file
View file

@ -0,0 +1,9 @@
---
users:
graffen:
comment: Jesper Hess Nielsen
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

14
roles/playbook.yml Normal file
View file

@ -0,0 +1,14 @@
---
- name: "Include host secrets where applicable"
hosts: "all"
tasks:
- include_vars: "../../host_vars/{{ ansible_nodename }}-secrets.yml"
ignore_errors: yes
tags:
- "always"
- name: "Run base config on all ubuntu hosts"
hosts: "all"
become: yes
roles:
- "ubuntu_base"

View file

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

View file

@ -0,0 +1,5 @@
---
- name: update and upgrade system via apt
apt:
update_cache: yes
upgrade: full

View file

@ -0,0 +1,18 @@
---
- name: "Add users (set password to 'changeme')"
user:
name: "{{ item.key }}"
comment: "{{ item.value.comment }}"
password: "$1$gbSjoDr0$NgvOjcEBSzdK.WqjWGEfw0"
update_password: "on_create"
groups:
- {{ item.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