---
- template:
    src: regtomydns.sh.j2
    mode: 0755
    dest: /etc/cron.daily/regtomydns
  when: secret.ddns_mydns_password != ""
  become: yes

- name: Check if regtomydns works
  command: /etc/cron.daily/regtomydns
  when: secret.ddns_mydns_password != ""
  changed_when: False


- template:
    src: _update_f5_si.sh.j2
    dest: /usr/local/bin/_update_f5_si.sh
  when: secret.ddns_f5_si_password != ""
  become: yes
  register: ddns_deploy_f5_si_script

- cron:
    name: Update f5.si DDNS entry
    hour: 5
    minute: 50
    job: sh /usr/local/bin/_update_f5_si.sh
    user: root
  when: ddns_deploy_f5_si_script.skipped is not defined
  become: yes

---
# Disable for now. 10sr.mdyns.jp is directed to ec2 instance.
# - template:
#     src: regtomydns.sh.j2
#     mode: 0755
#     dest: /etc/cron.daily/regtomydns
#   when: secret.ddns_mydns_password != ""
#   become: yes

# - name: Check if regtomydns works
#   command: /etc/cron.daily/regtomydns
#   when: secret.ddns_mydns_password != ""
#   changed_when: False


- template:
    src: _update_f5_si.sh.j2
    dest: /usr/local/bin/_update_f5_si.sh
  when: secret.ddns_f5_si_password != ""
  become: yes
  register: ddns_deploy_f5_si_script

- cron:
    name: Update f5.si DDNS entry
    hour: 5
    minute: 50
    job: sh /usr/local/bin/_update_f5_si.sh
    user: root
  when: ddns_deploy_f5_si_script.skipped is not defined
  become: yes

Disable mydns reg for conoha for now
Disable mydns reg for conoha for now
