-
-
Save disklosr/63b0e599dd95f21582f75c8012e60af0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: "{{target}}" | |
become: yes | |
gather_facts: no | |
connection: ssh | |
vars_files: | |
- secure_vars.yml | |
vars: | |
- service_name: "dnsupdater.job" | |
tasks: | |
- name: Ensure job folder is present | |
file: | |
path: /opt/{{service_name}} | |
state: directory | |
- name: Copy necessary files | |
template: | |
src: "update-dns.sh" | |
dest: /opt/{{service_name}} | |
mode: 700 | |
- name: Oneshot run to check everything runs fine | |
command: | |
chdir: /opt/{{service_name}} | |
cmd: bash update-dns.sh | |
- name: Setup cron job | |
cron: | |
name: "{{service_name}}" | |
minute: "*/10" # run every 10 minutes | |
job: "cd /opt/{{service_name}} && /opt/{{service_name}}/update-dns.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment