Automation to create/configure the infrastructure for all services related to forgejo.dev.
- Install all dependencies:
- Create a Hetzner Cloud project
- Create an access token
- Add the SSH fingerprint to the project
- Copy
secrets.tfvars.exampletosecrets.tfvars- Replace the dummy values with the real ones
- Copy
vars/smtp.yml.exampletovars/smtp.yml- Replace the dummy values with the real ones
- Copy
vars/minio.yml.exampletovars/minio.yml- Replace the dummy values with the real ones
- Copy
vars/backup.yml.exampletovars/backup.yml- Replace the dummy values with the real ones
- Copy
forgejo-actions-runner.yml.exampletoforgejo-actions-runner.yml- Replace the dummy values with the real ones
Terraform is used to create the infrastructure (VMs) and run a basic provisioning script to install all dependencies for Ansible.
- To create the infrastructure, run:
$ terraform init$ terraform plan -var-file="secrets.tfvars"$ terraform apply -var-file="secrets.tfvars"
- To destroy the infrastructure, run:
$ terraform destroy -var-file="secrets.tfvars"
- To create the infrastructure, run:
$ terraform plan -var-file="secrets.tfvars" -target=hcloud_server.staging$ terraform apply -var-file="secrets.tfvars" -target=hcloud_server.staging
- To destroy the infrastructure, run:
$ terraform destroy -var-file="secrets.tfvars" -target=hcloud_server.staging
Ansible is used to configure the VMs and create/configure all necessary services.
- To create/configure/update all services on the VMs, simply run:
$ export ANSIBLE_CONFIG=./ansible.cfg$ ansible-galaxy install -r requirements.yml$ ansible-playbook playbook.yml
- To create/configure/update all services only on the staging VM, run:
$ export ANSIBLE_CONFIG=./ansible.cfg$ ansible-galaxy install -r requirements.yml$ ansible-playbook playbook.yaml --limit staging
- Installation:
$ pip3 install ansible-lint - Usage:
$ ansible-lint --offline -p ./*.yml
Unfortunately, there are currently some manual steps required to complete the initial configuration.
- Go to the webpage and finish the Forgejo installation including the creation of a
rootuser.- Login as
root+ change the profile picture.
- Login as
- Create the organisation
staging.forgejo.dev/forgejo.dev.- Set the correct profile picture.
- Create the
orgrepository in the organisation.- Set the correct profile picture.
- Create user(s) and invite them to the organization.
- Create the Forgejo Actions runner configuration.
- Forgejo documentation: https://forgejo.org/docs/latest/admin/actions/runner-installation/
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for more details.