Update macos_cloudflared playbook

This commit is contained in:
2020-01-26 11:03:36 +00:00
parent c727ee55fd
commit 9ed9e58cfc

View File

@@ -6,19 +6,23 @@
name: cloudflare/cloudflare name: cloudflare/cloudflare
state: present state: present
register: cloudflare_tap register: cloudflare_tap
tags: install
- name: Update homebrew package list - name: Update homebrew package list
homebrew: homebrew:
update_homebrew: true update_homebrew: true
when: cloudflare_tap.changed when: cloudflare_tap.changed
tags: install
- name: Install cloudflared - name: Install cloudflared
homebrew: homebrew:
name: cloudflared name: cloudflared
update_homebrew: true update_homebrew: true
state: present state: present
tags: install
- name: Create cloudflared config directory - name: Create cloudflared config directory
file: file:
path: /usr/local/etc/cloudflared path: /usr/local/etc/cloudflared
state: directory state: directory
tags: config
- name: Create cloudflared config file - name: Create cloudflared config file
copy: copy:
dest: /usr/local/etc/cloudflared/config.yaml dest: /usr/local/etc/cloudflared/config.yaml
@@ -26,8 +30,18 @@
proxy-dns: true proxy-dns: true
proxy-dns-upstream: proxy-dns-upstream:
- https://dns.bah.io/dns-query - https://dns.bah.io/dns-query
- debug: tags: config
msg: >- - name: Start cloudflared service
To install and start cloudflared service run: shell:
sudo cloudflared service install -- cmd: cloudflared service install
Then set the DNS server to 127.0.0.1 in System Preferences. become: true
tags:
- never
- start
- name: Stop cloudflared service
shell:
cmd: cloudflared service uninstall
become: true
tags:
- never
- stop