2020-12-09 19:41:44 +01:00
# Ansible configuration for the Netz39 infrastructure
2020-11-23 16:25:02 +01:00
2022-07-23 22:03:41 +02:00
This call lists all hosts defined in the inventory:
2022-07-23 10:57:02 +02:00
2022-07-23 22:03:41 +02:00
```bash
2022-11-11 20:28:59 +01:00
ansible all --list-hosts
2022-07-23 22:03:41 +02:00
```
2020-12-09 19:41:44 +01:00
## Setup
2022-11-04 22:53:56 +01:00
2020-11-24 19:39:46 +01:00
```bash
ansible-galaxy install -r requirements.yml
```
2022-11-04 22:53:56 +01:00
## Setup SSH Access to hosts
```bash
LOGUSER=< loguser >
SSH_KEY=< absolute / path / to / ssh / private / key >
ansible-playbook setup-ssh.yml --ask-vault-pass -e "setup_ssh_logname=$LOGUSER" -e "setup_ssh_key=$SSH_KEY"
```
2022-11-01 18:31:10 +01:00
## Edit vault encrypted vars files
2022-11-04 22:53:56 +01:00
2022-11-01 18:31:10 +01:00
```bash
ansible-vault edit group_vars/all/vault
```
2020-12-09 19:41:44 +01:00
## Call with
2022-11-04 22:53:56 +01:00
2020-11-23 16:25:02 +01:00
```bash
2022-11-11 20:28:59 +01:00
ansible-playbook --ask-vault-pass main.yml
2020-11-23 16:25:02 +01:00
```
2020-11-25 17:02:34 +01:00
You need to provide a user with sudo rights and the vault password.
2022-08-27 16:12:21 +02:00
2022-11-11 20:28:59 +01:00
## Verify Changes
```bash
ansible-lint main.yml
ansible-playbook --ask-vault-pass main.yml --check --diff
```
2022-08-27 16:12:21 +02:00
## HTTPS ingress configuration
HTTPS ingress is controlled by the server [holmium ](https://wiki.netz39.de/admin:servers:holmium ) and forwarded to the configured servers.
To set up a new HTTPS vhost, the following steps need to be taken:
1. Select a domain (for internal services we use sub-domains of `.n39.eu` ).
2. Create an external CNAME from this domain to `dyndns.n39.eu` .
2023-08-23 07:57:41 +02:00
3. Create an internal DNS entry in the [Descartes DNS config ](https://git.n39.eu/Netz39_Admin/config.descartes/src/branch/prepare/dns_dhcp.txt ). This is usually an alias on an existing server.
2022-08-27 16:12:21 +02:00
4. Add the entry to the [holmium playbook ](holmium.yml ).
2022-10-23 22:55:09 +02:00
5. Set up Dehydrated and vhost on the target host, e.g. using `setup_http_site_proxy` .
2022-08-27 16:12:21 +02:00
Do not forget to execute all playbooks with relevant changes.