-
Notifications
You must be signed in to change notification settings - Fork 130
End User Installation
The following provides instructions for installing GalaxyNG on a virtual machine, with an example playbook that installs Pulp and Galaxy NG from PyPi packages. If you wish to install and test from source code, see Installing from source.
Future iterations will include support for installing from RPMs and installing to Kubernetes and OpenShift.
You will be using the Pulp Installer to complete the installation, so please review the requirements at the Pulp Installer project.
-
Clone the Pulp Installer project:
git clone https://github.com/pulp/pulp_installer.git
-
Clone the gist containing Ansible playbooks and variable files needed to complete the install into a directory called
example
:git clone https://gist.github.com/629ba52d68301cc9798227b87704df84.git example
-
Set your working directory to the
pulp_installer
directory. -
Copy the playbooks and variable files from the
example
directory intopulp_installer
directory:cp ../example/* .
-
Within the variable file
enduser-install-vars.yml
change the value ofpulp_default_admin_password
(initial password for the Pulp admin user). -
Install Ansible role dependencies by running the following commands to download roles from Community Galaxy:
$ ansible-galaxy install -r requirements.yml
$ ansible-galaxy install chouseknecht.ansible_galaxy_config
-
Run the
enduser-install.yml
playbookThe following provides an example of how to start playbook execution. It assumes an inventory file called
hosts
exists in the current directory and contains the target host(s) where Galaxy server is to be installed:$ ansible-playbook enduser-install.yml -i hosts --extra-vars "@enduser-install-vars.yml"
For more information about inventory files, view Intro to Ansible Inventory
By default the local Galaxy NG server is listening on port 80. Point your browser to the host where the server was installed, and a login page will be presented. For example, point your browser to http://127.0.0.1
.
In the login dialog, use "admin" as the username, and the password supplied in your playbook. This is the value of "pulp_default_admin_password".
Once logged in, you will be taken to the Collections page, and presented with an empty list. Since the server was just installed, and the database is empty, there are no collections to display.
NOTE
If you need an example collection, we suggest downloading this demo collection from Community Galaxy. Click the Download tarball link, and save it to your local file system. As you follow the steps in the Create a namespace section below, use newswangerd for the namespace name.
To publish a collection to the server, you will first need a namespace. Create a new namespace using the following steps:
- Click on the Namespaces menu.
- Click the Create button at the top of the page.
- In the resulting dialog, enter a value for the Name. The value you enter must match the namespace value in the collection archive metadata that you will be publishing.
- Leave the Namespace Owners field blank.
- Click the Create button.
With the new namespace created, you will be taken to a page showing the collections available in the namespace. To publish the first collection, click on the Upload collection button in the top-right corner of the page. Using the dialog, choose the collection archive file from the local file system.
The collection archive will upload, and an import job will be started. You will be taken to the My Imports page where you can view the job output as it runs. During the import process the server analyzes the archive metadata, unpacks the archive, and analyzes the content.
View the new collection by clicking on the Collections menu option. The Collections page now contains a clickable tile for the newly published collection.
With Ansible installed, you can publish a collection to the Galaxy server using the ansible-galaxy
command. Below are the steps to follow:
-
If you have not already done so, log into the Galaxy server using your web browser and create a namespace as described above.
-
Click on the API Token menu, and click Load Token button. You will copy and paste the token value into an
ansible.cfg
file in the next step. -
In the same directory as the collection archive file, create an
ansible.cfg
file that contains the following, setting the correct server name or IP address in the url value, and setting the token value to the token displayed in step 2 above:[galaxy] server_list = local_server [galaxy_server.local_server] url=http://localhost/api/galaxy/ token=your-token-here
-
In the directory containing your collection archive and
ansible.cfg
file, run the publish command. The following shows an example:$ ansible-galaxy collection publish newswangerd-collection_demo-1.0.10.tar.gz Publishing collection artifact 'newswangerd-collection_demo-1.0.10.tar.gz' to local_server http://localhost/api/galaxy/ Collection has been published to the Galaxy server local_server http://localhost/api/galaxy/ Waiting until Galaxy import task http://localhost/api/galaxy/v3/imports/collections/b8155faf-e6af-4873-9cf0-ce4c8b30e166/ has completed Collection has been successfully published and imported to the Galaxy server local_server http://localhost/api/galaxy/
The process that imports collections into Galaxy is the galaxy-importer. During installation a packaged version of galaxy-importer is installed from PyPi.
On the Galaxy server host, run the following to see which is installed:
$ source /usr/local/lib/pulp/bin/activate
$ pip list | grep galaxy-importer
To run the latest code, or to test a pull request or an experimental branch, it might be desirable to use the source project directly.
On the Galaxy server host, clone the project. Make sure to put it in a directory that the pulp
user can access, and set the ownership to pulp:users
. For example, as the root user:
# cd /usr/local/lib/pulp
# git clone [email protected]:ansible/galaxy-importer.git
# chown -R pulp:users galaxy-importer
As the root user, run the following to install the source copy and replace the packaged version:
# source /usr/local/lib/pulp/bin/activate
# cd /usr/local/lib/pulp/galaxy-importer
# pip install --upgrade -e .
Restart the Pulp services:
# systemctl restart pulp*
As the root user, create the directory /etc/galaxy-importer
, and within this directory create the file galaxy-importer.cfg
. The following is a sample configuration file:
[galaxy-importer]
LOG_LEVEL_MAIN = INFO
RUN_FLAKE8 = False
RUN_ANSIBLE_TEST = False
INFRA_OSD = False
If you wish to run ansible-test
during collection import, set RUN_ANSIBLE_TEST = True
. By default ansible-test
will be executed directly, which requires having Ansible installed. It's also possible to run ansible-test
sandboxed in a container image using the following options:
- INFRA_LOCAL_IMAGE - Set to
True
, ifansible-test
should be executed in a container image. Requires having either Docker or Podman installed. Defaults toFalse
. - INFRA_LOCAL_DOCKER - Set to
True
, if the Docker container runtime should be used; otherwise, Podman will be used. Defaults toFalse
.
Changing the configuration does not require restarting Pulp services. Each time the importer runs, it reads the configuration and responds accordingly.
Sponsored by Red Hat, Inc.