This example shows us in Foreman Manage and configure in CentOS Stream Many options for content .
2021 year 12 month ,CentOS 8 Will reach the end of life , By CentOS Stream replace .CentOS Stream and CentOS One of the main changes between previous iterations is that there are no small versions .Centos Stream A continuous release cycle is adopted . Since the beginning of this year ,Foreman Community developers are beginning to see CentOS Stream The benefits of earlier error detection and patches due to continuous release . We no longer need to wait for the next release to take advantage of the latest changes and bug fixes . Pointed out that , This also makes RHEL Developers are closer than ever to FOSS Community .
However , If you are an administrator with hundreds or thousands of servers , You may want to control when new packages are added to a specific server . If you are looking for a free open source tool , Help you ensure the stability of the production server , At the same time, it allows you to safely from Centos Stream Pull in the latest changes for development and testing , This is it. Foreman Where I can help you . With Foreman, You can manage your environment at all stages of the lifecycle Centos Stream Content .
Foreman Is a complete lifecycle management tool for physical and virtual servers . With Foreman, System administrators have the ability to easily automate repetitive tasks , Rapidly deploy applications , And actively manage internal or cloud servers .Foreman by Equipped with management 、 Configuration management and monitoring provide enterprise class solutions . Because of its plug-in architecture ,Foreman It can be extended in countless ways . Use Katello plug-in unit , You can take Foreman As a complete Content management Tools to manage CentOS Stream, And many other content types .
adopt Foreman and Katello, You can define exactly which packages you want each environment to contain . for example , Production environments may use packages that have been verified to be stable , The development environment may need to be up-to-date 、 State of the art package version . You can also promote... Across life cycle environments Content view . Let's see Foreman How to accomplish this task .
We used the web user interface in this article , but Foreman There is also a strong CLI and API.Katello Plug in Pulp The project provides a workflow and web user interface , You can Learn more about . We also provide a simple workflow here , however Foreman and Katello The project provides many different configuration options to meet your specific needs .
This paper assumes that Foreman and Katello Installed . More information on how to install , see also .
The first step is to Foreman Create a product . The function of the product is to store... As an internal label CentOS Stream The repository .
- stay Foreman Web user interface , Navigate to “ Content > product ”, And click the “ Create products ”.
- stay “ name ” Field , Enter a name for the product .Foreman According to your input “ name ” Done automatically “ label ” Field , You can't change it later .
Now you have a product , You can use AppStream and BaseOS Repository's URL, And add them to your new product .
- stay Foreman In the web user interface , Navigate to “ Content > product ”, Choose the product you want to use , And then click “ New repository ”.
- stay “ name ” Field , Enter a name for the repository ; for example ,“Centos8StreamBaseOS”.Foreman According to your input “ name ”, Done automatically “ label ” Field .
- from “ type ” In the list , Select the type of Repository , And then choose “Yum”.
- stay “URL” Field , Input CentOS Stream Baseos Repository's URL, As the source ：
- choice “ Download rules ” list . The default is “ On demand ”, It means Katello Only metadata will be downloaded . If you want to download all the packages , Please change it into “ instant ”, It can download all software packages , May reach 20-30GB.
- Make sure “ Synchronize with mirror ” The check box is selected . This option ensures that during synchronization , Content that is no longer part of the upstream repository is deleted .
- Click on “ preservation ”.
Repeat these steps , add to AppStream Repository and its application URL, for example ,
http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/. Make sure you use the latest official CentOS Mirror instead of it .
To perform an immediate synchronization , In your product window , Click on “ Sync now ”. The initial synchronization may take some time . You can start your “ Content > sync ” View synchronization status .
After synchronization , You can “ host > operating system ” View new CentOS Stream operating system . Please feel free to edit the name and description to meet your requirements .
If you plan to use Ansible or Puppet And other configuration management software ,Foreman An operating system report is automatically created . You can “ management > Set up > Ignore operating system conditions ” Turn off this option in . Renaming the operating system to match the name in the configuration management software is a good idea . for example , about Puppet, This will be “CentOS 8”.
The application lifecycle is Foreman A core concept of content management function . The life cycle of an application defines the state of a particular system and its software at a particular stage . for example , The life cycle of an application can be simple , You may only have one “ Development ” Phase and “ production ” Stage .Foreman Provides ways to customize each application lifecycle phase in a controlled manner , To fit your norms .
At this point , You must create your lifecycle environment path .
- stay Foreman In the web user interface , Navigate to “ Content > Life cycle environment ”.
- Click on “ New environment path ”, Start a new application lifecycle .
- stay “ name ” Field , Enter a name for your environment .
- stay “ describe ” Field , Enter a description of your environment .
- Click on “ preservation ”.
- Add as many environment paths as you need . for example , You can create “dev”、“test”、“stage” and “production” Environmental Science . To add these environments , Click on “ Add a new environment ”, complete “ name ” and “ describe ” Field , And from “ Priority environment ” Select the previous environment from the list , So you can connect them in the order you want to use them .
stay Foreman in ,“ Content view ” Is a snapshot of your repository at a specific point in time . The content view provides a mechanism to isolate the package version from the state you want to keep . The content view has many configurable features , You can use it to further refine . For the purposes of this tutorial , Let's keep it simple .
- stay Foreman In the web user interface , Navigate to “ Content > Content view ”, And click the “ Create a new view ”.
- stay “ name ” Field , Enter a name for the view .Foreman It will be automatically completed according to the name you enter “ label ” Field .
- stay “ describe ” Field , Enter a description of the view .
- single click “ preservation ” To create a content view .
- In the new content view , Click on “Yum Content > Add Repository ”, stay “ Repository selection ” Area , Click on “ add to ”. about BaseOS and Appstream The repository , Select the package you want to include , And then click “ Add Repository ”.
- Click on “ Release a new version ”, stay “ describe ” Area , Enter information about the version to record changes .
- single click “ preservation ”.
When you click “ Release a new version ” when , You've created a snapshot of everything you've synced . This means that each server you subscribe to this content view will only access the package version in the content view related to this lifecycle environment .
Each new content view and subsequent versions will be published to the library environment first , Then you can spread it there to other environments .
If you have tested a new package , And make sure everything is stable , You can extend your content view to another lifecycle environment .
- Navigate to “ Content > Content view ”, Select the content view you want to promote .
- Click... In the content view “ edition ” label .
- Choose the version you want to promote , And in “ operation ” In the bar , Click on “ Extension ”.
- Choose the environment where you want to promote content view , And click the “ Promotion version ”.
- Click again on the “ Extension ” Button . This time choose the lifecycle environment , for example ,“Test”, And then click “ Promotion version ”.
- Last , Click again on the “ Extension ” Button . for example , choice “Production” Environment and click “ Promotion version ”.
Servers assigned to this particular environment can now be extracted from an updated set of software packages .
In order to CentOS Stream The server registers with the content you define in a specific lifecycle , You must create an activation key . The activation key is a secure way to share credentials with the server . This uses a method called “ Subscription manager Tools to subscribe to CentOS Stream The content of the server .
When you create the activation key , take CentOS Stream Add subscription to activation key .
- stay Foreman In the web user interface , Navigate to “ Content > Activation key ”, And click the “ Create activation key ”.
- stay “ name ” In the bar , Enter the name of the activation key .
- stay “ describe ” In the bar , Enter a description of the activation key .
- from “ Environmental Science ” In the list , Select the environment to use .
- from “ Content view ” In the list , Select the content view you just created .
- Click on “ preservation ”.
Now everything is ready . As the content you create is included in the content view , And promote... Throughout the life cycle , You can now configure the host with exactly what you want to use , And subscribe to the updates you want them to receive .
To be in Foreman Create a host in , Please navigate to “ host > Create a host ”.
- stay “ name ” Field , Enter a name for the host .
- single click “ organization ” and “ Location ” tab , To ensure that the configuration environment is automatically set to the current environment .
- from “ Deployed in ” In the list , choice “ Bare metal ”.
- single click “ operating system ” tab .
- from “ framework ” In the list , choice “x86_64”.
- from “ operating system ” In the list , choice “CentOS_Stream 8”.
- Check “ Build a model ” box .
- about “ Media choice ”, choice “ Synchronized content ” To use your previously synced CentOS Stream Content .
- from “ Synchronized content ” In the list , Make sure to choose “CentOS Stream”.
- from “ Partition table ” In the list , For this demonstration , Choose the default “Kickstart”, But there are many options available .
- stay “Root password ” In the bar , Enter a... For your new host root password .
- Click on “ Interface ” label , And click the “ edit ”, And add a “Mac Address ”.
- Click on “ Parameters ” label , And make sure to save it in a parameter that provides the activation key . without , Add an activation key .
- Click on “ Submit ” To save the host entry .
Now? , The new host is in build mode , That means when you open it , It will start installing the operating system .
If you navigate to “ host > Content host ”, You can see the subscriptions subscribed by your host 、 Full details of the lifecycle environment and content view .
This example is just for you in Foreman Manage and configure in CentOS Stream A small peek at the many options of content . If you want to know more about how to manage CentOS Stream edition , Control what your server can access , And details of controlling and protecting the stability of your infrastructure , Please check out file . When all CentOS Stream When the content is under your control , You can create and register Centos Stream, Use only what you specify . More details about the equipment , Please see the file . If you have any questions 、 Feedback or suggestions , You can find Foreman Community .
author ： Topic selection ： translator ： proofreading ：
This paper is written by Original compilation , Honor roll out