Skip to content

Commit

Permalink
docs: Add Ansible installation page (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
konradasb authored Sep 11, 2024
1 parent 643a26e commit 87db59a
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 6 deletions.
1 change: 0 additions & 1 deletion docs/getting-started/ansible-installation.md

This file was deleted.

4 changes: 1 addition & 3 deletions docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,4 @@ There are a few requirements to run Fireactions:

## Quickstart

There are two main ways of installing Fireactions: [manual installation](./manual-installation.md) and [Ansible installation](./ansible-installation.md).

We recommend using the Docker installation method, as it is the easiest and most convenient way to get started.
To install Fireactions, see the [installation guide](installation.md).
117 changes: 117 additions & 0 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Installation

Ansible is an open-source automation tool that allows you to automate the deployment and configuration of software on multiple servers. It is a powerful tool that can help you manage your infrastructure more efficiently.

It is the recommended way to install Fireactions. This guide will show you how to install Fireactions using Ansible.

## Pre-requisites

Before you begin, make sure you have the following requirements:

- Ansible set up on your local machine

## Step 1: Create an inventory file

```yaml
# hosts.ini
[all]
fireactions-server-1 ansible_host=<IP_ADDRESS> ansible_user=<SSH_USER>
```

## Step 2: Create an Ansible playbook

```yaml
# site.yaml
---
- name: Install Fireactions
hosts:
- all
become: yes
- role: hostinger.fireactions.fireactions
vars:
fireactions_version: 0.2.3
fireactions_config:
bind_address: 0.0.0.0:8080
metrics:
enabled: true
address: 127.0.0.1:8081
github:
webhook_secret: "<WEBHOOK_SECRET>"
app_id: <APP_ID>
app_private_key: |
<APP_PRIVATE_KEY>
debug: true
pools:
- name: example
max_runners: 10
min_runners: 1
runner:
name: example
image: <IMAGE>:<IMAGE_TAG>
image_pull_policy: IfNotPresent
group_id: 1
organization: hostinger
labels:
- self-hosted
- fireactions
firecracker:
binary_path: firecracker
kernel_image_path: /usr/local/share/firecracker/vmlinux.bin
kernel_args: "console=ttyS0 noapic reboot=k panic=1 pci=off nomodules rw"
machine_config:
mem_size_mib: 1024
vcpu_count: 1
metadata:
example: example
```
The `fireactions_config` variable contains the configuration for Fireactions. You can customize the configuration to suit your needs. For more information on the available configuration options, see the [configuration](../user-guide/configuration.md)

## Step 3: Create a requirements file

```yaml
# requirements.yaml
---
collections:
- name: hostinger.fireactions
version: 0.1.1
- name: hostinger.common
version: 0.8.0
```

## Step 4: Install the required Ansible collections

```bash
ansible-galaxy collection install -r requirements.yaml
```

## Step 5: Run the Ansible playbook

```bash
ansible-playbook -i hosts.ini --diff site.yaml
```

The Ansible playbook will do the following:

- Install [Containerd](https://github.com/containerd/containerd)
- Install [CNI plugins](https://github.com/containernetworking/plugins) (bridge, host-local, firewall, [tc-redirect-tap](https://github.com/awslabs/tc-redirect-tap))
- Configure CNI networking
- Install [Firecracker](https://github.com/firecracker-microvm/firecracker)
- Setup required sysctl settings
- Install Fireactions

After the playbook has finished, check the status of the Fireactions service:

```bash
$ systemctl status fireactions
● fireactions.service - Fireactions
Loaded: loaded (/etc/systemd/system/fireactions.service; enabled; preset: enabled)
Active: active (running) since Sun 2024-09-08 18:59:08 UTC; 2 days ago
Docs: https://github.com/hostinger/fireactions
Process: 3564 ExecStartPre=/usr/bin/which firecracker (code=exited, status=0/SUCCESS)
Process: 3566 ExecStartPre=/usr/bin/which containerd (code=exited, status=0/SUCCESS)
Main PID: 3571 (fireactions)
Tasks: 480 (limit: 618568)
Memory: 87.8G
CPU: 5d 6h 21min 36.143s
```
3 changes: 1 addition & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ nav:
- Overview: "index.md"
- Getting Started:
- Intro: "getting-started/index.md"
- Installing with Ansible: "getting-started/ansible-installation.md"
- Installing manually: "getting-started/manual-installation.md"
- Installation: "getting-started/installation.md"
- Upgrading: "getting-started/upgrading.md"
- User Guide:
- Configuration: "user-guide/configuration.md"
Expand Down

0 comments on commit 87db59a

Please sign in to comment.