Red Hat Certified Engineer RHCE · Free Practice Question Medium

Question 10

Your organization requires a backup solution to archive log files from the /var/log directory of multiple servers daily and retain backups for 7 days. How would you use Ansible to automate the configuration of rsnapshot to meet this requirement?

  • A

    This playbook automates daily backups of /var/log, retaining them for 7 days.

  • B

    This is a performance based question and not multiple choice.  Therefore the answer is in #1.  If you require additional explanation, please ask your question in the Q&A section.

Reveal correct answer

Correct answer: A

A.

This Ansible playbook automates the configuration of rsnapshot to create daily backups of the /var/log directory, retaining backups for 7 days. It ensures the required rsnapshot package is installed, configures rsnapshot using a template file, and schedules a daily cron job to run the backup process. By automating this setup, the playbook simplifies backup management and ensures consistency across multiple servers, providing a reliable solution for log file archiving and retention.

Line-by-Line Explanation

Specifies that the playbook should run on all managed nodes.

Defines the tasks to be executed in the playbook.

Describes the task to install the rsnapshot package, which is used for managing backups.

Uses the yum module to install the package on CentOS/RHEL systems.

Specifies the name of the package to install.

Ensures the package is installed if not already present.

Describes the task to configure rsnapshot using a predefined template.

Uses the template module to copy and apply the configuration template for rsnapshot.

Specifies the source template file for the configuration.

Defines the destination path for the rsnapshot configuration file on the managed node.

Describes the task to schedule a daily backup job using cron.

Uses the cron module to create a cron job.

Provides a description for the cron job.

Specifies that the job should run at the start of the hour.

Schedules the job to run at 2:00 AM daily.

Defines the command to execute the daily backup process.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need