Skip to content

Schedule Yum Updates

Go to Automation

View in GitLab

Description

This Ansible playbook uses the schedule-yum-updates role for scheduling YUM updates. This role performs several tasks:
It first checks if all required variables are defined. It then creates a log file and sets up log rotation. The playbook creates necessary directories and copies various files (SQL, shell script, mail template, and Python script) to specific locations. It runs the scheduler script with provided parameters, logs the output, and handles errors by failing the playbook if the scheduler fails. Finally, it displays the scheduler results if available.

schedule-yum-updates.sql This SQL script retrieves server update schedules from the server database.

schedule-yum-updates.sh This shell script schedules yum updates by interacting with the Ansible Tower API and the server database.

schedule-yum-updates.py This Python script sends email notifications about yum update maintenances to specified recipients.

schedule-yum-updates.mailtemplate This HTML file is the email template used by the Python script to notify recipients about yum update maintenances.

schedule-yum-updates.logrotate This logrotate configuration file manages the rotation of the log file created by the scheduler script.

Credentials

  • sys_ansible_serverupdates (Username for Ansible Tower)
  • Neon API - PR
  • DG_ServersUser1 (SQL user)
  • sys_ansible_smtp (Password for SMTP server)

Input

Variable Description
target Name of the Ansible server to execute te task
daysinadvance Number of days in advance to schedule
debug Boolean to enable debug default: false

Output

None

Dependencies