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

Update Zathras installer #129

Merged
merged 7 commits into from
Dec 17, 2024
Merged

Update Zathras installer #129

merged 7 commits into from
Dec 17, 2024

Conversation

grdumas
Copy link
Contributor

@grdumas grdumas commented Nov 18, 2024

The merges in this pull request 1) installs the Ansible AWS collection and 2) freezes the terraform package to version 1.9.8-1.

@grdumas grdumas added the enhancement New feature or request label Nov 18, 2024
@grdumas grdumas requested review from kdvalin and dvalinrh November 18, 2024 18:16
@grdumas grdumas self-assigned this Nov 18, 2024
@grdumas grdumas requested a review from frival November 18, 2024 18:17
bin/install.sh Outdated Show resolved Hide resolved
bin/install.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@frival frival left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggesting adding error detection, but perhaps you want that as a separate PR - I'll leave that to you.

@grdumas
Copy link
Contributor Author

grdumas commented Dec 12, 2024

Description

This PR fixes #131 by adding the ansible-galaxy installation of amazon.aws to the installation process.

Per reviewer request, error handling has been added to the script via set -eu and the use of exit conditions.

Before/After Comparison

Package installation: no error handling

[root@localhost ~]# ./zathras/bin/install.sh
For most use cases, running this script as root is NOT recommended. Are you sure? Y/Ny
You answered yes, continuing install as root.
package ansible-core is not installed and not available.
git is installed.
jq is installed.
package python is not installed and not available.
package python3-pip is not installed and not available.
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use "rhc" or "subscription-manager" to register.

Adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
Updating Subscription Management repositories.
Unable to read consumer identity
...

Package installation with error handling:

[root@localhost ~]# ./zathras/bin/install.sh
For most use cases, running this script as root is NOT recommended. Are you sure? Y/Ny
You answered yes, continuing install as root.
Installing ansible-core...
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use "rhc" or "subscription-manager" to register.

Error: There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d".

pip3 package installation: no error handling

[root@localhost ~]# ./test_pip_install.sh 
ERROR: Could not find a version that satisfies the requirement dfshjksdfhsd (from versions: none)
ERROR: No matching distribution found for dfshjksdfhsd
Collecting boto
  Using cached boto-2.49.0-py2.py3-none-any.whl (1.4 MB)
Installing collected packages: boto
Successfully installed boto-2.49.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

pip3 package installation with error handling:

[root@localhost ~]# ./test_pip_install.sh 
ERROR: Could not find a version that satisfies the requirement dfshjksdfhsd (from versions: none)
ERROR: No matching distribution found for dfshjksdfhsd

ansible collection installation: no error handling

[root@localhost ~]# ./test_ansible_install.sh 
ERROR! Neither the collection requirement entry key 'name', nor 'source' point to a concrete resolvable collection artifact. Also 'name' is not an FQCN. A valid collection name must be in the format <namespace>.<collection>. Please make sure that the namespace and the collection name contain characters from [a-zA-Z0-9_] only.

Could not find jhfkadsjfask.
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/amazon-aws-9.1.0.tar.gz to /root/.ansible/tmp/ansible-local-36272ie1mzeel/tmpk4_vo5ev/amazon-aws-9.1.0-eri6n6f4
Installing 'amazon.aws:9.1.0' to '/root/.ansible/collections/ansible_collections/amazon/aws'
amazon.aws:9.1.0 was installed successfully
[root@localhost ~]#

ansible collection installation with error handling:

[root@localhost ~]# ./test_ansible_install.sh 
ERROR! Neither the collection requirement entry key 'name', nor 'source' point to a concrete resolvable collection artifact. Also 'name' is not an FQCN. A valid collection name must be in the format <namespace>.<collection>. Please make sure that the namespace and the collection name contain characters from [a-zA-Z0-9_] only.

Could not find jhfkadsjfask.

Clerical Stuff

Relates to JIRA: RPOPC-279

@grdumas grdumas requested a review from frival December 12, 2024 22:40
@grdumas grdumas merged commit 733b196 into main Dec 17, 2024
@grdumas grdumas deleted the installer-update branch December 17, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants