Skip to content

Commit

Permalink
Drop CentOS 7 boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver committed Jul 15, 2024
1 parent a1bcbe8 commit af4859d
Show file tree
Hide file tree
Showing 25 changed files with 141 additions and 173 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ boxes:
exclude:
- "katello" # exclude any box containing "katello"
- "ubuntu1804-foreman-2\\.0" # exclude only the box "ubuntu1804-foreman-2.0". Notice the escaped '.' character to match the specific character instead of any single character
- "^centos7-fips" # exclude any box that starts with "centos7-fips"
- "^centos9-stream" # exclude any box that starts with "centos9-stream"
- "foreman-1\\.(?:[2][0-3])" # exclude any foreman-1.20 to foreman-1.23 version box
```

Expand Down
20 changes: 10 additions & 10 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ importing/exporting data via [CSV](https://github.com/Katello/hammer-cli-csv).
The CLI can be configured to work with any version of Foreman. To facilitate
development in Hammer or any of its plugins, a lightweight vagrant box is
provided in the `boxes.yaml.example` file. To use this functionality, copy the
centos7-hammer-devel configuration from the example file into your `boxes.yaml`
almalinux8-hammer-devel configuration from the example file into your `boxes.yaml`
file, changing options as necessary. Then run the following:

```sh
vagrant up centos7-hammer-devel
vagrant up almalinux8-hammer-devel
```

In the vagrant box, find the Hammer repositories at `/home/vagrant/` and the
Expand All @@ -261,7 +261,7 @@ changing the hostnames as needed

```yaml
capsule-dev:
box: centos7
box: centos9-stream
ansible:
playbook: 'playbooks/foreman_proxy_content_dev.yml'
group: 'foreman-proxy-content'
Expand All @@ -283,7 +283,7 @@ capsule-dev:

```yaml
capsule-dev:
box: centos7
box: centos9-stream
ansible:
playbook: 'playbooks/foreman_proxy_content_dev.yml'
group: 'foreman-proxy-content'
Expand All @@ -299,7 +299,7 @@ The following example shows some of the extra values that can be set to control

```yaml
katello-client:
box: centos7
box: centos9-stream
ansible:
playbook: 'playbooks/katello_client.yml'
group: 'client'
Expand All @@ -320,19 +320,19 @@ To use this box, copy the configuration from `boxes.yaml.example` to
`boxes.yaml`, changing options as necessary, then run the following:

```sh
vagrant up centos7-dynflow-devel
vagrant up almalinux8-dynflow-devel
```

In the vagrant box, the dynflow repository is cloned to `/home/vagrant/dynflow`.

## Smoker

The testing tool [smoker](https://github.com/theforeman/smoker) can be set up with the `centos7-foreman-smoker` box and tests can be run against a separate Foreman/Katello instance.
The testing tool [smoker](https://github.com/theforeman/smoker) can be set up with the `almalinux8-foreman-smoker` box and tests can be run against a separate Foreman/Katello instance.

To use:
1. Ensure that you have a running instance of Foreman/Katello.
2. Follow the example box definition in `vagrant/boxes.d/99-local.yaml.example` for `centos7-foreman-smoker` and update the `smoker_base_url` variable. With `pytest_run_tests` set to false, smoker tests will not be run by the playbook, but the box will be set up with pytest and the smoker repository will be cloned to the `vagrant` user's home directory.
3. Run `vagrant up centos7-foreman-smoker`. A debug message will print showing the command to run smoker tests and the alias that has been set up. The alias is defined in `~/.bash_profile` on the box itself.
2. Follow the example box definition in `vagrant/boxes.d/99-local.yaml.example` for `almalinux8-foreman-smoker` and update the `smoker_base_url` variable. With `pytest_run_tests` set to false, smoker tests will not be run by the playbook, but the box will be set up with pytest and the smoker repository will be cloned to the `vagrant` user's home directory.
3. Run `vagrant up almalinux8-foreman-smoker`. A debug message will print showing the command to run smoker tests and the alias that has been set up. The alias is defined in `~/.bash_profile` on the box itself.
4. You can then ssh into the smoker box. Ensure the hostname of the Foreman/Katello instance can be reached by the smoker box.
5. From the smoker box, run tests as the vagrant user using the alias or running pytest commands manually. To change the testing options, please see [the smoker documentation](https://github.com/theforeman/smoker) and modify the alias or manually run pytest commands as necessary.

Expand Down Expand Up @@ -381,7 +381,7 @@ If you choose longer name you're on your own, contributions with fixes welcome!
# boxes.d/99-local.yaml
foreman-ad:
box: centos7
box: centos9-stream
memory: 4096
domain: 'example.com' # must be the AD domain
ansible:
Expand Down
6 changes: 3 additions & 3 deletions docs/library.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Deploy a file with the base set of boxes the plugin requires:
vim base_boxes.yaml

```yaml
centos7:
box_name: 'centos/7'
image_name: !ruby/regexp '/CentOS 7.*PV/'
centos9:
box_name: 'centos/9'
image_name: !ruby/regexp '/CentOS 9.*PV/'
pty: true
```
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module APlugin

DB = 'db'
WEB = 'web'
PARENT_NAME = 'centos7-katello-devel'
PARENT_NAME = 'centos9-katello-devel'
PROJECT_PATH = "#{Forklift::ROOT}/../a_repo"

Forklift.define_vm config, Forklift.new_box(PARENT_NAME, DB) do |machine|
Expand Down
16 changes: 8 additions & 8 deletions docs/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ vagrant status
This will show a list of boxes by type and OS. For example, at the time of this documentation both Foreman 1.12 and Katello 3.1 had been released. Thus, when doing a status I see, for example:

```
centos7-foreman-nightly not created (libvirt)
centos7-katello-nightly not created (libvirt)
centos7-foreman-proxy-nightly not created (libvirt)
centos7-foreman-1.16 not created (libvirt)
centos7-katello-3.4 not created (libvirt)
centos9-stream-foreman-nightly not created (libvirt)
centos9-stream-katello-nightly not created (libvirt)
centos9-stream-foreman-proxy-nightly not created (libvirt)
centos9-stream-foreman-3.11 not created (libvirt)
centos9-stream-katello-4.13 not created (libvirt)
```

This indicates that both Foreman and Katello nightly (our unstable releases) are available as well as production installations on Centos 7 boxes of Foreman, Katello and a Foreman Proxy. To fire up a Katello 3.4:
This indicates that both Foreman and Katello nightly (our unstable releases) are available as well as production installations on Centos 9 boxes of Foreman, Katello and a Foreman Proxy. To fire up a Katello 4.13:

Start the installation for CentOS 7:
Start the installation for CentOS 9:

vagrant up centos7-katello-3.4
vagrant up centos9-stream-katello-4.13

This will create a libvirt based virtual machine running the Katello server on CentOS.

Expand Down
14 changes: 7 additions & 7 deletions docs/provision.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ reboot:

2. Build a box

- Option 1: Use the `centos7-provision-nightly` box.
- Option 1: Use the `centos9-provision-nightly` box.

- Option 2: Use an existing katello box (e.g. centos7-katello-p4-nightly) and run the provisioning playbook (it takes a while, as it syncs (on-demand) centos7, puppet 4). ***Note*: If you are using puppet 4, you need to increase the ram on the box, to something like 8096 otherwise candlepin crashes with OOM.**
`ansible-playbook -l centos7-katello-p4-nightly playbooks/katello_provisioning.yml`
- Option 2: Use an existing katello box (e.g. centos9-katello-p7-nightly) and run the provisioning playbook (it takes a while, as it syncs (on-demand) centos9, puppet 7). ***Note*: If you are using puppet 7, you need to increase the ram on the box, to something like 8096 otherwise candlepin crashes with OOM.**
`ansible-playbook -l centos9-katello-p7-nightly playbooks/katello_provisioning.yml`

4. Login and create a compute profile, because this isn't possible with hammer or the API.

- Click Infrastructure / Compute Resources
- Click "libvirt"
- Click Compute profiles
- Click 2-Medium
- increse ram to 1024MB (required for centos 7)
- increse ram to 1024MB (required for centos 9)
- change network type to NAT, network name = provision
- Click Submit

Expand All @@ -37,9 +37,9 @@ reboot:

6. Configure / Host groups

- Edit Forklift CentOS 7
- Edit Forklift CentOS 9
- Set Compute profile to be "2-Medium"
- Assign the `CentOS 7` activation key to the host group
- Assign the `CentOS 9` activation key to the host group

7. You're good to go! Let's provision a box!

Expand All @@ -50,4 +50,4 @@ reboot:

DONE! Click submit :tada:

7. If you want to view the console while it boots, make sure to trust the CA certificate in your browser, it's hosted at https://centos7-katello-nightly.example.com/pub/katello-server-ca.crt, and you'll need to make sure you're accessing the katello via it's proper hostname (add an entry to /etc/hosts)
7. If you want to view the console while it boots, make sure to trust the CA certificate in your browser, it's hosted at https://centos9-katello-nightly.example.com/pub/katello-server-ca.crt, and you'll need to make sure you're accessing the katello via it's proper hostname (add an entry to /etc/hosts)
20 changes: 10 additions & 10 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Included with forklift is a small live test suite. The current tests are:

```
cp boxes.yaml.example boxes.yaml
vagrant up centos7-katello-bats-ci
vagrant up almalinux8-katello-bats-ci
```

If you are making changes to bats tests and want to test your updates, edit `centos7-katello-bats-ci` to include:
If you are making changes to bats tests and want to test your updates, edit `almalinux8-katello-bats-ci` to include:

```yaml
ansible:
Expand All @@ -41,7 +41,7 @@ ansible:
bats_update_forklift: "no"
```
Or if you want to run bats from a different repository or branch, edit `centos7-katello-bats-ci` to include:
Or if you want to run bats from a different repository or branch, edit `almalinux8-katello-bats-ci` to include:

```yaml
ansible:
Expand Down Expand Up @@ -79,18 +79,18 @@ When you are finished with the test, you can tear down the associated infrastruc
### Existing Pipelines

* `install_pipeline` - Installs a Server and a Proxy VMs and runs the `foreman_testing` role to verify the setup.
Expects the `pipeline_os` variable to be set to a known OS (currently: centos7, debian10)
Expects the `pipeline_os` variable to be set to a known OS (currently: centos9-stream, debian10)
Expects the `pipeline_type` variable to be set to a known type (currently: foreman, katello, luna)
Expects the `pipeline_version` variable to be set to a known version (currently: 3.8, 3.9, 3.10, 3.11, nightly)
* `upgrade_pipeline` - Installs a VM, upgrades it twice and runs the `foreman_testing` role to verify the final upgrade.
Expects the `pipeline_os` variable to be set to a known OS (currently: centos7, debian10)
Expects the `pipeline_os` variable to be set to a known OS (currently: centos9-stream, debian10)
Expects the `pipeline_type` variable to be set to a known type (currently: foreman, katello, luna)
Expects the `pipeline_version` variable to be set to a known version (currently: 3.8, 3.9, 3.10, 3.11, nightly).

#### Examples

ansible-playbook pipelines/install_pipeline.yml -e forklift_state=up -e pipeline_os=debian10 -e pipeline_type=foreman -e pipeline_version=nightly
ansible-playbook pipelines/upgrade_pipeline.yml -e forklift_state=up -e pipeline_os=centos7 -e pipeline_type=katello -e pipeline_version=3.10
ansible-playbook pipelines/upgrade_pipeline.yml -e forklift_state=up -e pipeline_os=centos9-stream -e pipeline_type=katello -e pipeline_version=3.10

### Creating Pipelines

Expand All @@ -102,11 +102,11 @@ For Katello 3.11, you'd be adding the following two files:
```yaml
forklift_name: pipeline-katello-3.11
forklift_boxes:
pipeline-katello-3.11-centos7:
box: centos7
pipeline-katello-3.11-centos9:
box: centos9-stream
memory: 8192
pipeline-proxy-3.11-centos7:
box: centos7
pipeline-proxy-3.11-centos9:
box: centos9-stream
memory: 3072
katello_repositories_version: '3.11'
foreman_repositories_version: '1.21'
Expand Down
42 changes: 21 additions & 21 deletions packer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ You can install packer using [the steps in their documentation](http://packer.io

From this directory, use `packer build` followed by the json packer template to create an image

For example: `packer build centos7-katello-devel-stable.json`
For example: `packer build almalinux8-katello-devel-stable.json`

You can create a box image using the above command and then add that box to vagrant:

```
vagrant box add --name centos7-katello-devel-stable centos7-katello-devel-stable.box
vagrant box add --name almalinux8-katello-devel-stable almalinux8-katello-devel-stable.box
```

Then you can use it in a box definition. For the box built with `centos7-katello-devel-stable.json`, you will need to use the stable hostname.
Then you can use it in a box definition. For the box built with `almalinux8-katello-devel-stable.json`, you will need to use the stable hostname.

```
centos7-katello-devel-stable:
box_name: centos7-katello-devel-stable
hostname: centos7-katello-devel-stable.example.com
almalinux8-katello-devel-stable:
box_name: almalinux8-katello-devel-stable
hostname: almalinux8-katello-devel-stable.example.com
```

You can then `vagrant up centos7-katello-devel-stable`
You can then `vagrant up almalinux8-katello-devel-stable`


If you want to completely remove the box, be sure to remove from both vagrant and virsh. This can be helpful if you have built a new packer box image and want to use it.

```
vagrant box remove centos7-katello-devel-stable
sudo virsh vol-delete --pool default centos7-katello-devel-stable_vagrant_box_image_0.img
vagrant box remove almalinux8-katello-devel-stable
sudo virsh vol-delete --pool default almalinux8-katello-devel-stable_vagrant_box_image_0.img
```

## Creating version specific Katello devel boxes
Expand All @@ -46,30 +46,30 @@ To create a version specific dev box, follow the directions above to install pac
cd ./forklift/packer
```

and run this comand (replacing 3.18 with the correct version):
and run this comand (replacing 4.13 with the correct version):

```
./scripts/build_stable_dev_box.rb 3.18
./scripts/build_stable_dev_box.rb 4.13
```

To test the newly created box:
1. add the printed box definition to vagrant/boxes.d/99-local.yaml
2. run printed 'vagrant box add' command
3. vagrant up centos7-katello-3.18-stable
3. vagrant up centos9-stream-katello-4.13-stable
4. Verify that 'rpm -q katello-repos' is correct and the foreman and katello git repos are on the correct branches

## Uploading a versioned box to Vagrant Cloud

The version of Vagrant shipped with Fedora does not support Vagrant Cloud uploads (due to a library licensing issue):

1. Deploy a Centos 7 VM (vagrant up centos7)
1. Deploy a Centos 7 VM (vagrant up centos9)
2. Install latest vagrant from: https://www.vagrantup.com/docs/installation
3. scp the .box file over to the centos 7 vm
4. Run 'vagrant login' and login with your credentials
3. scp the .box file over to the centos 9 vm
4. Run 'vagrant login' and login with your credentials
5. Ensure you are an owner of the katello organization in vagrant cloud
6. Use the command from the build_stable_dev_box.rb output to publish the box, it will look like:
```
vagrant cloud publish -d "katello-devel 3.18" -s "katello-devel 3.18" katello/katello-devel 3.18.0 libvirt centos7-katello-3.18-stable.box
vagrant cloud publish -d "katello-devel 4.13" -s "katello-devel 4.13" katello/katello-devel 4.13.0 libvirt centos9-stream-katello-4.13-stable.box
```

NOTE: YOU WILL GET AN ERROR, BUT THE UPLOAD WILL ACTUALLY WORK. This only happens during large box uploads to vagrant cloud. The error will look like:
Expand All @@ -90,17 +90,17 @@ Empty reply from server

Within your local vagrant boxes file, add:
```
centos7-katello-3.18-stable:
centos9-stream-katello-4.13-stable:
box_name: katello/katello-devel
box_version: 3.18.0
box_version: 4.13.0
```

changing 3.18.0 to the version you desire. Then:
changing 4.13.0 to the version you desire. Then:

```
vagrant up centos7-katello-3.18-stable
vagrant up centos9-stream-katello-4.13-stable
```

## Vagrant cloud usage

The centos7-katello-devel-stable box is [published to Vagrant cloud](https://app.vagrantup.com/katello/boxes/katello-devel) on a nightly basis to ensure an image with the latest changes is available. This box is only published if the Katello install is successful.
The centos9-katello-devel-stable box is [published to Vagrant cloud](https://app.vagrantup.com/katello/boxes/katello-devel) on a nightly basis to ensure an image with the latest changes is available. This box is only published if the Katello install is successful.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"packer_hostname": "centos7-katello-devel-stable",
"packer_hostname": "almalinux8-katello-devel-stable",
"password": "vagrant",
"user": "vagrant",
"ansible_variables": "{}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"variables": {
"user": "vagrant",
"password": "vagrant",
"packer_hostname": "centos7-katello-nightly-stable.example.com"
"packer_hostname": "centos9-katello-nightly-stable.example.com"
},

"builders":
[
{
"name": "centos7-katello-nightly-stable",
"name": "centos9-katello-nightly-stable",
"type": "qemu",
"format": "qcow2",
"accelerator": "kvm",
Expand Down Expand Up @@ -54,7 +54,7 @@
{
"type": "vagrant",
"keep_input_artifact": false,
"output": "centos7-katello-nightly-stable.box"
"output": "centos9-katello-nightly-stable.box"
}
]
}
2 changes: 1 addition & 1 deletion packer/http/ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cdrom
lang en_US.UTF-8
keyboard us
unsupported_hardware
network --bootproto=dhcp --device=eth0 --onboot=on --hostname=centos7-katello-devel-stable.example.com
network --bootproto=dhcp --device=eth0 --onboot=on --hostname=almalinux8-katello-devel-stable.example.com
rootpw vagrant
firewall --disabled
selinux --permissive
Expand Down
Loading

0 comments on commit af4859d

Please sign in to comment.