Add Template to deploy forgejo.
This template allows deploying a forgejo en either Scaleway or Hetzner (untested) without much knowledge about them. It DOES require knowledge about Terragrunt and ansible. A wizard of sorts is provided but it will not guarantee success without some knowledge about the underlying technology.
This commit is contained in:
parent
a9f546f92a
commit
822e42dbb8
48 changed files with 6846 additions and 2 deletions
40
ansible/roles/forgejo/tasks/redis.yml
Normal file
40
ansible/roles/forgejo/tasks/redis.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
# Redis setup tasks
|
||||
|
||||
- name: Install Redis
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- redis-server
|
||||
- redis-tools
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: yes
|
||||
|
||||
- name: Configure Redis
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/redis/redis.conf
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
state: present
|
||||
become: yes
|
||||
loop:
|
||||
- { regexp: '^bind', line: 'bind 127.0.0.1 ::1' }
|
||||
- { regexp: '^protected-mode', line: 'protected-mode yes' }
|
||||
- { regexp: '^maxmemory', line: 'maxmemory 256mb' }
|
||||
- { regexp: '^maxmemory-policy', line: 'maxmemory-policy allkeys-lru' }
|
||||
- { regexp: '^save', line: 'save 900 1' }
|
||||
notify: Restart Redis
|
||||
|
||||
- name: Ensure Redis is started and enabled
|
||||
ansible.builtin.systemd:
|
||||
name: redis-server
|
||||
state: started
|
||||
enabled: yes
|
||||
become: yes
|
||||
|
||||
- name: Test Redis connection
|
||||
ansible.builtin.command:
|
||||
cmd: redis-cli ping
|
||||
register: redis_ping
|
||||
changed_when: false
|
||||
failed_when: redis_ping.stdout != "PONG"
|
||||
Loading…
Add table
Add a link
Reference in a new issue