/ovh-dynhost-ansible

Ansible playbook installing OVH DynHost refresh cron job

Primary LanguageShell

OVH DynHost Ansible playbook

Playbook which automatise installation of cron job, which refresh OVH dynamic DNS service known as DynHost

Prerequisites

  • domain bought on OVH
  • configured DynHost entry in OVH DNS zone
  • configured DynHost login and password access

Example

Content of inventory.yml file

all:
  hosts:
    raspberrypi-gate.local
  vars:
    dynhost_user: dynhostd
    dynhost_host: home.yourdomain.com
    dynhost_login: yourdomain.com-home
    dynhost_password: yourhomenewtorkpassword!123
    dynhost_log_dir: /var/log
    dynhost_cron_period_minutes: 10

Run Ansible

ansible-playbook dynhost.yml -u username -i inventory.yml

Check effects

cat /home/dynhostd/cronjob/update.dynhost.home.yourdomain.com.sh
cat /var/log/dynhostd.home.yourdomain.com.log

Possible improvements of this script

  • handling multiple subdomains gently

Credits

Credits for the yjajkiew, creator of shell script used in this playbook