Compare commits
No commits in common. "c2e33fd4cf4564b6e8568a8520f4d97d335b1053" and "7e9ca2023ca1671708107b82cbd901d84f3c6103" have entirely different histories.
c2e33fd4cf
...
7e9ca2023c
5 changed files with 7 additions and 18 deletions
10
README.md
10
README.md
|
@ -9,23 +9,23 @@ We like to use Ansible playbooks to keep track of how we set up our servers,
|
|||
here's how we've structured them! (We don't use very fancy Ansible features, we
|
||||
just use them as idempotent command-line scripts!)
|
||||
|
||||
- `setup-machine.yml`: Sets up the hostname config and user accounts for the
|
||||
system, with their SSH keys for login.
|
||||
- `setup-users.yml`: Sets up the user accounts for the system, with their SSH
|
||||
keys for login.
|
||||
- `setup-security.yml`: Sets up firewall rules and automatic system updates.
|
||||
(This is a standard playbook I use for all my servers!)
|
||||
- `setup-forgejo.yml`: Sets up the Forgejo server itself, as a `systemd`
|
||||
service running Forgejo's official Linux binary. This is mostly a 1:1 port
|
||||
of [Forgejo's "Installation from binary" guide][fj-install]!
|
||||
|
||||
You can run them individually, or all at once, with `ansible-playbook`:
|
||||
You can run them individually, or all at once, with `run.sh`:
|
||||
|
||||
ansible-playbook setup-all.yml
|
||||
run.sh setup-all.yml
|
||||
|
||||
If you're interested in setting up your own Forgejo service, this could be
|
||||
useful as a starting point, there's not much custom here! Just a couple things
|
||||
to note:
|
||||
|
||||
- `setup-machine.yml` contains my own username and my own SSH public keys—you'll
|
||||
- `setup-users.yml` contains my own username and my own SSH public keys—you'll
|
||||
want to replace those! (Public SSH keys aren't secret, don't worry, I'm fine!)
|
||||
- `files/app.ini` includes some custom config you'll need to replace, like our
|
||||
domain name. (We also opt to use Forgejo's built-in HTTPS support, via
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[defaults]
|
||||
inventory = inventory.cfg
|
||||
|
||||
[privilege_escalation]
|
||||
become_ask_pass = True
|
|
@ -51,9 +51,6 @@ After=network.target
|
|||
###
|
||||
|
||||
[Service]
|
||||
# NOTE: I found that Let's Encrypt certificates only renew when the service
|
||||
# starts, so let's make sure we're restarting every so often.
|
||||
RuntimeMaxSec=7d
|
||||
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
|
||||
# LimitNOFILE=524288:524288
|
||||
RestartSec=2s
|
||||
|
|
1
run.sh
Executable file
1
run.sh
Executable file
|
@ -0,0 +1 @@
|
|||
ansible-playbook -i inventory.cfg --ask-become-pass $1
|
|
@ -1,13 +1,9 @@
|
|||
---
|
||||
- name: Set up host config & user accounts
|
||||
- name: Set up user accounts
|
||||
hosts: webserver
|
||||
become: yes
|
||||
become_user: root
|
||||
tasks:
|
||||
- name: Set hostname to code.openneo.net
|
||||
hostname:
|
||||
name: code.openneo.net
|
||||
|
||||
- name: Create user account for matchu
|
||||
user:
|
||||
name: matchu
|
Loading…
Reference in a new issue