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

Support PVC storage for containerized Ansible Tower running on OCP #590

Merged
merged 16 commits into from
Mar 17, 2021

Conversation

jfilipcz
Copy link
Contributor

What does this PR do?
This PR extends the already present config-ansible-tower-ocp role with cability of automatic deployment of PVC for PostgreSQL persistent storage.

How should this be tested?
Please see test directory for instructions and test inventory

Is there a relevant Issue open for this?
N/A

Other Relevant info, PRs, etc.
N/A

People to notify
cc: @redhat-cop/infra-ansible
@oybed

@jfilipcz jfilipcz marked this pull request as ready for review March 16, 2021 16:57
@@ -0,0 +1,52 @@
---
- block:
- name: Ensure user is authenticated with OCP
Copy link
Contributor

Choose a reason for hiding this comment

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

This step is already performed in the openshift_retrieve_token, so shouldn't be needed here - probably just remove this task(?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've moved the authentication part to a separate file, but in the case that only OCP token is provided we need to have a step for login. openshift_retrieve_token was only used when username and password was provided, it did not cover the token based authentication.

register: getProject
failed_when: false

- name: Creating target project..
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be a left-over, but there's one oc get project above and two oc new-project here - seems a bit redundant + not sure what this task actually does as it registers getProject over again.

Another couple of comments:

  • Probably doesn't make sense to have the project created inside of setup_pvc as that's a bit "hidden". Better idea would be to do so in the main.yml or a separate file for creating the project
  • What happens if the project already exists, but belongs to someone else? Probably will error out at some point. Is this something we should check for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, that was overlooked and it has been fixed, I've also changed the file structure to be a bit more clean and self-explanatory. I will also look into handling the the condition in which project has already been created by other user.

roles/ansible/tower/config-ansible-tower-ocp/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@oybed oybed left a comment

Choose a reason for hiding this comment

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

LGTM

@oybed oybed merged commit 8507990 into redhat-cop:main Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants