website/content/docs/self-hosting/ansible.md

50 lines
1.2 KiB
Markdown

---
title: "Using Ansible"
description: "Deploy mCaptcha software using Ansible playbooks"
lead: "Deploy mCaptcha software using Ansible playbooks"
date: 2023-12-03 15:14
lastmod: 2023-12-09 03:09
draft: false
images: []
menu:
docs:
parent: "Self-Hosting"
weight: 533
toc: true
---
Ansible playbooks to install mCaptcha are available [here](https://git.batsense.net/mCaptcha/iac).
## Instructions
### Installation
1. Clone the repository:
```bash
git clone https://git.batsense.net/mCaptcha/iac && cd iac
```
2. Create inventory file. You should have SSH access to the remote
machine, and the user must have `sudo` privileges. Example inventory
file:
```ini
[mcaptcha_hosts]
"mcaptcha_hosts"
<node name> ansible_host=<node IP> ansible_user=<remote username>
```
It is important that the group name be `mcaptcha_hosts`.
3. Configure installation by editing [ansible/vars/mcaptcha/vars.yml](https://git.batsense.net/mCaptcha/iac/src/branch/master/ansible/vars/mcaptcha/vars.yml). Most parameters have defaults, and the required parameters are annotated.
4. Run playbook:
```bash
ansible-playbook -i path/to/inventory-file -f 10 ./ansible/mcaptcha.yml
```
### Update
1. Pull changes from Git repository
2. Rerun playbook