|
| 1 | +--- |
| 2 | +- name: Install vex download script |
| 3 | + ansible.builtin.template: |
| 4 | + src: iop-vex-downloader.sh.j2 |
| 5 | + dest: /usr/local/bin/iop-vex-downloader.sh |
| 6 | + owner: root |
| 7 | + group: root |
| 8 | + mode: '0755' |
| 9 | + |
| 10 | +- name: Create vex download service unit |
| 11 | + ansible.builtin.copy: |
| 12 | + dest: /etc/systemd/system/iop-vex-download.service |
| 13 | + content: | |
| 14 | + [Unit] |
| 15 | + Description=Manages vex-latest.tar.zst for IoP Vulnerability |
| 16 | + After=network-online.target iop-core-gateway.service |
| 17 | + Wants=network-online.target iop-core-gateway.service |
| 18 | +
|
| 19 | + [Service] |
| 20 | + Type=oneshot |
| 21 | + ExecStart=/usr/local/bin/iop-vex-downloader.sh \ |
| 22 | + '{{ iop_vex_downloader_base_url }}' \ |
| 23 | + '{{ iop_vex_downloader_latest_filename }}' \ |
| 24 | + '{{ iop_vex_downloader_output_dir }}' \ |
| 25 | + '{{ iop_vex_downloader_output_filename }}' |
| 26 | + User=root |
| 27 | + Group=root |
| 28 | + mode: '0644' |
| 29 | + |
| 30 | +- name: Create vex download timer unit |
| 31 | + ansible.builtin.template: |
| 32 | + src: iop-vex-download.timer.j2 |
| 33 | + dest: /etc/systemd/system/iop-vex-download.timer |
| 34 | + mode: '0644' |
| 35 | + notify: Restart vex download timer |
| 36 | + |
| 37 | +- name: Create vex download path unit |
| 38 | + ansible.builtin.copy: |
| 39 | + src: iop-vex-download.path |
| 40 | + dest: /etc/systemd/system/iop-vex-download.path |
| 41 | + mode: '0644' |
| 42 | + notify: Restart vex download path |
| 43 | + |
| 44 | +- name: Reload systemd daemon |
| 45 | + ansible.builtin.systemd: |
| 46 | + daemon_reload: true |
| 47 | + |
| 48 | +- name: Flush handlers |
| 49 | + ansible.builtin.meta: flush_handlers |
| 50 | + |
| 51 | +- name: Enable and start vex download timer |
| 52 | + ansible.builtin.systemd: |
| 53 | + name: iop-vex-download.timer |
| 54 | + enabled: true |
| 55 | + state: started |
| 56 | + |
| 57 | +- name: Enable and start vex download path watcher |
| 58 | + ansible.builtin.systemd: |
| 59 | + name: iop-vex-download.path |
| 60 | + enabled: true |
| 61 | + state: started |
0 commit comments