forked from jbjorkang/ansible-wireguard-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook.yml
More file actions
32 lines (27 loc) · 784 Bytes
/
playbook.yml
File metadata and controls
32 lines (27 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
- name: Generate Proxy PAC files
hosts: localhost
connection: local
gather_facts: false
become: false
tasks:
- name: Create output file
file:
state: directory
dest: "{{ playbook_dir }}/output"
- name: Return hosts from Mullvad.net
uri:
url: https://api.mullvad.net/app/v1/relays
method: GET
body_format: json
register: hosts_curl
- name: Set fact to convert hosts to pretty JSON
set_fact:
hosts_json: "{{ hosts_curl.json | json_query('wireguard.relays[].hostname') }}"
- name: Create templates
template:
src: "{{ item }}.pac.j2"
dest: "{{ playbook_dir }}/output/{{ item }}.pac"
loop:
- proxy
- random