Skip to content

pe-pe/ansible_role_openwrt_config_cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenWRT Config Cron

Role Quality CI

Ansible role that configures cron on OpenWRT device.

Requirements

None

Role variables

Cron contents defined in openwrt_config_cron_contents variable which are to be applied on OpenWRT device.

openwrt_config_cron_contents: |
  # Example cron job
  0 * * * *  logger Example cron job

If openwrt_config_cron_contents configuration variable is not present - no changes are made by role.

Dependencies

This role depends on Ansible role gekmihesg.openwrt which allows to manage OpenWRT and derivatives with Ansible but without Python.

Example playbook using the role

./host_vars
./host_vars/myrouter.yml

---
openwrt_config_cron_contents: |
  # Example cron job
  0 * * * *  logger Example cron job

./inventory.ini

[openwrt]
myrouter

./roles
./roles/requirements.yml

---
roles:
- name: gekmihesg.openwrt
- name: pe_pe.openwrt_config_cron

./site.yml

---
- hosts: all
  roles:
    - role: gekmihesg.openwrt
    - role: pe_pe.openwrt_config_cron

./ansible.cfg

[defaults]
# Define inventory location
inventory = ./inventory.ini
# Where to put roles downloaded from galaxy and other repos
roles_path = ./roles
# Defaults to /tmp to avoid flash wear on target device
remote_tmp = /tmp

Example execution

Install roles and requirements:

ansible-galaxy role install -r roles/requirements.yml

Preview changes execution would perform on inventory:

ansible-playbook site.yml --check --diff

Execute playbook on inventory:

ansible-playbook site.yml

License

MIT

Author Information

PePe

About

Ansible role that configures cron on OpenWRT device

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published