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

If pg_hostname is defined don't try to upgrade PostgreSQL #5398

Merged
merged 1 commit into from
Apr 27, 2020

Conversation

dvaerum
Copy link

@dvaerum dvaerum commented Nov 26, 2019

SUMMARY

If you have defined the variable pg_hostname it means that you are using Postgres DB apart from this ansible playbook and therefore most of these tasks should only be run if "pg_hostname is not defined"

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • Installer (local_docker)
AWX VERSION
8.0.0+
ADDITIONAL INFORMATION

We are using an external Postgres DB and because of this we then to skip the task for the Postgres upgrade migration

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@dvaerum
Copy link
Author

dvaerum commented Jan 9, 2020

Hey @shanemcd, will you review it again?

@dvaerum dvaerum requested a review from shanemcd March 5, 2020 11:55

- name: Copy old pg_hba.conf
copy:
src: "{{ postgres_data_dir + '/pgdata/pg_hba.conf' }}"
dest: "{{ postgres_data_dir + '/10/data/' }}"
when: upgrade_postgres | bool
when: when:
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a syntax error.

@shanemcd
Copy link
Member

shanemcd commented Mar 5, 2020

Rather than adding pg_hostname is not defined everywhere, maybe we should wrap everything in a block, or move these tasks out into another file and import/include that?

@shanemcd
Copy link
Member

shanemcd commented Mar 5, 2020

Looks like we'll also need a rebase on this PR.

@dvaerum dvaerum force-pushed the patch-1 branch 2 times, most recently from 8135ae5 to b547bf5 Compare April 11, 2020 23:50
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@dvaerum
Copy link
Author

dvaerum commented Apr 12, 2020

Hey @shanemcd, I finally had time to look at it again and you are right regarding having pg_hostname is not defined everywhere, that was not the best solution, so I have taken all the tasks there have to do with upgrading postgresql and put them into its own task-file and added a include in main.yml with 2 conditions

- import_tasks: upgrade_postgres.yml
  when:
    - postgres_data_dir is defined
    - pg_hostname is not defined

Btw, I can see that one of the tests failed, but I cannot figure out why. Do you know?
https://ansible.softwarefactory-project.io/zuul/build/a3e84460cf8947f99d6c284e5aea7db2

@dvaerum dvaerum requested a review from shanemcd April 12, 2020 00:55
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

Copy link
Member

@shanemcd shanemcd left a comment

Choose a reason for hiding this comment

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

Thanks for following up on this. Looks great.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit e5bdd44 into ansible:devel Apr 27, 2020
AlanCoding pushed a commit to AlanCoding/awx that referenced this pull request Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants