aboutsummaryrefslogtreecommitdiff
path: root/roles/searxng/tasks
diff options
context:
space:
mode:
authorMiguel Dalberto Pedro <miguel.pedro@precisioninno.com>2026-10-29 12:48:06 -0300
committerMiguel Dalberto Pedro <miguel.pedro@precisioninno.com>2026-10-29 12:48:06 -0300
commit4b7379914a1865f07b2c54252234cc90158fc253 (patch)
treea476c7e08bb994034d7d04b5b1cdfce216f49c43 /roles/searxng/tasks
downloadmy-infra-4b7379914a1865f07b2c54252234cc90158fc253.tar.gz
my-infra-4b7379914a1865f07b2c54252234cc90158fc253.zip
feat(iac): establish Ansible baseline for Nginx, SearXNG, Valkey, and Certbot
- Reverse-engineer live Debian 13 (trixie) VPS state at miguelpedro.xyz.br - Add modular Ansible roles: common, certbot, valkey, searxng, and nginx - Encrypt SearXNG secret_key using ansible-vault in group_vars/all/vault.yml - Cleanly remove unused example.com Nginx stub symlink (sites-enabled/miguelpedro.xyz.br) - Scaffold cgit + fcgiwrap role (cgit_enabled: false) for upcoming deployment - Add DISCOVERY_REPORT.md, COMMAND_LOG.md, README.md, and AGENT_INSTRUCTIONS.md with Self-Updating Protocol
Diffstat (limited to 'roles/searxng/tasks')
-rw-r--r--roles/searxng/tasks/main.yml84
1 files changed, 84 insertions, 0 deletions
diff --git a/roles/searxng/tasks/main.yml b/roles/searxng/tasks/main.yml
new file mode 100644
index 0000000..c7d45d4
--- /dev/null
+++ b/roles/searxng/tasks/main.yml
@@ -0,0 +1,84 @@
+---
+- name: Ensure searxng system group exists
+ ansible.builtin.group:
+ name: "{{ searxng_group }}"
+ gid: "{{ searxng_gid }}"
+ system: true
+ state: present
+
+- name: Ensure searxng system user exists
+ ansible.builtin.user:
+ name: "{{ searxng_user }}"
+ uid: "{{ searxng_uid }}"
+ group: "{{ searxng_group }}"
+ groups: sudo
+ append: true
+ comment: "Privacy-respecting metasearch engine"
+ home: "{{ searxng_home }}"
+ shell: /bin/bash
+ system: true
+ state: present
+
+- name: Ensure SearXNG directories exist
+ ansible.builtin.file:
+ path: "{{ item.path }}"
+ state: directory
+ owner: "{{ item.owner }}"
+ group: "{{ item.group }}"
+ mode: "{{ item.mode }}"
+ loop:
+ - { path: "{{ searxng_home }}", owner: "{{ searxng_user }}", group: "{{ searxng_group }}", mode: "0755" }
+ - { path: "{{ searxng_home }}/.ansible/tmp", owner: "{{ searxng_user }}", group: "{{ searxng_group }}", mode: "0700" }
+ - { path: "{{ searxng_run_dir }}", owner: "{{ searxng_user }}", group: "{{ searxng_group }}", mode: "0755" }
+ - { path: "/etc/searxng", owner: "root", group: "root", mode: "0755" }
+ - { path: "/etc/uwsgi/apps-available", owner: "root", group: "root", mode: "0755" }
+ - { path: "/etc/uwsgi/apps-enabled", owner: "root", group: "root", mode: "0755" }
+
+- name: Clone or update SearXNG source repository
+ ansible.builtin.git:
+ repo: "{{ searxng_git_repo }}"
+ dest: "{{ searxng_src_dir }}"
+ version: "{{ searxng_git_version }}"
+ update: false
+ become: true
+ become_user: "{{ searxng_user }}"
+
+- name: Deploy /etc/searxng/settings.yml
+ ansible.builtin.template:
+ src: settings.yml.j2
+ dest: /etc/searxng/settings.yml
+ owner: "{{ searxng_user }}"
+ group: "{{ searxng_group }}"
+ mode: "0640"
+ notify: Restart uwsgi
+
+- name: Deploy /etc/searxng/limiter.toml
+ ansible.builtin.template:
+ src: limiter.toml.j2
+ dest: /etc/searxng/limiter.toml
+ owner: "{{ searxng_user }}"
+ group: "{{ searxng_group }}"
+ mode: "0644"
+ notify: Restart uwsgi
+
+- name: Deploy uWSGI app configuration for SearXNG
+ ansible.builtin.template:
+ src: uwsgi-searxng.ini.j2
+ dest: /etc/uwsgi/apps-available/searxng.ini
+ owner: root
+ group: root
+ mode: "0644"
+ notify: Restart uwsgi
+
+- name: Enable uWSGI SearXNG app symlink
+ ansible.builtin.file:
+ src: /etc/uwsgi/apps-available/searxng.ini
+ dest: /etc/uwsgi/apps-enabled/searxng.ini
+ state: link
+ notify: Restart uwsgi
+
+- name: Ensure uwsgi service is enabled and running
+ ansible.builtin.service:
+ name: uwsgi
+ enabled: true
+ state: started