Changeset - c148b8df5743
[Not reviewed]
0 2 0
x - 17 months ago 2023-12-14 19:06:45
xbr@c3l.lu
docs: initial sever setup
2 files changed with 34 insertions and 0 deletions:
0 comments (0 inline, 0 general)
README.md
Show inline comments
 
# fflux Ansible Configuration
 

	
 
This repo contains Ansible configs for the Freifunk Lëtzebuerg infra.
 

	
 
## Files
 

	
 
- `hosts`: contains all of the machines.
 
  - Careful: a wrongly defined machine can lead to major problems.
 
- `authorized_keys`: `fflux` user pubkey
 

	
 
## Directories
 

	
 
- `files`: templates for various playbooks
 
- `initial_server_setup`: initial server setup
 
- `gateway`: Set up a fflux gateway
 
- `api`: api.freifunk.lu
 
- `firmware`: firmware.freifunk.lu
 

	
 
## Guide
 

	
 
### Initial Server Setup
 

	
 
First, add the machine to `hosts` at the top of the file:
 

	
 
```yml
 
machine-name-here ansible_host=10.20.30.40
 
```
 

	
 
Note that `machine-name-here` will be the machine's hostname.
 

	
 
Then, put the machine under the `[initial]` group:
 

	
 
```yml
 
[initial]
 
machine-name-here ansible_user=root
 
```
 

	
 
Finally, change the default private SSH key under `[all:vars]` if necessary:
 

	
 
```yml
 
ansible_ssh_private_key_file=/home/myuser/.ssh/id_ed25519
 
```
 

	
 
You can now run the playbook:
 

	
 
```bash
 
fflux@fflux:~/repos/Ansible-Configuration$ ansible-playbook -i hosts initial_server_setup/initial_setup.yml
 
```
 

	
 
Note that the placement of the repositories might impact the playbook's behaviour, particularly for more advanced setups, incl. web server.
hosts
Show inline comments
 
# server list is here
 
# ansible_host = IP address of remote machine
 
# network_index = last number of MAC address (10-19)
 
# dhcp range = 10.24.XXX.1 - 10.24.YYY.1 // X = start_range, Y = end_ranges
 
fflux-test ansible_host=89.58.3.252 network_index=19 dhcp_start_range=188 dhcp_end_range=191 gateway_status="True" hardware_model="VPS 200 G8"
 

	
 
# machines which are used for tests
 
[test]
 
fflux-test
 

	
 
# variable for the test group come here
 
[test:vars]
 
#mac1=ca:fe:ca:fe:00:19
 
#ipv4=10.24.128.19
 
#ipv6=fd4e:f2d7:88d2:fffe::19
 
#vars_files: /etc/ansible/host_vars/firmware.freifunk.lu
 

	
 
# all machine variables come here
 
[all:vars]
 
ansible_python_interpreter=/usr/bin/python3
 
# Change this to the ssh key you want to use to connect to a server
 
ansible_ssh_private_key_file=/home/fflux/.ssh/fflux_fflux
 
server_config_dir=~/repos/Infrastructure-Intern/server_config
 
server_scripts_dir=~/repos/Infrastructure-Intern/scripts
 
ansible_repo_dir=~/repos/Ansible-Configuration
 

	
 

	
 
# new machine come here
 
[initial]
 
fflux-test ansible_user=root
 

	
 
[initial-gateway]
 
fflux-test
 

	
 
# machines which run stats + map.freifunk.lu
 
[stats-map-web]
 

	
 
# machines which run firmware.freifunk.lu
 
[firmware-web]
 

	
 
# machines which run api + freifunk.lu
 
[website-web]
 

	
 
# machine which are gateways for freifunk.lu
 
[fflux]
0 comments (0 inline, 0 general)