Skip to content

Commit

Permalink
adding multicast configuration (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabunixda authored Jun 29, 2022
1 parent 3469ec6 commit cc84a97
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
5 changes: 4 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ rsyncd_enabled: no
openvpn_enabled: no
zerotier_enabled: no
cloudflare_enabled: no

multicast_enabled: no
force_external_dns: no

multicast_interfaces: ""

udmp_external_dns_server_ipv4: ""
udmp_external_dns_server_ipv6: ""
udmp_external_dns_devices:
Expand Down
27 changes: 21 additions & 6 deletions tasks/onboot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---

- name: onboot - query package version
ignore_errors: yes
register: onboot_version
raw: "{{ unifi_os_cmd }} dpkg-query --showformat='${Version}' --show udm-boot"

Expand All @@ -21,12 +22,12 @@
with_items:
- { file: "files/00-onboot-sshkeys.sh", enabled: yes }
- { file: "files/05-onboot-container.sh", enabled: yes }
- { file: "files/10-onboot-cloudflare-ddns.sh", enabled: "{{ cloudflare_enabled | bool }}" }
- { file: "files/10-onboot-frr.sh", enabled: "{{ frr_enabled | bool }}" }
- { file: "files/10-onboot-rsyncd.sh", enabled: "{{ rsyncd_enabled | bool }}" }
- { file: "files/10-onboot-nodeexporter.sh", enabled: "{{ nodeexporter_enabled | bool }}" }
- { file: "files/10-onboot-openvpn.sh", enabled: "{{ openvpn_enabled | bool }}" }
- { file: "files/10-onboot-rsyncd.sh", enabled: "{{ rsyncd_enabled | bool }}" }
- { file: "files/10-onboot-zerotier.sh", enabled: "{{ zerotier_enabled | bool }}" }
- { file: "files/10-onboot-cloudflare-ddns.sh", enabled: "{{ cloudflare_enabled | bool }}" }
shell:
cmd: "[ '{{ item.enabled }}' = 'True' ] \
&& scp {{ role_path }}/{{ item.file }} {{ inventory_hostname }}:{{ unifi_onboot_directory }}/ \
Expand All @@ -35,6 +36,15 @@
- name: onboot - enasure executable flag is set on scripts
raw: chmod +x {{ unifi_onboot_directory }}/*.sh

- name: deploy multicast container
when: multicast_enabled and multicast_interfaces is defined and multicast_interfaces != ""
tags:
- multicast
template:
src: container-multicast.sh.j2
dest: "{{ unifi_onboot_directory }}/10-onboot-multicast.sh"
mode: 0755

- name: deploy external dns force configuration
when: force_external_dns and ( udmp_external_dns_server_ipv4 is defined or udmp_external_dns_server_ipv6 is defined )
tags:
Expand All @@ -48,10 +58,15 @@
when: cloudflare_enabled
tags:
- cloudflare
template:
src: cloudflare_config.json.j2
dest: /mnt/data/cloudflare-ddns/config.json
mode: 0644
block:
- name: ensure config directory exists
raw: mkdir -p "/mnt/data/cloudflare-ddns/"

- name: deploy cloudflare config
template:
src: cloudflare_config.json.j2
dest: /mnt/data/cloudflare-ddns/config.json
mode: 0644

- name: run udm boot service
raw: "{{ unifi_os_cmd }} systemctl restart udm-boot"

0 comments on commit cc84a97

Please sign in to comment.