Loading roles/wap/tasks/main.yaml +24 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,30 @@ - ansible_distribution == "OpenWrt" - ansible_distribution_major_version == "19" - name: Install packages loop: - curl community.general.opkg: name: '{{ item }}' state: present update_cache: true - name: Copy the daily updates script ansible.builtin.template: dest: &daily /usr/sbin/daily group: root mode: 0o0755 owner: root src: daily.j2 - name: Set the daily updates script Cron job ansible.builtin.cron: hour: "3" job: *daily minute: "1" name: Daily updates state: present - name: Create the www directory ansible.builtin.file: path: /var/www Loading roles/wap/templates/daily.j2 0 → 100644 +7 −0 Original line number Diff line number Diff line #!/bin/sh set -eu opkg update opkg list-upgradable | awk '{print $1}' | sort | xargs -rn1 opkg upgrade --download-only [ -z "$(opkg list-upgradable)" ] || curl https://notify.shore.co.il/send?message={{ (ansible_facts["hostname"] + " has pending updates.") | urlencode }} Loading
roles/wap/tasks/main.yaml +24 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,30 @@ - ansible_distribution == "OpenWrt" - ansible_distribution_major_version == "19" - name: Install packages loop: - curl community.general.opkg: name: '{{ item }}' state: present update_cache: true - name: Copy the daily updates script ansible.builtin.template: dest: &daily /usr/sbin/daily group: root mode: 0o0755 owner: root src: daily.j2 - name: Set the daily updates script Cron job ansible.builtin.cron: hour: "3" job: *daily minute: "1" name: Daily updates state: present - name: Create the www directory ansible.builtin.file: path: /var/www Loading
roles/wap/templates/daily.j2 0 → 100644 +7 −0 Original line number Diff line number Diff line #!/bin/sh set -eu opkg update opkg list-upgradable | awk '{print $1}' | sort | xargs -rn1 opkg upgrade --download-only [ -z "$(opkg list-upgradable)" ] || curl https://notify.shore.co.il/send?message={{ (ansible_facts["hostname"] + " has pending updates.") | urlencode }}