1
0
Fork
You've already forked configuration-as-code
0
The Codeberg infrastructure using Ansible. Work in progress, not all ancient parts were re-configured using Ansible yet. Documentation is also a big Todo :)
  • Shell 67.3%
  • Jinja 26.6%
  • Roff 6.1%
2022年09月13日 22:32:57 +02:00
.nosecrets Initial commit 2022年09月07日 14:07:02 +02:00
generic-roles Initial commit 2022年09月07日 14:07:02 +02:00
host-os-installation Initial commit 2022年09月07日 14:07:02 +02:00
inventories Initial commit 2022年09月07日 14:07:02 +02:00
realms Initial commit 2022年09月07日 14:07:02 +02:00
secrets @87883860d7 Initial commit 2022年09月07日 14:07:02 +02:00
.ansible-lint Initial commit 2022年09月07日 14:07:02 +02:00
.ecrc Initial commit 2022年09月07日 14:07:02 +02:00
.editorconfig Initial commit 2022年09月07日 14:07:02 +02:00
.gitignore Initial commit 2022年09月07日 14:07:02 +02:00
.gitmodules Initial commit 2022年09月07日 14:07:02 +02:00
.pre-commit-config.yaml Initial commit 2022年09月07日 14:07:02 +02:00
.woodpecker.yml Initial commit 2022年09月07日 14:07:02 +02:00
.yamllint.yaml Initial commit 2022年09月07日 14:07:02 +02:00
ansible.realm.cfg Initial commit 2022年09月07日 14:07:02 +02:00
LICENSE Initial commit 2022年09月07日 14:07:02 +02:00
local-testing Initial commit 2022年09月07日 14:07:02 +02:00
README.md some words to the state of this repo 2022年09月13日 22:32:57 +02:00
requirements.yml Initial commit 2022年09月07日 14:07:02 +02:00
ROLES-AND-VARIABLES.md Initial commit 2022年09月07日 14:07:02 +02:00
users.yml Initial commit 2022年09月07日 14:07:02 +02:00

Codeberg - Configuration

Codeberg's Configuration (as Code, using Ansible). This is an ongoing effort: Starting with our own hardware server (2021), all configs should be public and documented.

However, some previous systems are still not migrated and thus inaccessible (WIP). Since effectively all systems will be migrated from our rented VPS sooner or later, this situation will improve over time.

Exceptions to this:

  • quick n dirty testing environments don't need to be configured publicly
  • not using Ansible for configuring the inside of containers is possible, as long as the configuration is otherwise accessible and the setup documented

Some further notes on the state of this repo:

Sadly, this project didn't go too well since the beginning. This framework was rather complex to get right, and although it's working for us now, some parts like "getting started easily" were lost in the trouble again. We're looking forward to your contribution to this project, be it patches or inspiration, also regarding workflow and management. Thank you for understanding!

Please have a look at our new Wiki for more information!

Relevant Documentation

Local Testing VM

⚠️ Warning: the local testing VM is currently not really tested and unsupported, and will be .

A local testing VM is provided - the required rependencies are virtinst libvirt-clients libvirt-daemon-driver-qemu.

To set up the VM, run ./local-testing vm create (no need to sudo, everything's running in user mode). After the installation is complete and the login prompt is shown, press Ctrl + ] to detach. You can then connect to the VM via SSH on 127.0.0.1:3222, using ./local-testing ssh - the default username/password combination is codeberg-setup / codeberg.

Important note: due to QEMU's usermode networking limitations, it's not possible to reach the VM under an IP address - to access the VM's internal network, you can use the SOCKS proxy exposed by ./local-testing ssh on 127.0.0.1:3280.

Important note: adding the SSH key to the known_hosts file is required for Ansible to run when using password authentication (like with the VM). You can set this up by running ./local-testing ssh -k.

Server prerequisites

  • Working Debian 11
  • SSH with working public key authentication, using a hardware security key
  • sudo for the setup user
  • SSH daemon running on port 19198

Ansible Dependencies

Ansible completely runs on your local computer, no setup on the server is required. The following Ansible prerequisites are required on your machine:

Debian 11 and Ubuntu 21.04 already include Ansible 2.10:

apt install sshpass ansible

For older distributions you need to use pip to install Ansible:

apt install sshpass python3-pip
pip3 install ansible # WE NEED AT LEAST VERSION 2.10!!!

Regardless of your distribution we need some extra packages from ansible-galaxy:

ansible-galaxy install -r requirements.yml

Further instructions on how to actually deploy a playbook can be found in the wiki.

Role Documentation

All roles & variables are documented in the ROLES-AND-VARIABLES.md file.