Skip to content

Commit 19e68bb

Browse files
committed
update_package_in_containers
1 parent 221015d commit 19e68bb

22 files changed

+2038
-0
lines changed

QUICKSTART_UPDATE_PACKAGES.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Quick Start: Update Packages in Containers
2+
3+
This is a quick reference guide for updating RPM packages in OpenStack containers.
4+
5+
## TL;DR - Just Run This
6+
7+
```bash
8+
# Update OVN package (replicates original bash script)
9+
./scripts/update_container_packages.sh \
10+
--package ovn24.03 \
11+
--repo http://rhos-qe-mirror.lab.eng.tlv2.redhat.com/rhel-9/nightly/updates/FDP/latest-FDP-9-RHEL-9/compose/Server/x86_64/os/
12+
```
13+
14+
## Common Commands
15+
16+
### 1. Update OVN Package (Predefined Config)
17+
```bash
18+
./scripts/update_container_packages.sh -v ovn_update.yml
19+
```
20+
21+
### 2. Update Neutron Package (Predefined Config)
22+
```bash
23+
./scripts/update_container_packages.sh -v neutron_update.yml
24+
```
25+
26+
### 3. Update Custom Package
27+
```bash
28+
./scripts/update_container_packages.sh \
29+
-p your-package-name \
30+
-r http://your-repo-url.com/
31+
```
32+
33+
### 4. Dry Run (See What Would Happen)
34+
```bash
35+
./scripts/update_container_packages.sh \
36+
-p ovn24.03 \
37+
-r http://example.com/repo/ \
38+
--dry-run
39+
```
40+
41+
### 5. Direct Ansible Playbook
42+
```bash
43+
ansible-playbook playbooks/update_container_packages.yml \
44+
-e cifmw_upic_target_package=ovn24.03 \
45+
-e cifmw_upic_repo_baseurl=http://example.com/repo/
46+
```
47+
48+
## What It Does
49+
50+
1. ✅ Authenticates with OpenShift registry
51+
2. ✅ Gets all container images from OpenStackVersion CR
52+
3. ✅ Checks each image for the target package
53+
4. ✅ Builds new images with updated package
54+
5. ✅ Pushes to OpenShift registry
55+
6. ✅ Updates OpenStackVersion CR
56+
7. ✅ Shows summary report
57+
58+
## Verify Results
59+
60+
```bash
61+
# Check updated CR
62+
oc get openstackversion controlplane -n openstack -o yaml | grep customContainerImages -A 10
63+
64+
# Watch pods restart
65+
oc get pods -n openstack -w
66+
67+
# Verify package in container
68+
oc exec -it <pod-name> -n openstack -- rpm -q ovn24.03
69+
```
70+
71+
## Files Created
72+
73+
```
74+
ci-framework/
75+
├── playbooks/
76+
│ ├── update_container_packages.yml # Main playbook
77+
│ ├── UPDATE_CONTAINER_PACKAGES.md # Full documentation
78+
│ └── vars/
79+
│ ├── ovn_update.yml # OVN config
80+
│ └── neutron_update.yml # Neutron config
81+
├── scripts/
82+
│ └── update_container_packages.sh # Helper script
83+
└── roles/
84+
└── update_package_in_containers/ # The role
85+
├── README.md # Role docs
86+
├── USAGE.md # Usage guide
87+
├── defaults/main.yml # Default vars
88+
├── tasks/ # All tasks
89+
├── templates/ # Dockerfile & repo
90+
├── molecule/ # Tests
91+
└── examples/ # Examples
92+
```
93+
94+
## Help
95+
96+
```bash
97+
# Script help
98+
./scripts/update_container_packages.sh --help
99+
100+
# Full documentation
101+
cat playbooks/UPDATE_CONTAINER_PACKAGES.md
102+
cat roles/update_package_in_containers/README.md
103+
```
104+
105+
## Prerequisites
106+
107+
- ✅ OpenShift CLI (`oc`) installed
108+
- ✅ Podman installed
109+
- ✅ Ansible 2.15+
110+
- ✅ Permissions to manage OpenStack namespace
111+
112+
## Troubleshooting
113+
114+
| Problem | Solution |
115+
|---------|----------|
116+
| "oc command not found" | Install OpenShift CLI |
117+
| "Required variables missing" | Provide `-p` and `-r` flags |
118+
| "Authentication failed" | Check `oc login` status |
119+
| "No images found" | Verify OpenStackVersion CR exists |
120+
121+
---
122+
123+
**For detailed documentation, see:**
124+
- [playbooks/UPDATE_CONTAINER_PACKAGES.md](playbooks/UPDATE_CONTAINER_PACKAGES.md)
125+
- [roles/update_package_in_containers/README.md](roles/update_package_in_containers/README.md)
126+
- [roles/update_package_in_containers/USAGE.md](roles/update_package_in_containers/USAGE.md)

0 commit comments

Comments
 (0)