ansible user

This commit is contained in:
Torma Kristóf 2022-04-16 23:37:46 +02:00
parent 0d29e1fde5
commit 5c5e8578b7
23 changed files with 74 additions and 34 deletions

6
ansiblefuckery.yaml Normal file
View File

@ -0,0 +1,6 @@
---
- name: "Add ansible stuff"
hosts: all
roles:
- ansibleuser
...

View File

@ -1,6 +1,6 @@
--- ---
- name: "Deploy database server base" - name: "Deploy database server base"
hosts: postgres, mariadb hosts: postgres
roles: roles:
- netplan - netplan
- common - common

View File

@ -1,9 +1,10 @@
--- ---
- name: "Deploy basic webhost with Docker" - name: "Deploy basic webhost with Docker"
hosts: keycloak, drone, swagger, guacamole, bitwarden, nexus, nextcloud hosts: docker-webhosts
roles: roles:
- netplan - netplan
- common - common
- docker - docker
- webserver - webserver
- internalsmtp - internalsmtp
...

View File

@ -1,4 +1,5 @@
--- ---
ansible_host: backup.stargate.internal
servicename: mckay servicename: mckay
backup: backup:
host: oniel.tormakristof.eu host: oniel.tormakristof.eu

3
host_vars/bitwarden.yaml Normal file
View File

@ -0,0 +1,3 @@
---
ansible_host: bitwarden.stargate.internal
...

View File

@ -0,0 +1,3 @@
---
ansible_host: drone-runner.stargate.internal
...

3
host_vars/drone.yaml Normal file
View File

@ -0,0 +1,3 @@
---
ansible_host: drone.stargate.internal
...

View File

@ -1,4 +1,5 @@
--- ---
ansible_host: git.stargate.internal
servicename: git servicename: git
backup: backup:
folder: "/home/service-user" folder: "/home/service-user"

3
host_vars/guacamole.yaml Normal file
View File

@ -0,0 +1,3 @@
---
ansible_host: guacamole.stargate.internal
...

3
host_vars/keycloak.yaml Normal file
View File

@ -0,0 +1,3 @@
---
ansible_host: keycloak.stargate.internal
...

View File

@ -1,14 +0,0 @@
---
servicename: mysql
firewall:
- port: "3306"
proto: tcp
interface: "eth0"
backup:
folder: "/var/lib/mysql/backup"
tarfolder: "backup"
host: backup.stargate.internal
internal: true
prearecommand: "time ( mysqldump --all-databases --single-transaction --quick --lock-tables=false > /var/lib/mysql/backup/mysqldump.sql"
basedir: /mnt/backupstore
...

View File

@ -1,4 +1,5 @@
--- ---
ansible_host: zelenka.stargate.internal
firewall: firewall:
- port: "ssh" - port: "ssh"
proto: tcp proto: tcp

3
host_vars/nextcloud.yaml Normal file
View File

@ -0,0 +1,3 @@
---
ansible_host: nextcloud.stargate.internal
...

View File

@ -1,4 +1,5 @@
--- ---
ansible_host: nexus.stargate.internal
webserver: webserver:
- domain: "nexus.kmlabz.com" - domain: "nexus.kmlabz.com"
port: 8080 port: 8080

View File

@ -1,4 +1,5 @@
--- ---
ansible_host: openvpn.stargate.internal
firewall: firewall:
- port: "1194" - port: "1194"
proto: udp proto: udp

View File

@ -1,4 +1,5 @@
--- ---
ansible_host: postgres.stargate.internal
servicename: postgres servicename: postgres
firewall: firewall:
- port: "5432" - port: "5432"

3
host_vars/smtp.yaml Normal file
View File

@ -0,0 +1,3 @@
---
ansible_host: smtp.stargate.internal
...

3
host_vars/sonar.yaml Normal file
View File

@ -0,0 +1,3 @@
---
ansible_host: sonar.stargate.internal
...

3
host_vars/swagger.yaml Normal file
View File

@ -0,0 +1,3 @@
---
ansible_host: swagger.stargate.internal
...

View File

@ -0,0 +1,3 @@
---
ansible_host: apache.stargate.internal
...

View File

@ -7,39 +7,29 @@ all:
woolsey: woolsey:
hosts: hosts:
neko: neko:
ansible_host: zelenka.stargate.internal
drone: drone:
ansible_host: drone.stargate.internal
keycloak: keycloak:
ansible_host: keycloak.stargate.internal
sonar: sonar:
ansible_host: sonar.stargate.internal
swagger: swagger:
ansible_host: swagger.stargate.internal
drone-runner: drone-runner:
ansible_host: drone-runner.stargate.internal
smtp: smtp:
ansible_host: smtp.stargate.internal
webgateway: webgateway:
ansible_host: apache.stargate.internal
openvpn: openvpn:
ansible_host: openvpn.stargate.internal
nexus: nexus:
ansible_host: nexus.stargate.internal
git: git:
ansible_host: git.stargate.internal
postgres: postgres:
ansible_host: postgres.stargate.internal
mckay: mckay:
hosts: hosts:
guacamole: guacamole:
ansible_host: guacamole.stargate.internal
bitwarden: bitwarden:
ansible_host: bitwarden.stargate.internal
nextcloud: nextcloud:
ansible_host: nextcloud.stargate.internal
mariadb:
ansible_host: mysql.stargate.internal
backup: backup:
ansible_host: backup.stargate.internal docker-webhosts:
keycloak:
drone:
swagger:
guacamole:
bitwarden:
nexus:
nextcloud :
... ...

View File

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDFkYMmPYQ8hs6D5tuTt+sEofoMd2GTXyS97mh8maXmets3eS8iMm2W4Pppaqj9lMIsYdDX0BZvbmuQa+iNKchj6HJPtvdx2Rhus1UGn74iy/NtgogWFHL9YEYILzc5lBqotV5o3z/wRMfSwqnVwYBZ7OI+LJenwf76bIUm6lVqyh2Qh9/wWOyGpUVitDpUVi/h2J3xZf8Z2r1vHFdMHJygrrKn3C4vsZobHJ48iq8QWj1vwfMavq6dgJtiS4/WUTvHuzjfHdyyO7akBM66Ul41UlGG5iqkIKTIzLECXPPWWe/vCIcumkeMxtoY0pxpsgKu1kgqhNs8Q+hgF/H+lIlXtzsZ5gKUwhS7sUNejNywaMjcOUVvnRVXh3FaH9t8HK7mGouaN7q+ghNbMKLlxueP5mpgzK+APaRcNjA/4JyXN750l22xM6YQkxqOeuK5FS/TVmn2H6otaxGrfGz1sfYyynvWSMqpNStuCjCYfEHBLqPKX5tpG8z/gGNa/51CQvM= tormakris@woolsey.tormakris.dev

View File

@ -0,0 +1,20 @@
---
- name: "Add ansible user"
ansible.builtin.user:
name: ansible
comment: Ansible
shell: /bin/bash
- name: "Add ansible user to sudo group"
ansible.builtin.user:
name: ansible
comment: Ansible
groups: sudo
append: yes
- name: Add public key to authorized keys
ansible.posix.authorized_key:
user: ansible
state: present
key: authorized_keys
...