/ansible-role-yum-cron

A role to install and configure yum-cron

Primary LanguageShellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Build Status

Ansible Role: yum-cron

| A role to install and configure yum-cron

Motivation

Install and configure yum-cron to stay up to date.

Installation

Install from Ansible Galaxy

ansible-galaxy install while_true_do.yum-cron

Install from Github

git clone https://github.com/while-true-do/ansible-role-yum-cron.git while_true_do.yum-cron

Requirements

YUM must be /will be installed, of course. Its a good idea to configure yum, first.

You will find an ansible role here: https://galaxy.ansible.com/while_true_do/yum https://github.com/while-true-do/ansible-role-yum

Used Modules:

Dependencies

ansible-galaxy install -r requirements.yml

Role Variables

CentOS does not support other update commands. Defaults must be used.

# defaults/main.yml

# yum-cron-configuration
wtd_yum_cron_packages: [ 'yum-cron' ]
# yum-cron general settings
wtd_yum_cron_system_name: 'None'

wtd_yum_cron_email_from: 'root@localhost'
wtd_yum_cron_email_to: 'root'
wtd_yum_cron_email_host: 'localhost'

wtd_yum_cron_group_list: 'None'
wtd_yum_cron_group_package_types: 'mandatory, default'

wtd_yum_cron_debuglevel: '-2'
wtd_yum_cron_mdpolicy: 'group:main'
wtd_yum_cron_skip_broken: 'False'
wtd_yum_cron_assumeyes: 'False'

# yum-cron.conf
# CentOS does not support other update_cmd then defaults.
wtd_yum_cron_update_cmd: 'defaults'
wtd_yum_cron_update_messages: 'yes'
wtd_yum_cron_download_updates: 'yes'
wtd_yum_cron_apply_updates: 'no'
wtd_yum_cron_random_sleep: '360'

wtd_yum_cron_emit_via: 'stdio'
wtd_yum_cron_output_width: '80'

# yum-cron-hourly.conf
# CentOS does not support other update_cmd then defaults.
wtd_yum_cron_hourly_update_cmd: 'defaults'
wtd_yum_cron_hourly_update_messages: 'no'
wtd_yum_cron_hourly_download_updates: 'no'
wtd_yum_cron_hourly_apply_updates: 'no'
wtd_yum_cron_hourly_random_sleep: '15'

wtd_yum_cron_hourly_emit_via: 'stdio'
wtd_yum_cron_hourly_output_width: '80'

Example Playbook

Simple Example:

- hosts: servers
  roles:
    - { role: while_true_do.yum_cron }

Advanced Example:

# To enable E-Mail Notifications
- hosts: servers
  roles:
    - { role: while_true_do.yum_cron, wtd_yum_cron_emit_via: 'email', wtd_yum_cron_email_to: 'mymail@example.com' }

Testing

All tests are located in test directory.

Basic testing:

bash ./tests/test-spelling.sh
bash ./tests/test-ansible.sh

Contribute / Bugs

Thank you so much for considering to contribute. Every contribution helps us. We are really happy, when somebody is joining the hard work. Please have a look at the links first.

License

This work is licensed under a BSD License.

Author Information

Blog: blog.while-true-do.org

Mail: hello@while-true-do.org