From: Andrew Schoen Date: Wed, 22 Feb 2017 18:07:40 +0000 (-0600) Subject: chacra-pull-requests: fix postgresql installs for trusty and xenial X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F640%2Fhead;p=ceph-build.git chacra-pull-requests: fix postgresql installs for trusty and xenial Signed-off-by: Andrew Schoen --- diff --git a/chacra-pull-requests/setup/playbooks/tasks/postgresql.yml b/chacra-pull-requests/setup/playbooks/tasks/postgresql.yml index d2305f4a..ee9938e7 100644 --- a/chacra-pull-requests/setup/playbooks/tasks/postgresql.yml +++ b/chacra-pull-requests/setup/playbooks/tasks/postgresql.yml @@ -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 @@ -28,12 +38,9 @@ - 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