From 1824aa8fbc62be9477197e700632c6ba1bc5a2ad Mon Sep 17 00:00:00 2001 From: grok Date: Mon, 1 Sep 2025 19:11:49 +0200 Subject: [PATCH] add claude's version of ubuntu cheatsheet for rhel satellite --- satellite6-ubuntu-repo-cheatsheet.md | 361 +++++++++++++++++++++++++++ 1 file changed, 361 insertions(+) create mode 100644 satellite6-ubuntu-repo-cheatsheet.md diff --git a/satellite6-ubuntu-repo-cheatsheet.md b/satellite6-ubuntu-repo-cheatsheet.md new file mode 100644 index 0000000..abad30a --- /dev/null +++ b/satellite6-ubuntu-repo-cheatsheet.md @@ -0,0 +1,361 @@ +# Red Hat Satellite 6: Ubuntu Repository Integration Cheat Sheet + +## Prerequisites + +### System Requirements +- Red Hat Satellite 6.x installed and configured +- Administrative access to Satellite server +- Network connectivity to Ubuntu repositories +- Sufficient storage space for repository synchronization + +### Required Packages +```bash +# Ensure these packages are installed on Satellite server +yum install -y pulp-deb-plugins +katello-service restart +``` + +## Configuration Steps + +### 1. Enable Ubuntu Content Support + +#### Via Web UI +1. Navigate to **Administer** → **Settings** → **Content** +2. Set **Restrict Composite Content View** to `No` +3. Enable **Unprotected Repository** if needed + +#### Via Hammer CLI +```bash +# Configure content settings +hammer settings set --name restrict_composite_content_view --value false +``` + +### 2. Create Ubuntu Product + +#### Via Web UI +1. **Content** → **Products** → **Create Product** +2. Fill in details: + - **Name**: Ubuntu 20.04 LTS + - **Label**: ubuntu_2004_lts + - **Description**: Ubuntu 20.04 LTS repositories + +#### Via Hammer CLI +```bash +# Create Ubuntu product +hammer product create \ + --name "Ubuntu 20.04 LTS" \ + --label "ubuntu_2004_lts" \ + --description "Ubuntu 20.04 LTS repositories" \ + --organization "Default Organization" +``` + +### 3. Add Ubuntu Repositories + +#### Main Ubuntu Repository +```bash +# Add main Ubuntu repository +hammer repository create \ + --name "Ubuntu 20.04 Main" \ + --label "ubuntu_2004_main" \ + --product "Ubuntu 20.04 LTS" \ + --content-type "deb" \ + --url "http://archive.ubuntu.com/ubuntu" \ + --deb-releases "focal" \ + --deb-components "main,restricted" \ + --deb-architectures "amd64" \ + --organization "Default Organization" +``` + +#### Universe Repository +```bash +# Add Universe repository +hammer repository create \ + --name "Ubuntu 20.04 Universe" \ + --label "ubuntu_2004_universe" \ + --product "Ubuntu 20.04 LTS" \ + --content-type "deb" \ + --url "http://archive.ubuntu.com/ubuntu" \ + --deb-releases "focal" \ + --deb-components "universe" \ + --deb-architectures "amd64" \ + --organization "Default Organization" +``` + +#### Security Updates +```bash +# Add Security repository +hammer repository create \ + --name "Ubuntu 20.04 Security" \ + --label "ubuntu_2004_security" \ + --product "Ubuntu 20.04 LTS" \ + --content-type "deb" \ + --url "http://security.ubuntu.com/ubuntu" \ + --deb-releases "focal-security" \ + --deb-components "main,restricted,universe,multiverse" \ + --deb-architectures "amd64" \ + --organization "Default Organization" +``` + +#### Updates Repository +```bash +# Add Updates repository +hammer repository create \ + --name "Ubuntu 20.04 Updates" \ + --label "ubuntu_2004_updates" \ + --product "Ubuntu 20.04 LTS" \ + --content-type "deb" \ + --url "http://archive.ubuntu.com/ubuntu" \ + --deb-releases "focal-updates" \ + --deb-components "main,restricted,universe,multiverse" \ + --deb-architectures "amd64" \ + --organization "Default Organization" +``` + +### 4. Synchronize Repositories + +#### Immediate Synchronization +```bash +# Synchronize specific repository +hammer repository synchronize \ + --name "Ubuntu 20.04 Main" \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" + +# Synchronize all repositories in product +hammer product synchronize \ + --name "Ubuntu 20.04 LTS" \ + --organization "Default Organization" +``` + +#### Schedule Synchronization +```bash +# Create sync plan +hammer sync-plan create \ + --name "Ubuntu Daily Sync" \ + --description "Daily Ubuntu repository sync" \ + --interval "daily" \ + --sync-date "2024-01-01 02:00:00" \ + --organization "Default Organization" + +# Add product to sync plan +hammer product set-sync-plan \ + --name "Ubuntu 20.04 LTS" \ + --sync-plan "Ubuntu Daily Sync" \ + --organization "Default Organization" +``` + +### 5. Create Content View + +#### Via Hammer CLI +```bash +# Create content view +hammer content-view create \ + --name "Ubuntu 20.04 CV" \ + --description "Ubuntu 20.04 LTS Content View" \ + --organization "Default Organization" + +# Add repositories to content view +hammer content-view add-repository \ + --name "Ubuntu 20.04 CV" \ + --repository "Ubuntu 20.04 Main" \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" + +hammer content-view add-repository \ + --name "Ubuntu 20.04 CV" \ + --repository "Ubuntu 20.04 Universe" \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" + +hammer content-view add-repository \ + --name "Ubuntu 20.04 CV" \ + --repository "Ubuntu 20.04 Security" \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" + +hammer content-view add-repository \ + --name "Ubuntu 20.04 CV" \ + --repository "Ubuntu 20.04 Updates" \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" +``` + +#### Publish Content View +```bash +# Publish content view +hammer content-view publish \ + --name "Ubuntu 20.04 CV" \ + --description "Initial Ubuntu 20.04 publication" \ + --organization "Default Organization" +``` + +### 6. Create Activation Key + +```bash +# Create activation key +hammer activation-key create \ + --name "ubuntu_2004_key" \ + --description "Ubuntu 20.04 LTS Activation Key" \ + --lifecycle-environment "Library" \ + --content-view "Ubuntu 20.04 CV" \ + --organization "Default Organization" + +# Add subscriptions to activation key +hammer activation-key add-subscription \ + --name "ubuntu_2004_key" \ + --subscription "Ubuntu 20.04 LTS" \ + --organization "Default Organization" +``` + +## Client Configuration + +### 1. Install Katello Agent on Ubuntu Client + +```bash +# Download and install katello-ca-consumer +wget https://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm +alien -i katello-ca-consumer-latest.noarch.rpm + +# Register with Satellite +subscription-manager register \ + --org="Default_Organization" \ + --activationkey="ubuntu_2004_key" \ + --serverurl=https://satellite.example.com:443/rhsm \ + --baseurl=https://satellite.example.com/pulp/repos +``` + +### 2. Configure APT Sources + +```bash +# Create Satellite sources list +cat > /etc/apt/sources.list.d/satellite.list << 'EOF' +deb https://satellite.example.com/pulp/deb/Default_Organization/Library/Ubuntu_20_04_CV/focal main restricted +deb https://satellite.example.com/pulp/deb/Default_Organization/Library/Ubuntu_20_04_CV/focal universe +deb https://satellite.example.com/pulp/deb/Default_Organization/Library/Ubuntu_20_04_CV/focal-security main restricted universe multiverse +deb https://satellite.example.com/pulp/deb/Default_Organization/Library/Ubuntu_20_04_CV/focal-updates main restricted universe multiverse +EOF + +# Update package cache +apt update +``` + +## Monitoring and Maintenance + +### Check Synchronization Status +```bash +# List all repositories with sync status +hammer repository list \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" + +# Check specific repository sync status +hammer repository info \ + --name "Ubuntu 20.04 Main" \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" +``` + +### View Sync History +```bash +# Show sync history +hammer task list \ + --search "label = Actions::Katello::Repository::Sync" \ + --organization "Default Organization" +``` + +### Monitor Storage Usage +```bash +# Check repository sizes +hammer repository list \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" \ + --fields "Name,Size" +``` + +## Troubleshooting + +### Common Issues and Solutions + +#### Repository Sync Failures +```bash +# Check sync task details +hammer task info --id TASK_ID + +# Retry failed sync +hammer repository synchronize \ + --name "Ubuntu 20.04 Main" \ + --product "Ubuntu 20.04 LTS" \ + --organization "Default Organization" +``` + +#### GPG Key Issues +```bash +# Import Ubuntu GPG keys +hammer gpg create \ + --key "$(curl -s https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C)" \ + --name "Ubuntu Archive Automatic Signing Key" \ + --organization "Default Organization" +``` + +#### Client Registration Issues +```bash +# Clean client registration +subscription-manager clean +rm -rf /etc/pki/consumer/ +subscription-manager register --org="Default_Organization" --activationkey="ubuntu_2004_key" +``` + +### Log Files +```bash +# Satellite server logs +tail -f /var/log/foreman/production.log +tail -f /var/log/messages + +# Pulp logs +tail -f /var/log/httpd/pulp_access.log +tail -f /var/log/httpd/pulp_error.log +``` + +## Best Practices + +### Security +- Use HTTPS for all repository URLs +- Regularly update GPG keys +- Implement proper access controls +- Monitor for security updates + +### Performance +- Schedule syncs during off-peak hours +- Use local mirrors when possible +- Monitor disk space regularly +- Configure appropriate retention policies + +### Maintenance +- Regularly publish new content view versions +- Clean up old content view versions +- Monitor sync failures and resolve promptly +- Keep activation keys organized and documented + +## Quick Reference Commands + +```bash +# List all products +hammer product list --organization "Default Organization" + +# List repositories in a product +hammer repository list --product "Ubuntu 20.04 LTS" --organization "Default Organization" + +# Sync all repositories +hammer product synchronize --name "Ubuntu 20.04 LTS" --organization "Default Organization" + +# Publish content view +hammer content-view publish --name "Ubuntu 20.04 CV" --organization "Default Organization" + +# List activation keys +hammer activation-key list --organization "Default Organization" + +# Check system registration +hammer host list --organization "Default Organization" +``` + +This cheat sheet provides a complete workflow for integrating Ubuntu repositories into Red Hat Satellite 6, from initial setup through client configuration and ongoing maintenance. \ No newline at end of file