pax_global_header00006660000000000000000000000064152110144360014507gustar00rootroot0000000000000052 comment=9fb64aba1f4afde43bc9028d69df84dae46ce986 README.md000066400000000000000000000001541521101443600123320ustar00rootroot00000000000000# Sparky_Chronie Sparky test for chrony - https://docs.rockylinux.org/guides/automation/configuring_chrony/main.raku000066400000000000000000000000311521101443600126550ustar00rootroot00000000000000task-run "tasks/install";tasks/000077500000000000000000000000001521101443600122005ustar00rootroot00000000000000tasks/install/000077500000000000000000000000001521101443600136465ustar00rootroot00000000000000tasks/install/task.bash000066400000000000000000000043651521101443600154570ustar00rootroot00000000000000#!/bin/bash set -e echo "Starting chrony installation on Rocky Linux..." # Update system echo "Updating system packages..." sudo dnf update -y # Install chrony echo "Installing chrony..." sudo dnf install -y chrony # Start and enable chronyd service echo "Starting chronyd service..." sudo systemctl start chronyd sudo systemctl enable chronyd # Check chronyd service status echo "Checking chronyd service status..." sudo systemctl status chronyd --no-pager # Configure chrony echo "Configuring chrony..." sudo tee /etc/chrony.conf << 'EOF' # Use public servers from the pool.ntp.org project server 0.rocky.pool.ntp.org iburst server 1.rocky.pool.ntp.org iburst server 2.rocky.pool.ntp.org iburst server 3.rocky.pool.ntp.org iburst # Record the rate at which the system clock gains/losses driftfile /var/lib/chrony/drift # Allow the system clock to be stepped in the first three updates # if its offset is larger than 1 second makestep 1.0 3 # Enable kernel synchronization of the real-time clock (RTC) rtcsync # Enable hardware timestamping on all interfaces that support it #hwtimestamp * # Increase the minimum number of selectable sources required to adjust # the system clock #minsources 2 # Allow NTP client access from local network #allow 192.168.0.0/16 # Serve time even if not synchronized to a time source #local stratum 10 # Specify file containing keys for NTP authentication #keyfile /etc/chrony.keys # Specify directory for log files logdir /var/log/chrony # Select which information is logged #log measurements statistics tracking EOF # Display the configuration for verification echo "Verifying chrony configuration..." cat /etc/chrony.conf # Restart chronyd to apply configuration echo "Restarting chronyd service..." sudo systemctl restart chronyd # Check chrony sources echo "Checking chrony sources..." sudo chronyc sources -v # Check chrony tracking echo "Checking chrony tracking..." sudo chronyc tracking # Check chrony activity echo "Checking chrony activity..." sudo chronyc activity # Verify time synchronization echo "Verifying time synchronization..." timedatectl status # Check if chrony is synchronized echo "Checking synchronization status..." sudo chronyc waitsync 10 echo "Chrony installation and configuration completed successfully!"tasks/install/task.check000066400000000000000000000237731521101443600156230ustar00rootroot00000000000000~regexp: Rocky \s Linux \s \d+ \. \d+ generator: <= 4).lower()} At least 4 NTP servers configured (found {ntp_servers})") # Check packages installed count packages_installed = state.get('packages_installed', 0) print(f"assert: {str(packages_installed >= 1).lower()} Package operations completed (count: {packages_installed})") CODE