Skip to content

Commit

Permalink
feat: Add capability to add CIDR route to cf tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwidmer authored and papanito committed Sep 30, 2021
1 parent a388c53 commit 402f82c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tasks/create_routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@
loop_control:
loop_var: cf_dns_entry
tags:
- cf_routing
- cf_routing

- name: Create CIDR routing entries
include_tasks: create_routes_cidr.yml
loop: "{{ cf_tunnel.value.routes.cidr }}"
loop_control:
loop_var: cf_cidr_entry
tags:
- cf_routing
8 changes: 8 additions & 0 deletions tasks/create_routes_cidr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Create CIDR entry '{{ cf_cidr_entry }}' for tunnel '{{ cf_tunnel.key }}'
command: cloudflared tunnel route ip add {{ cf_cidr_entry }} {{ cf_tunnel.key }}
register: create_cidr
ignore_errors: true
- name: Show command output
ansible.builtin.debug:
msg: "{{ create_cidr.stdout }}{{ create_cidr.stderr }}"

0 comments on commit 402f82c

Please sign in to comment.