cron Crossplatformed Role

Role to push cronjobs (and even script) to definied scriptfolder

Requirements

None.

Role Variables

Name Type Default value Purpose Comment Role
cron_conf Boolean false true/false switch to en/disable ad role cron
cron_data_dir String "/opt/CxS/cron" the cron script datadir, in which scripts passed over cron_jobs are stored
cron_jobs String "" configure cronjobs as follwing with the example, also scripts can by defined, which will be stored in the defined folder
cron_jobs:
  - name: Run cron scheduler
    command: curl https://doc.lxn.ethz.ch
    hour: "4" # default: '*'
    minute: "1" # default: '*'
  - id: "sync folder"
    command: "script"
    minute: "*/10"
    script_name: hello-world
    script: |
      #!/bin/sh
      echo "hello world"

Dependencies

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

  • name: Standard roles for crossplatformed systems hosts: all roles:
  • { role: cron, tags: ["crossplatformed", "cron", "crontab"] }

License

BSD

Big thanks to janikvonrotz & mintsystem.ch, this role is based on their code: https://github.com/Mint-System/Ansible-Playbooks/tree/master/roles/cron

Author Information

Maintainer: Niklaus (Niggi) Kappeler

Support-Contact: servicedesk-linux@id.ethz.ch