Update UpdateAdGuardBlacklist.yml

This commit is contained in:
Joshua Laymon 2024-04-26 01:38:01 +00:00
parent 6a7d73fcf1
commit 24dd820ad6

View File

@ -4,17 +4,32 @@
gather_facts: no # Disable gathering facts gather_facts: no # Disable gathering facts
tasks: tasks:
- name: Fetch authentication token
uri:
url: "http://192.168.51.201/control/login"
method: POST
body_format: json
body:
name: "joshlaymon"
password: "1993llelMO65026"
return_content: yes
validate_certs: no
register: login_response
- name: Extract session token
set_fact:
session_token: "{{ login_response.json.api_token }}"
- name: Update DNS blacklists - name: Update DNS blacklists
uri: uri:
url: "https://dns1.lan/api/dnsblacklist/update" url: "http://192.168.51.201/control/update_dns_blacklist"
method: POST method: POST
body_format: json body_format: json
body: body:
blacklist_urls: blacklist_urls:
- "https://example.com/blacklist.txt" - https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
- "https://anotherexample.com/blacklist.txt"
headers: headers:
Authorization: "Bearer YOUR_API_TOKEN" X-Auth-Token: "{{ session_token }}"
status_code: 200 status_code: 200
validate_certs: no validate_certs: no
register: update_response register: update_response