]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
chacra-pull-requests: fix postgresql installs for trusty and xenial 640/head
authorAndrew Schoen <aschoen@redhat.com>
Wed, 22 Feb 2017 18:07:40 +0000 (12:07 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 23 Feb 2017 17:51:43 +0000 (11:51 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
chacra-pull-requests/setup/playbooks/tasks/postgresql.yml

index d2305f4abc29f5dc7f0adef19b097d7b33cec481..ee9938e799924efd19c1dc0ebe4da09723340641 100644 (file)
@@ -4,6 +4,16 @@
     update_cache: yes
   sudo: yes
 
+- name: set postgresql version on trusty
+  set_fact:
+      postgresql_version: "9.3"
+  when: ansible_distribution_release == "trusty"
+
+- name: set postgresql version on xenial
+  set_fact:
+      postgresql_version: "9.5"
+  when: ansible_distribution_release == "xenial"
+
 - name: install postgresql requirements
   sudo: yes
   apt:
@@ -13,7 +23,7 @@
     - postgresql
     - postgresql-common
     - postgresql-contrib
-    - postgresql-server-dev-9.3
+    - "postgresql-server-dev-{{ postgresql_version }}"
     - python-psycopg2
   tags:
     - packages
 - name: allow users to connect locally
   sudo: yes
   lineinfile:
-     # TODO: should not hardcode that version
-     # 9.3 is available on trusty, 9.5 on Xenial
-     dest: /etc/postgresql/9.3/main/pg_hba.conf
-     regexp: '^host\s+all\s+all\s+127.0.0.1/32'
-     line: 'host    all             all             127.0.0.1/32            trust'
-     backrefs: yes
+     dest: "/etc/postgresql/{{ postgresql_version }}/main/pg_hba.conf"
+     # allow all ipv4 local connections without a password
+     line: 'host    all             all             0.0.0.0/0            trust'
   register: pg_hba_conf
 
 - name: make jenkins-build user