Update UpdateAdGuardBlacklist.yml
This commit is contained in:
parent
6a7d73fcf1
commit
24dd820ad6
@ -4,21 +4,36 @@
|
||||
gather_facts: no # Disable gathering facts
|
||||
|
||||
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
|
||||
uri:
|
||||
url: "https://dns1.lan/api/dnsblacklist/update"
|
||||
url: "http://192.168.51.201/control/update_dns_blacklist"
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
blacklist_urls:
|
||||
- "https://example.com/blacklist.txt"
|
||||
- "https://anotherexample.com/blacklist.txt"
|
||||
- https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
|
||||
headers:
|
||||
Authorization: "Bearer YOUR_API_TOKEN"
|
||||
X-Auth-Token: "{{ session_token }}"
|
||||
status_code: 200
|
||||
validate_certs: no
|
||||
register: update_response
|
||||
|
||||
- name: Check update response
|
||||
debug:
|
||||
var: update_response
|
||||
var: update_response
|
||||
Loading…
Reference in New Issue
Block a user