All Projects → nicolas-r → katello-centos-errata-import

nicolas-r / katello-centos-errata-import

Licence: other
Imports CentOS (from http://cefs.steve-meier.de/) errata into Katello

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to katello-centos-errata-import

prml errata
More PRML Errata
Stars: ✭ 73 (+160.71%)
Mutual labels:  errata
green-recorder
A simple screen recorder for Linux desktop. Supports Wayland & Xorg
Stars: ✭ 39 (+39.29%)
Mutual labels:  centos
insaneworks-packer-template
CentOS 7-8 8Stream / AlmaLinux 8 / FreeBSD 12 - 13 x64 + VirtualBox / VMWare for Packer Template + FreeBSD 13 / AlmaLinux 9 + Parallels
Stars: ✭ 38 (+35.71%)
Mutual labels:  centos
devtoolset-container
Devtoolset container images based on Red Hat Software Collections, that provide a platform for building and running C and C++ applications. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 40 (+42.86%)
Mutual labels:  centos
Linux-Tuning-SIP-Servers
Optimizing System Performance for SIP servers
Stars: ✭ 34 (+21.43%)
Mutual labels:  centos
LinuxMirrors
Linux 一键更换国内软件源
Stars: ✭ 623 (+2125%)
Mutual labels:  centos
ansible-role-php-versions
Ansible Role - PHP Versions
Stars: ✭ 78 (+178.57%)
Mutual labels:  centos
Shell-Script
Shell Script on FreeBSD or Ubuntu
Stars: ✭ 34 (+21.43%)
Mutual labels:  centos
nginx-conf
Nginx configuration
Stars: ✭ 18 (-35.71%)
Mutual labels:  centos
ffmpeg installer
A Linux Shell Script for compiling, installing and uninstalling FFmpeg in CentOS
Stars: ✭ 32 (+14.29%)
Mutual labels:  centos
installer-linux
💾 SinusBot Installer for Debian, Ubuntu and CentOS - Installs the SinusBot with a single command.
Stars: ✭ 28 (+0%)
Mutual labels:  centos
docker-hands-on-guide
Hands on guide for docker, k8s cluster lightweight virtualization.
Stars: ✭ 25 (-10.71%)
Mutual labels:  centos
Linux-Active-Directory-join-script
Active directory Join script for Ubuntu, Debian, CentOS, Linux Mint, Fedora, Kali, Elementary OS and Raspbian with built in failchcheck and debugmode for Ubuntu. "The most advanced and updated AD join script on GITHUB for Linux"
Stars: ✭ 97 (+246.43%)
Mutual labels:  centos
docker-centos8-ansible
CentOS 8 Docker container for Ansible playbook and role testing.
Stars: ✭ 45 (+60.71%)
Mutual labels:  centos
ganeti-rpm
Ganeti RPM Packaging
Stars: ✭ 23 (-17.86%)
Mutual labels:  centos
ansible-role-redmine
Ansible Role To Install Redmine
Stars: ✭ 17 (-39.29%)
Mutual labels:  centos
deploy-vm
Libvirt wrapper to spawn VMs using cloud images
Stars: ✭ 56 (+100%)
Mutual labels:  centos
ansible-role-docker-ce
Ansible role to install Docker CE on AlmaLinux/Rocky/CentOS/Fedora/RHEL(Redhat)/Ubuntu/Debian/Mint/Raspbian
Stars: ✭ 73 (+160.71%)
Mutual labels:  centos
ansible-role-test-vms
DEPRECATED - A Vagrant configuration to test Ansible roles against a variety of Linux distributions.
Stars: ✭ 42 (+50%)
Mutual labels:  centos
piu
Cross platform package manager wrapper
Stars: ✭ 33 (+17.86%)
Mutual labels:  centos

Warning

Since the move to pulp 3, this script is no more working properly. Currently, I have no time to continue working on that project and try to find a solution.

By looking at the following link, https://docs.pulpproject.org/pulp_rpm/workflows/upload.html, under Advisory upload, it seems there is a way to upload advisories in json format. If someone can write a patch to add support for that, I'll be more than happy to integrate it

katello-centos-errata-import

This script imports CentOS Errata into Katello and use preformatted information from http://cefs.steve-meier.de/

This is a python rewrite of a perl script made by brdude with some modifications, like the use of a redis cache.

To run this script on CentOS you need:

  • pulp-admin-client
  • pulp-rpm-admin-extensions
  • redis server
  • Some python modules
    • lxml
    • PyYAML
    • pyaml
    • redis
    • requests

It has been tested on CentOS 7 with the default python version and with python34 from EPEL. I'm using pew to test it inside a python virtual environment

Warning

  • I offer no guarantees that this script will work for you. It is offered as is!
  • I'm not an experimented Python programer, so this script may look horrific to anyone familiar with the language.

Prerequisites

Katello settings

The option "Mirror on Sync" has to be set to "No" for the CentOS repositories. if set to "Yes", the repositories will be mirror from upstream and all erratas will be lost, as upstream doesn't publish erratas

Authentication

pulp-admin must authenticate to pulp. This authentication information can be provided to pulp-admin in two ways.

  1. User certificate (~/.pulp/user-cert.pem)
    If you are using this script with katello, the foreman-installer creates a certificate suitable for use with pulp. You can use the cert by doing the following:
mkdir ~/.pulp/
chmod 0700 ~/.pulp/
sudo cat /etc/pki/katello/certs/pulp-client.crt /etc/pki/katello/private/pulp-client.key > ~/.pulp/user-cert.pem
chmod 400 ~/.pulp/user-cert.pem
  1. Admin configuration file (~/.pulp/admin.conf)
    You can provide the auth credentials in the pulp-admin configuration file. Simply create ~/.pulp/admin.conf, you can get the password from /etc/pulp/server.conf (default_password).
mkdir ~/.pulp/
chmod 0700 ~/.pulp/
sudo cp /etc/pulp/admin/admin.conf ~/.pulp/
sed -i "20,30s/^# host:.*/host: $(hostname -f)/g" ~/.pulp/admin.conf
PULP_PASS=$(sudo awk '/^default_password/ {print $2}' /etc/pulp/server.conf)
cat >> ~/.pulp/admin.conf << EOF

[auth]
username: admin
password: ${PULP_PASS}
EOF
chmod 0400 ~/.pulp/admin.conf

It is probably advisable to not store these credentials in a normal user's home directory. You might consider using the root user for pulp-admin tasks. Then non-privileged users can be given rights explicitly through sudo. If you choose this way, the previous commands are still valid but as you will be connected as root, using sudo will be useless.

Redis server

Modify the configuration file to change the bind address if needed, and to enable persistent storage.

Right now, these scripts are not using authentification to connect to the redis server, so protected mode must be disabled (depending of your redis version).

Configuration file

  • Rename the sample-config.yaml to config.yaml
  • Fill the information for
    • your Katello server
    • the directory that will contains the data files
    • your redis server

For the reposotiries part, this is a little tricky.

  • katello-repository-label: this is the 'Label' fied that you can find in the webui, by clicking on a repository name inside a product
  • pulp_id: this is the 'Backend Identifier' fied that you can find in the webui, by clicking on a repository name inside a product
  • release: this is the CentOS release matching the repository content (must be 6 or 7 right now)

Usage

  1. Sync repositories
  2. Run the script download-data.sh to download the last datafiles from Steve Meier and Red Hat sites
  3. Run the script centos-errata-redis-loader.py to store errata data into Redis
  4. Run the script centos-errata-katello-importer.py to start the creation of the errata into Katello
  5. Wait for the repositories synchronizations triggered by the script to finish and the erratas will appear

Contributing

Please feel free to make pull requests for any issues or errors in the script you may find.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].