You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
friedrich goerz 5d1b951f39 DEV-466: added missing but needed package 4 years ago
ansible-builder feat: consolidation for harbor 4 years ago
docker/dregsy feat: consolidation for harbor 4 years ago
group_vars bugfix: pgadmin username/password 4 years ago
host_vars DEV-441: resizing postgres-VMs 4 years ago
inventory_plugins feat: dynamic inventory skips now all servers with label manual 4 years ago
kubespray@92f25bf267 DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
library bugfix: connect-wordpress orchestration 4 years ago
roles DEV-466: added missing but needed package 4 years ago
scripts DEV-317: switched build image to smardigo-ci-ansible 4 years ago
smardigo DEV-452 reverted backups from hourly to daily 4 years ago
tasks feat: dynamic inventory skips now all servers with label manual 4 years ago
templates bugfix: logstash mutate - remove_field 4 years ago
users DEV-456: Added SSH key for michael.haehnel 4 years ago
.gitignore DEV-327: added several stuff for new prodnso-stage + bugfixing and improving other stuff 4 years ago
.gitlab-ci.yml bugfix: added 2h timeout to patchday 4 years ago
.gitmodules DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
README.md DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
ansible-lint.cfg Feature/dev 316 3rd 4 years ago
ansible.cfg DEV-414: follow-up tasks prod@hetzner-incident 4 years ago
create-database-backup.yml chore: consolidation 4 years ago
create-database.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
create-kibana-objects.yml DEV-452: added potential fixes for our hetzner create_server - is locked/message problem 4 years ago
create-realm.yml bugfix: create-realm was broken 4 years ago
create-remote-database-backup.yml DEV-389: added gpg-decryption for backup 4 years ago
create-server.yml DEV-373: try to automate restore from database backup 4 years ago
create-service.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
elastic-certs.sh DEV-327: added several stuff for new prodnso-stage + bugfixing and improving other stuff 4 years ago
evil-remove-server.yml chore: cleanup 4 years ago
export-database.yml DEV-424 export for wordpress database (maria) 4 years ago
external_monitoring.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
galaxy-requirements.yml DEv-452: added recursive _set_server_state.yml to work around hetzners... 4 years ago
gitlab-mirrors.yml spike: automated mirrors for gitlab (w.i.p.) 4 years ago
hcloud_firewall.yml MOB-28: added custom whitelisted ips for services 4 years ago
import-database.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
info.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
kubernetes.yml review: added changes discussed with fgrz 4 years ago
patchday.yml DEV-438: debuggen SFTP-error - thesis: ssh hardening will rise the WARN 4 years ago
pip-requirements Feature/dev 316 3rd 4 years ago
poetry.lock Updated cryptography (3.4.7 -> 3.4.8), ansible-core (2.11.3 -> 2.11.4), ansible (4.3.0 -> 4.4.0), hcloud (1.13.0 -> 1.16.0) 4 years ago
provisioning.yml bugfix: kubernetes deployment without root user and global become 4 years ago
pyproject.toml feature/postgresql-cluster 4 years ago
remove-database.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
remove-realm.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
remove-server.yml chore: consolidation 4 years ago
remove-service.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
restore-database-backup.yml chore: consolidation 4 years ago
restore-remote-database-backup.yml DEv-452: added recursive _set_server_state.yml to work around hetzners... 4 years ago
setup.yml bugfix: updated ssh key configuration 4 years ago
smardigo.yml DEV-389: added gpg-decryption for backup 4 years ago
stage-dev chore: removed dev-fgrz-01 4 years ago
stage-dev-netgo-hcloud.yml DEV-273: debugging 4 years ago
stage-digitalocean DEV-253: digitalocean stuff - add droplet but not idempotentgit branch git branch plz check 4 years ago
stage-ext DEV-277 feat: added stage for external usage 4 years ago
stage-prodnso DEV-389: added gpg-decryption for backup 4 years ago
stage-prodnso-netgo-hcloud.yml DEV-358: feat: removed hard coded loadbalancer ips 4 years ago
stage-qa DEV-389: added gpg-decryption for backup 4 years ago
stage-qa-netgo-hcloud.yml DEV-358: feat: removed hard coded loadbalancer ips 4 years ago
update-monitoring.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
update-service-state.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago
update-ssh-config-file.yml chore: consolidation 4 years ago
upload-database-dumb.yml DEV-319: feat: split dev/qa into own hetzner projects 4 years ago

README.md

Prepare ansible Installation

Install needed python pip packages

pip3 install -r pip-requirements

Install needed ansible collections / roles

ansible-galaxy install -r galaxy-requirements.yml

Setup

Create/Start servers for stage-dev

ansible-playbook -i stage-dev provisioning.yml --vault-password-file ~/vault-pass
ansible-playbook -i stage-dev start.yml --vault-password-file ~/vault-pass
ansible-playbook -i stage-dev stop.yml --vault-password-file ~/vault-pass

with Poetry prefix with poetry run

Provisioning

ansible-playbook -i stage-dev setup.yml --vault-password-file ~/vault-pass -u root
ansible-playbook dynamic-provisioning.yml  --vault-password-file ~/vault-pass -e "stage=dev name=test node=01 service=connect"

with Poetry prefix with poetry run

Setup Smardigo Service

Setup/Configure a Server, Database, Realm (keycloak) and Smardigo
ansible-playbook create-server.yml -e "stage='dev' tenant_id='sken' cluster_name='test01' cluster_size='1' cluster_service='connect' stage='dev'"
ansible-playbook create-database.yml -e "stage='dev' tenant_id='sken' cluster_name='test01' cluster_size='1' cluster_service='connect' stage='dev'"
ansible-playbook create-realm.yml -e "stage='dev' tenant_id='sken' cluster_name='test01' cluster_size='1' cluster_service='connect' stage='dev' current_realm_name='sken' current_realm_display_name='S-K-E-N'"
ansible-playbook create-service.yml -e "stage='dev' tenant_id='sken' cluster_name='test01' cluster_size='1' cluster_service='connect' stage='dev' current_realm_name='sken' current_realm_display_name='S-K-E-N'"

with Poetry prefix with poetry run

Remove Smardigo Service

Remove a Server, Database, Realm (keycloak) and Smardigo
ansible-playbook remove-server.yml -e "stage='dev' tenant_id='sken' cluster_name='test01' cluster_size='1' cluster_service='connect' stage='dev'"

with Poetry prefix with poetry run

ansible-builder

AWX is used in smardigo setup do execute several playbooks due to user interaction within smardigo product. To finish ansible runs successfully we have to make sure every ansible dependency(ansible collection/role or pip package) is installed. therefore ansible-builder gave us the opportunity to configure the needed environment to exec plays successfully.

before every git-merge depending on changes concerning new ansible collections/roles and/or new pip-packages, please run the following:

cd ansible-builder/
ansible-builder build --tag dev-harbor-01.smardigo.digital/awx/awx-custom-ee --container-runtime docker

hopefully it will result in e.g.:

cd ansible-builder/
ATTENTION: to get more information plz set --verbosity 3	
ansible-builder build --tag awx-custom-ee:latest --container-runtime docker
Running command:
  docker build -f context/Dockerfile -t awx-custom-ee:latest context

Complete! The build context can be found at: /home/friedrich/sandbox/netgo_stuff/hetzner-ansible/ansible-builder/context

real	2m56,131s
user	0m0,208s
sys	0m0,102s`

you can start the docker container locally with e.g. : docker run -it --rm --mount type=bind,source="$(pwd)"/,target=/gitrepo/ awx-custom-ee:latest /bin/bash

after it, you are able to exec some ansbible-runs like: (please solve dependencies before starting to docker container) cd /gitrepo ansible-playbook -i stage-digitalocean external_monitoring.yml --ask-vault-password -u root --private-key sshkey_pw_less

export HETZNER_LABEL_SELECTOR='stage=dev'
ansible-playbook -i stage-netgo-hcloud.yml -l redis smardigo.yml --ask-vault-password  -u root --private-key sshkey_pw_less

if everything works fine, plz push the created docker container with:

docker login dev-harbor-01.smardigo.digital
docker tag XXXXXXXX dev-harbor-01.smardigo.digital/awx/awx-custom-ee:latest
docker push dev-harbor-01.smardigo.digital/awx/awx-custom-ee

TODO

IPFire 149.233.6.129 - eShelter 212.121.131.106 - Siemensdamm

Prometheus (Grafana) docker exec -i dev-prometheus-01-grafana sh -c 'grafana-cli plugins install grafana-piechart-panel' docker restart dev-prometheus-01-grafana