Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centos7 and centos8 name update #1832

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,24 @@ When this is complete, simply follow the next section of this README to try out
Spin up your box and start using the latest nightly build of Foreman:

```sh
vagrant up centos8-stream-foreman-nightly
vagrant up centos9-stream-foreman-nightly
```

Access the CLI by first connecting to the box via SSH:

```sh
vagrant ssh centos8-stream-foreman-nightly
vagrant ssh centos9-stream-foreman-nightly
```

To access the WebUI, it's helpful to have the vagrant-hostmanager plugin installed, so that your Workstation will automatically be able to resolve the hostname of the box to its IP address.

Then you can simply open your browser and navigate to `https://centos8-stream-foreman-nightly.<HOSTNAME>.example.com` where `<HOSTNAME>` is replaced by the shortname of your workstation. The first time you do this you will need to accept the self-signed certicate.
Then you can simply open your browser and navigate to `https://centos9-stream-foreman-nightly.<HOSTNAME>.example.com` where `<HOSTNAME>` is replaced by the shortname of your workstation. The first time you do this you will need to accept the self-signed certicate.

By default, `forklift` deploys Foreman with `admin`/`changeme` as username and password.

### Katello Nightly Box

Katello nightly boxes are available as well; simply change `centos8-stream-foreman-nightly` to `centos8-stream-katello-nightly` and the steps are otherwise exactly the same as above.
Katello nightly boxes are available as well; simply change `centos9-stream-foreman-nightly` to `centos9-stream-katello-nightly` and the steps are otherwise exactly the same as above.

### Additional Documentation

Expand All @@ -104,7 +104,7 @@ sed -i "s/<REPLACE ME>/GITHUB_NICK/g" vagrant/boxes.d/99-local.yaml
Bring up the Katello Development Box:

```sh
vagrant up centos8-katello-devel
vagrant up centos9-katello-devel
```

Once the box is running, you can access the shell via SSH and modify the source code in the `~/foreman` and `~/katello` directories. Then start the application to preview your changes:
Expand All @@ -114,9 +114,9 @@ cd ~/foreman
bundle exec foreman start
```

Before you can access the WebUI, you must first accept the self-signed certificate on port 3808 by visiting `https://centos8-katello-devel.<HOSTNAME>.example.com:3808` in your browser.
Before you can access the WebUI, you must first accept the self-signed certificate on port 3808 by visiting `https://centos9-katello-devel.<HOSTNAME>.example.com:3808` in your browser.

Then, navigate to `https://centos8-katello-devel.<HOSTNAME>.example.com/` to access the WebUI and preview your changes.
Then, navigate to `https://centos9-katello-devel.<HOSTNAME>.example.com/` to access the WebUI and preview your changes.

As above, `<HOSTNAME>` refers to the shortname of your hypervisor.

Expand Down Expand Up @@ -174,11 +174,11 @@ hostmanager_ip_resolver_device: 'eth1'

### Adding Custom Boxes

Sometimes you want to spin up the same box type (e.g. centos8-katello-devel) from within the forklift directory. While this can be added to the Vagrantfile directly, updates to the forklift repository could wipe out your local changes. To help with this, you can define a custom box re-using the configuration within the Vagrantfile. To do so, create a `99-local.yaml` file in vagrant/boxes.d/. For example, to create a custom box on CentOS 8 Stream with nightly and run the installers reset command:
Sometimes you want to spin up the same box type (e.g. centos9-katello-devel) from within the forklift directory. While this can be added to the Vagrantfile directly, updates to the forklift repository could wipe out your local changes. To help with this, you can define a custom box re-using the configuration within the Vagrantfile. To do so, create a `99-local.yaml` file in vagrant/boxes.d/. For example, to create a custom box on CentOS 9 Stream with nightly and run the installers reset command:

```yaml
my-nightly-staging:
box: centos8-stream
box: centos9-stream
ansible:
playbook: playbooks/katello.yml
variables:
Expand Down Expand Up @@ -225,7 +225,7 @@ Example with custom networking, static IP on custom libvirt network:

```yaml
static:
box: centos8
box: centos9
hostname: mystatic.box.com
networks:
- type: 'private_network'
Expand All @@ -239,7 +239,7 @@ Example with custom libvirt management network:

```yaml
static:
box: centos8
box: centos9
hostname: mystatic.box.com
libvirt_options:
management_network_address: 172.23.99.0/24
Expand All @@ -251,8 +251,8 @@ Do not forget to set openstack API credentials.
To use openstack provider as default look [here](https://www.vagrantup.com/docs/providers/default.html).

```yaml
openstack-centos8:
image_name: 'Centos8'
openstack-centos9:
image_name: 'Centos9'
username: 'centos' #root by default
hostname: 'john-doe'
openstack_flavor: 'm1.medium'
Expand All @@ -266,7 +266,7 @@ Example with sshfs mounting folder from guest to host:

```yaml
with-sshfs:
box: centos8
box: centos9-stream
sshfs:
host_path: '/some/host/path'
guest_path: '/some/guest/path'
Expand All @@ -279,7 +279,7 @@ Additonal options may be specified with using `options`.

```yaml
with-sshfs-options:
box: centos8
box: centos9-stream
sshfs:
host_path: '/some/host/path'
guest_path: '/some/guest/path'
Expand All @@ -290,7 +290,7 @@ Example with an additional disk (libvirt volume) presented as /dev/vdb in the vm

```yaml
static:
box: centos8
box: centos9-stream
hostname: mystatic.box.com
add_disks:
- size: 100GiB
Expand All @@ -306,7 +306,7 @@ Then create your box:

```yaml
with-nfs:
box: centos8
box: centos9-stream
nfs:
host_path: '/some/host/path'
guest_path: '/some/guest/path'
Expand Down 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" # exclude any box that starts with "centos9"
- "foreman-1\\.(?:[2][0-3])" # exclude any foreman-1.20 to foreman-1.23 version box
```

Expand All @@ -347,7 +347,7 @@ Ansible roles may also be installed directly using the [`ansible-galaxy` command

```yaml
ansible:
box: centos8-stream-katello-nightly
box: centos9-stream-katello-nightly
ansible:
playbook:
- 'user_playbooks/vim.yml'
Expand Down
48 changes: 24 additions & 24 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ A Katello development environment can be deployed on CentOS 7. Ensure that you h
For example, if I wanted my upstream remotes to be origin and to install the remote execution and discovery plugins:

```yaml
centos8-katello-devel:
box: centos8-stream
centos9-katello-devel:
box: centos9-stream
ansible:
playbook: 'playbooks/katello_devel.yml'
group: 'devel'
Expand All @@ -52,13 +52,13 @@ centos8-katello-devel:
Lastly, spin up the box:

```
vagrant up centos8-katello-devel
vagrant up centos9-katello-devel
```

The box can now be accessed via ssh and the Rails server started directly (this assumes you are connecting as the default `vagrant` user):

```sh
vagrant ssh centos8-katello-devel
vagrant ssh centos9-katello-devel
cd foreman
bundle exec foreman start
```
Expand All @@ -67,9 +67,9 @@ bundle exec foreman start

When spinning up a Katello development environment locally, it can take a while to install and isn't always guaranteed to finish successfully. A stable Katello development environment was created to ensure an environment is always available to developers.

The Katello development stable box is named `centos8-katello-devel-stable`. Please see the [documentation on stable boxes](./stable_boxes.md) for more information on how to use this box.
The Katello development stable box is named `centos9-katello-devel-stable`. Please see the [documentation on stable boxes](./stable_boxes.md) for more information on how to use this box.

After spinning up `centos8-katello-devel-stable`, it's a good idea to pull the latest git branches and update gems and npm packages after spinning up a stable box. If a stable box image hasn't been published in a while, these can be out-of-date.
After spinning up `centos9-katello-devel-stable`, it's a good idea to pull the latest git branches and update gems and npm packages after spinning up a stable box. If a stable box image hasn't been published in a while, these can be out-of-date.

At this moment, you will have to manually configure any personal customizations such as github remotes.

Expand All @@ -80,12 +80,12 @@ Our backend requires a rails server to be running. We also use a webpack server
The files that webpack handles are located in `webpack/` directory found in Foreman, Katello,
and plugin root directories. If you are editing any files in `webpack/` and want to have your changes refresh automatically, you will need a webpack server running.

Because we are using a webpack server in conjunction with a rails server, there are different ways of starting a server depending on your needs and preferences. The following are instructions for starting the server using a base `centos8-katello-devel` box as a starting point.
Because we are using a webpack server in conjunction with a rails server, there are different ways of starting a server depending on your needs and preferences. The following are instructions for starting the server using a base `centos9-katello-devel` box as a starting point.

#### Run a rails and webpack server together using `foreman start`
- Run `bundle exec foreman start` in `~/foreman`
- Navigate to `https://centos8-katello-devel.<hostname>.example.com/` where `<hostname>` is the shortname of your hypervisor (machine your VM is running on) and accept the self-signed certs.
- Accept the self-signed certs on port 3808 at `https://centos8-katello-devel.<hostname>.example.com:3808`.
- Navigate to `https://centos9-katello-devel.<hostname>.example.com/` where `<hostname>` is the shortname of your hypervisor (machine your VM is running on) and accept the self-signed certs.
- Accept the self-signed certs on port 3808 at `https://centos9-katello-devel.<hostname>.example.com:3808`.
- Everything should be set for you to run `bundle exec foreman start` to start your dev server as needed.

NOTE: The `foreman` in `foreman start` is actually [this gem](https://github.com/ddollar/foreman) and not our `foreman`. It
Expand All @@ -108,12 +108,12 @@ in your boxes.yaml entry to configure this on box creation.

#### Custom files from git repo

A git repo's contents can be copied to the target user's home directory when spinning up a `centos8-katello-devel` or `centos8-katello-devel-stable` box. This can be done by specifying the `customize_home_git_repo` ansible variable. For example:
A git repo's contents can be copied to the target user's home directory when spinning up a `centos9-katello-devel` or `centos9-katello-devel-stable` box. This can be done by specifying the `customize_home_git_repo` ansible variable. For example:

```
centos8-katello-devel-stable:
centos9-katello-devel-stable:
box_name: katello/katello-devel
hostname: centos8-katello-devel-stable.example.com
hostname: centos9-katello-devel-stable.example.com
ansible:
playbook: 'playbooks/setup_user_devel_environment.yml'
variables:
Expand All @@ -132,7 +132,7 @@ mygitrepo

#### Custom local files

You can have files automatically copied over to the target user's home directory when spinning up a `centos8-katello-devel` or `centos8-katello-devel-stable` box. Here are the steps to specify custom files to be copied over:
You can have files automatically copied over to the target user's home directory when spinning up a `centos9-katello-devel` or `centos9-katello-devel-stable` box. Here are the steps to specify custom files to be copied over:

1. Create the directory `user_devel_env_files/` in Forklift's root directory.
2. Add any files you want to be copied over to your development box to `user_devel_env_files/`
Expand Down 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`
centos9-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 centos9-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,12 +299,12 @@ 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'
variables:
katello_client_server: 'centos8-katello-devel'
katello_client_server: 'centos9-katello-devel'
katello_client_organization: 'Default_Organization'
katello_client_environment: 'Library'
katello_client_username: 'admin'
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 centos9-dynflow-devel
evgeni marked this conversation as resolved.
Show resolved Hide resolved
```

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 `centos9-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 `centos9-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 centos9-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-stream:
box_name: 'centos/stream9'
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
Loading