Skip to content

Conversation

@gclough
Copy link
Collaborator

@gclough gclough commented Apr 26, 2018

A general tidy up of the install section, and some variable renames.

Greg Clough and others added 30 commits April 3, 2018 23:58
…rvices during boot instead of having extra tasks. I removed them since they are not necessary.
* Increse the travis test coverage to include popular options

* Fixed a missing quote...

* Fixed syntax for options, and make postgis.yml RedHat compatible... ish

* Looks like pgtune won't install either, as the epel repo isn't in the docker image.  Taking it out too..

* Changing parameters to be in JSON format, for consumption on the command line

* Adding a space to trigger a travis build

* Remove the space, as travis didn't build anyway... :-/

* Debugging... why don't travis kick in...

* Revert travis changes, to try and get it to trigger

* Fixed typo in JSON parameters

* Removed travis updates, and put parameters into postgresql.yml

* Squashing all commits.  Increases travis coverage, but not all are enabled yet. Other pull requests need to be merged first, as the tests for them fail.
…", which I suspect

is a more reliable method.
…NXS#267)

* Extended and adapted to install PostgreSQL 10 for CentOS and Ubuntu

Tested with ansible 2.4.1 for Ubuntu 16.04 and CentOS-7.4

- replaced deprecated 'include:' by 'include_tasks:' for ansible 2.4.1
- added config and config template for postgresql 10
- adapted defaults.yml
- adapted templates/etc_systemd_system_postgresql.service.d_custom.conf.j2
  for PostgreSQL 10 the template outputs the wrong line:
	ExecStartPre=/usr/pgsql-10/bin/postgresql10-check-db-dir
  the correct one must include an additional '-':
	ExecStartPre=/usr/pgsql-10/bin/postgresql-10-check-db-dir

* Removed tabs from defaults/main.yml.

* Adapted .travis.yml and yml files to run tests successfully for all given ansible versions.

- added a test for ansible 2.4.2.0/posgresql 10.

- replaced newer 'include_task' by 'include' again so that the role can be used with older
  ansible versions. NOTE: 'include' is deprecated and will be removed in ansible 2.8.

- commeted out docker based tests because they do not run successfully and I do not know
  docker ;-)

* Bug fix. Removed remains for my local teste in test/playbook.yml.

* Bug fix and refinement for postgresql.conf-10.* .

- added max_parallel_workers to postgresql.conf-10.j2 (forgotten/deleted in previous version)
- hard coded value for wal_retrieve_retry_interval in postgresql.conf-10.j2 replaced by ansible variable

Changes to be committed:
	modified:   Vagrantfile
	modified:   defaults/main.yml
	modified:   templates/postgresql.conf-10.j2
	modified:   vagrant-inventory

* Added suggestions from gclough.

 Changes to be committed:
	modified:   Vagrantfile
	modified:   defaults/main.yml
	modified:   templates/HOWTO.postgresql.conf
	modified:   templates/etc_systemd_system_postgresql.service.d_custom.conf.j2
	modified:   tests/playbook.yml
	modified:   tests/vars.yml
	modified:   vagrant-inventory

* Replaced vagrant setup by project's master branch.

* Updated tests/docker/group_vars/all.yml to include version 10.

* Uncommented 'no_log: true' in users.yml.

* Uncommented user baz in tests/docker/group_vars/postgresql.yml.

* Recreated user baz but without passwd. We need him as database owner :-).

* Added encrypted passwd for user baz.

* Commented need for encrypted password if version >= 10.

* Reenabled no_log: true for task  PostgreSQL | Make sure the PostgreSQL users are present
Fixed text in templates/HOWTO.posgresql.conf

* Just to trigger a new build on github. Added blank in README.md.

* Second try to trigger a rebuild. Blank in README.md deleted.
* Adding future scope for v10 (already out), and v11 (Sep/18)

* Fixed "CentOS" spelling, and put a request for help
ANXS#330)

* Updated README to show v10 support, added top 10 contributors, and linked to defaults/main.yml

* Fixed typo in contributors

* Reload conf parameters after install, so that pg_hba.conf is re-read
Conflicts:
	handlers/main.yml
	tasks/extensions/postgis.yml
	tasks/install_yum.yml
@gclough gclough force-pushed the rpm_variable_name_change_to_340 branch 2 times, most recently from 7b246a4 to 19fa484 Compare April 26, 2018 10:29
@gclough
Copy link
Collaborator Author

gclough commented Apr 26, 2018

@jlozadad , I've made some variable name changes that I proposed in the comments of #340, but I've also done a little tidy up of the install section, making changes to the recent Fedora support you added.

Can you see if this makes sense to you?

@gclough gclough force-pushed the rpm_variable_name_change_to_340 branch from 5b58852 to 695bed0 Compare April 26, 2018 11:32
…variable_name_change_to_340

Conflicts:
	defaults/main.yml
	handlers/main.yml
	tasks/extensions/contrib.yml
	tasks/extensions/postgis.yml
	tasks/install.yml
	tasks/install_yum.yml
	tasks/main.yml
tasks/main.yml Outdated
tags: [postgresql, postgresql-install]

- import_tasks: install_yum.yml
when: ansible_pkg_mgr == "yum" and ansible_distribution == "RedHat"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add change to when: ansible_pkg_mgr == "yum" and ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
or just: when: ansible_pkg_mgr == "yum"

Copy link
Contributor

Choose a reason for hiding this comment

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

@nissessenap, @gclough or change to ansible_os_family == 'RedHat'

Copy link
Contributor

@nissessenap nissessenap left a comment

Choose a reason for hiding this comment

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

The tasks/main.yml needs to be updated, this will fix the centos jobs.

@gclough
Copy link
Collaborator Author

gclough commented Apr 26, 2018

@nissessenap , I never understood why the ansible_distribution was included, so I've removed them. All of the commands are apt/yum/dnf should work, as they test the package manager before including them.

@aoyawale
Copy link
Contributor

the reason ansible_distribution was included so that it picks up fedora properly. If you use the regular os_family* it will show as red hat and run install_yum. adding those vars in the main.yml prevents them from being ran on both since fedora still uses yum.

- name: PostgreSQL | Extensions | Make sure the postgis extensions are installed | RedHat
yum:
name: "{{ item }}"
name: "{{item}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

why would you change it back this way? that is even worse.

tags: [postgresql, postgresql-install]

- import_tasks: install_yum.yml
when: ansible_pkg_mgr == "yum" and ansible_distribution == "RedHat"
Copy link
Contributor

Choose a reason for hiding this comment

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

the reason this was changed this way is that if you use os_family* for fedora it would come back as a red hat OS and run install_yum.yml besides the obvious failure of postgres 9.3 for fedora, travis build all of this successfully and worked for the vagrant files. I added pkg_mgr and distribution so it picks it up the correct one. if you leave pkg_mgr == "yum" it will run on fedora too.

Copy link
Collaborator Author

@gclough gclough Apr 26, 2018

Choose a reason for hiding this comment

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

OK, so I've put those back in, and included CentOS too as @nissessenap pointed out.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gclough maybe better something like !(I dont remember right syntax for logical not) ansible_distribution == "Fedora"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or ansible_distribution != "Fedora"

Copy link
Collaborator Author

@gclough gclough Apr 26, 2018

Choose a reason for hiding this comment

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

I guess we can either take either approach:

  1. We only support RedHat and CentOS... so let's list them explicitly
  2. We want to be generic, so let's use a negative test

The current code uses option 1, but I'm happy enough to swap if that's the consensus. Would someone else like to do that, so spread the credit for this work?

(also, I can't seem to squash my commits without screwing everything up. I don't know why there are 43 commits in there!)

@gclough
Copy link
Collaborator Author

gclough commented Apr 26, 2018

This should fix the current broken-build problem, but it does more than just fix that. I don't think there's a mega-rush to fix the build, but if this could be reviewed and merged soon-ish, then that would put us in a good place IMHO.

Thanks @nissessenap, @jlozadad , and @UnderGreen for your input and help thus far. If you're capable of squashing the commits and doing so under your account, that would be good so someone else get credit too, right?

@aoyawale
Copy link
Contributor

looks like everything passed now.

@UnderGreen UnderGreen merged commit 2e0349a into ANXS:master Apr 26, 2018
@gclough gclough deleted the rpm_variable_name_change_to_340 branch April 26, 2018 19:40
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.

5 participants