pax_global_header00006660000000000000000000000064152110104100014473gustar00rootroot0000000000000052 comment=31c363d20b806e51457a509e69789805c1b7e5a8 README.md000066400000000000000000000001541521101041000123160ustar00rootroot00000000000000# Sparky_Chronie Sparky test for chrony - https://docs.rockylinux.org/guides/automation/configuring_chrony/main.raku000066400000000000000000000000311521101041000126410ustar00rootroot00000000000000task-run "tasks/install";tasks/000077500000000000000000000000001521101041000121645ustar00rootroot00000000000000tasks/install/000077500000000000000000000000001521101041000136325ustar00rootroot00000000000000tasks/install/task.bash000066400000000000000000000042261521101041000154370ustar00rootroot00000000000000#!/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 > /dev/null << '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 # 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.check000066400000000000000000000236101521101041000155750ustar00rootroot00000000000000~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()} Packages installed successfully (count: {packages_installed})") CODE