Ascender Pro videos

Create a local Rocky Linux repository via Ascender

When a fleet of Rocky Linux machines all pull updates from the internet, the bandwidth adds up, and secured environments often block direct internet access entirely. Greg Sowell demonstrates an Ascender job template that turns a server into a local Rocky Linux repository so hosts can update from inside the network. The template uses a survey to ask whether to kick off the first synchronization right away, and a terminal watch on df -h confirms packages arriving as soon as the job finishes.

The video tours the playbook's variables and templates rather than each task. A web path sets where the mirror lives, a script path points to the bash rsync script, a sync frequency in hours feeds the cron job, and a configure web server switch installs nginx and, when enabled, applies SELinux configuration to the repository folder. The rsync exclusion file, supplied by colleague Jimmy Conner, trims content that is not needed, and since rsync only transfers changes, later syncs stay lightweight.

The result extends the Rocky Linux guide, which assumes an existing web server, into a single automation that handles web server, cron job and SELinux from scratch. The accompanying blog post documents the steps in more detail.

Key takeaways

  • Local mirrors cut internet bandwidth for large fleets and give hosts without internet access a source for dnf updates.
  • The job template's survey defaults sync now to false; setting it true runs the first rsync as soon as configuration completes.
  • Setting configure web server to true installs and configures nginx and, in that case, also fixes SELinux on the repository folder.
  • The sync frequency variable is expressed in hours and drives the cron job that keeps the mirror current.
  • An rsync exclusion file trims unneeded content so the mirror uses less storage and bandwidth.
  • Nginx and sync script configuration live in templates in the repository that can be modified for your environment.

Questions this video answers

How do you create a local Rocky Linux repository with Ascender?

Run the Rocky local repository job template. Its playbook creates the repository folders, installs and configures nginx if asked, sets SELinux rules, drops in an rsync script and exclusion file, and schedules a cron job on the interval you set in hours. A survey lets you sync immediately.

Which playbook variables should be changed for your environment?

Update the web path to where the mirror should live and the script path for the rsync script, set the sync hour frequency, and decide whether the playbook should install the nginx web server and apply SELinux configuration. Review the sync now default and the exclusion file list as well.

Why use an exclusion file with rsync?

It lists files and folders that should not be synchronized, such as content not used in your environment. Skipping them reduces both bandwidth and the disk space the mirror consumes. The list in the demo suits CIQ's environment and can be edited for yours.

This video is part of the Ascender Pro playlist. Browse every CIQ video by product and topic.

Transcript

hey everybody I'm Greg Sowell and welcome to another ciq demo so today I'm going to be showing you how to use Ascender right our automation platform to configure a local Rocky repository so why is that useful right it could be uh a couple different well a few different reasons probably so one being um I don't have a lot of Internet bandwidth right like every time I do an update on my systems right it's like a dnf update it's going to go the Internet it's going to pull all that stuff down now that's probably not too big a deal if I've got one or

two machines but say I have thousands of machines and I'm doing updates right that can be uh kind of a hog on your bandwidth so that's one instance another could be you have a very secure environment so your machines don't just have default access to the internet so they need to actually get that from some local system or Source right so this is going to be kind of a quick and easy way to show you how to do that I have an Associated blog post uh and ultimately there is a rocky guide that shows how to do a portion of this I've kind of built

on it and have it do all the extra stuff and all those links should be in there as well so let's take a look really quick at my uh automation here in Ascender so I'm going to come into the job template section I've already created this simple job template I'm going to look for repo I believe is what I named it Rocky local Repository so in here I have a couple of cool things going on uh one is I'm actually prompting for some information I'm using something called a survey so I'm going to go into this job template itself I'm going to look at survey

right here and for those of you in the know it just gives you the ability to pop up some really easy hey fill in the blank information for your users and so here I'm saying do you want to sync the repo now so one thing I do in this Playbook is I have the option to at the very end go ahead and fire off the synchronization I'm setting a Cron job right so we'll run on an even schedule but at the end of this do I want to go ahead and just do a quick update yes I do because I'm doing a demo and I

View full transcriptHide full transcript

want you to be able to see what's going on so I'm going to jump back to the template itself and I'm just going to click the little rocket Chet here and I'm going to launch it so do I want to sync the repo now I've got it defaulting to false I'll change that to true I'll click next and launch and then my automation is off and running so while that happens rather while that runs I'm going to pop over to the Playbook itself and I want to show you a couple of the knobs you may or may not want to turn so here's a Playbook

it doesn't look anything too crazy but I do have some variables in the variable section here that are useful so I have web path and so this is going to be the path to your web repository so um it's basically the root folder where all the files are going to get synchronized too right right in there a script path so this is using a bash script to actually do the uh rsync and ultimately that's what it's doing it's just R syncing these files and making sure it it uh grabs the uh newest version or synchronizes uh everything that happens to be in there uh and

so you want to update those paths to match whatever your environment looks like so the sync hour frequency I have this set up to where it we'll just do it based on hours so you just put the number of hours in there you want it to wait in between synchronizing uh configure web server now the uh the guide we have online assumes you already have a web server configured I didn't want to assume that so if you are say setting up a server from scratch and there is no web server on here if you set this to true it will go and it will install

an engine X server configure all the settings for you as is appropriate so that it will you know kind of have it browsable and uh ready for you to utilize now if you underneath that have S uh SE Linux config true uh that will set up the uh the web folder it'll kind of uh re uh reset the uh permission structure in there because it's also going to make sure all these folders exist so the assumption is they probably don't so it we'll create that folder and then it will just make sure that uh SC Linux is configured properly now it's only going to do

that if you are installing the web server so if you want it to be a different Behavior than that you might need to modify this and then also you can see the sync now uh option is there by default I have it set to false um just so it won't synchronize on the regular interval um but in my case I wanted it to actually be true so all these things you may want to adjust uh these settings you may want to adjust the defaults now let me scroll down a little bit when we're doing our synchronizing we are doing rsync but we're using an exclusion

file so what that allows you to do is specify certain files or folders that you don't actually want to synchronize and so in our environment this is uh the exclusion file kindly provided by my uh associate my compadre uh my uh Ninja friend Jimmy Connor uh so here you could see there's just a a big list of things that we don't necessarily want to pull down some aren't going to be used in our environment um some may be in yours right so you might want to modify this list um but for us you know it's kind of helpful it also means there's fewer space requirements

on your server right so if you're not just pulling everything down you're going to consume less space which is more efficient both on your bandwidth as well as on your storage now keep in mind once everything is rsync it's not just going to pull everything down over and over and over that's kind of not the nature of rsync it's going to compare the two and really just pull uh things that have changed so it is fairly space efficient a lot of this is utilizing templates as well so if you take a look at the template folder here you can see kind of all of my

templates I'm using right it excludes the engine X and the repository synchronization script so feel free to pop in there now let me pop pop back over to our job it was successful it completed so uh now that everything has run it is saying that it is syncing correctly let me jump to the very bottom y so it is synchronizing now so let me tab over to my uh terminal and we'll watch that grow just to make sure that it's actually working all right so here we are this is the uh terminal on the server I'm just doing a watch on dfh and right there

on the RL D root you should see the space being used increment slowly I've got it refreshing I think every two seconds yeah it says on the top right as you can see it's actually uh pulling all that stuff in so it successfully worked you can see it went really fast there's not a lot to talk about here the steps are pretty laid out everything's going to be documented in the blog post so um if you have any questions or comments or you'd make any modifications I would love to hear from you feedback is a gift and it is almost the holiday season so uh

feel free to give me any of those um if you would like any assistance doing any of this inside of your environment please feel free to reach out we do support on all of our products and so we would be happy to hear from you if nothing else happy automating happy uh local repoing and we'll see you next time bye

Built for scale. Chosen by the world’s best.

2.75M+

Rocky Linux instances

Being used world wide

90%

Of fortune 100 companies

Use CIQ supported technologies

250k

Avg. monthly downloads

Rocky Linux

9

Enterprise products

Spanning the kernel to the orchestrator

Have questions about your infrastructure?

Talk to a CIQ engineer about Rocky Linux, HPC, and AI infrastructure.

Talk to an Expert