First commit

This commit is contained in:
2025-06-09 23:32:10 -04:00
commit 863aaeabc7
92 changed files with 2992 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
- name: Configurar Pihole
hosts: pihole
become: false
tasks:
- name: Autenticar la API de pihole
ansible.builtin.uri:
url: http://localhost/api/auth
method: POST
body: |
{
"password": "{{ pihole_password }}"
}
body_format: json
return_content: true
register: auth_response
changed_when: false
- name: Extraer SID de la respuesta de autenticación
ansible.builtin.set_fact:
pihole_sid: "{{ auth_response.json.session.sid | urlencode }}"
- name: Configurar pihole
ansible.builtin.uri:
url: http://localhost/api/config?sid={{ pihole_sid }}
method: PATCH
src: config.json
body_format: json