From 2e7228a684326f1ba80ff1affd3c0df2ed09a821 Mon Sep 17 00:00:00 2001 From: Martin Verges Date: Mon, 20 Feb 2017 20:51:01 +0100 Subject: [PATCH 1/8] fixed install problems on debian with pinning enabled --- tasks/install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/install.yml b/tasks/install.yml index d689129c2..cb2383cb6 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -39,6 +39,7 @@ name: "{{item}}" state: present update_cache: yes + default_release: "{{ansible_distribution_release}}-pgdg" cache_valid_time: "{{apt_cache_valid_time | default (3600)}}" environment: "{{postgresql_env}}" with_items: From a2218ba3c95c9e0d77fe162762cf02308eeb62c9 Mon Sep 17 00:00:00 2001 From: Mauro Oviedo Date: Tue, 21 Feb 2017 12:39:43 -0500 Subject: [PATCH 2/8] Updated Vagrantfile to work with xenial64. --- Vagrantfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index f7e56b7ba..7b48f17e7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,7 +8,8 @@ Vagrant.configure('2') do |config| config.ssh.private_key_path = '~/.vagrant.d/insecure_private_key' config.vm.define 'anxs' do |machine| - machine.vm.box = "ubuntu/trusty64" + machine.vm.box = "ubuntu/xenial64" + #machine.vm.box = "ubuntu/trusty64" #machine.vm.box = "ubuntu/precise64" #machine.vm.box = "debian/jessie64" #machine.vm.box = "debian/wheezy64" @@ -17,6 +18,14 @@ Vagrant.configure('2') do |config| machine.vm.network :private_network, ip: '192.168.88.22' machine.vm.hostname = 'anxs.local' + + # Install python 2.7 to unbuntu 16.04 + if machine.vm.box == "ubuntu/xenial64" + machine.vm.provision "shell" do |s| + s.inline = "sudo apt-get install -y python-minimal" + end + end + machine.vm.provision 'ansible' do |ansible| ansible.playbook = 'tests/playbook.yml' ansible.sudo = true From 37bc398d14b1bdfe0f8c374579965379bd966831 Mon Sep 17 00:00:00 2001 From: Mauro Oviedo Date: Tue, 21 Feb 2017 15:25:00 -0500 Subject: [PATCH 3/8] Updated ubuntu/xenial64 VM image used for vagrant. --- Vagrantfile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 7b48f17e7..f3fdf87d2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,8 +8,8 @@ Vagrant.configure('2') do |config| config.ssh.private_key_path = '~/.vagrant.d/insecure_private_key' config.vm.define 'anxs' do |machine| - machine.vm.box = "ubuntu/xenial64" - #machine.vm.box = "ubuntu/trusty64" + machine.vm.box = "bento/ubuntu-16.04" + # machine.vm.box = "ubuntu/trusty64" #machine.vm.box = "ubuntu/precise64" #machine.vm.box = "debian/jessie64" #machine.vm.box = "debian/wheezy64" @@ -19,13 +19,6 @@ Vagrant.configure('2') do |config| machine.vm.network :private_network, ip: '192.168.88.22' machine.vm.hostname = 'anxs.local' - # Install python 2.7 to unbuntu 16.04 - if machine.vm.box == "ubuntu/xenial64" - machine.vm.provision "shell" do |s| - s.inline = "sudo apt-get install -y python-minimal" - end - end - machine.vm.provision 'ansible' do |ansible| ansible.playbook = 'tests/playbook.yml' ansible.sudo = true From c019f4c76083bcedff364ff0887f58e8387bd335 Mon Sep 17 00:00:00 2001 From: Mauro Oviedo Date: Tue, 21 Feb 2017 15:27:38 -0500 Subject: [PATCH 4/8] Added default variable postgresql_ext_postgis_deps. --- defaults/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index e7d01e71f..d553cd0b7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -31,6 +31,11 @@ postgresql_ext_install_postgis: no postgresql_ext_postgis_version: "2.1" # be careful: check whether the postgresql/postgis versions work together +postgresql_ext_postgis_deps: + - libgeos-c1 + - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}" + - "postgresql-{{postgresql_version}}-postgis-scripts" + # List of databases to be created (optional) postgresql_databases: [] From 9deddf90bf4d39f90aff416a7038332595aa8afb Mon Sep 17 00:00:00 2001 From: Mauro Oviedo Date: Tue, 21 Feb 2017 15:30:00 -0500 Subject: [PATCH 5/8] Added ubuntu/xenial specific distribution variables. --- vars/xenial.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 vars/xenial.yml diff --git a/vars/xenial.yml b/vars/xenial.yml new file mode 100644 index 000000000..1f42f8e32 --- /dev/null +++ b/vars/xenial.yml @@ -0,0 +1,6 @@ +--- + +postgresql_ext_postgis_deps: + - libgeos-c1v5 + - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}" + - "postgresql-{{postgresql_version}}-postgis-scripts" From 0a824f2d62a81298f768641559f1a5e30ef48e4e Mon Sep 17 00:00:00 2001 From: Mauro Oviedo Date: Tue, 21 Feb 2017 16:12:36 -0500 Subject: [PATCH 6/8] Added include_vars usage to include ubuntu/xenial specific vars. --- tasks/extensions/postgis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tasks/extensions/postgis.yml b/tasks/extensions/postgis.yml index d03a06048..c8704d6f1 100644 --- a/tasks/extensions/postgis.yml +++ b/tasks/extensions/postgis.yml @@ -1,14 +1,16 @@ # file: postgresql/tasks/extensions/postgis.yml +- include_vars: "{{ item }}" + with_first_found: + - "../vars/{{ ansible_distribution_release }}.yml" + - "../vars/empty.yml" + - name: PostgreSQL | Extensions | Make sure the postgis extensions are installed apt: name: "{{item}}" state: present update_cache: yes cache_valid_time: "{{apt_cache_valid_time | default (3600)}}" - with_items: - - libgeos-c1 - - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}" - - "postgresql-{{postgresql_version}}-postgis-scripts" + with_items: "{{ postgresql_ext_postgis_deps }}" notify: - restart postgresql From 65c305cd33b98291c681135874f1eec9dad56b26 Mon Sep 17 00:00:00 2001 From: Sobolev Nikita Date: Fri, 24 Feb 2017 00:37:33 +0300 Subject: [PATCH 7/8] Updates README.md with svg badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c474de37..b178ae320 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## ANXS - PostgreSQL [![Build Status](https://travis-ci.org/ANXS/postgresql.png?branch=master)](https://travis-ci.org/ANXS/postgresql) +## ANXS - PostgreSQL [![Build Status](https://travis-ci.org/ANXS/postgresql.svg?branch=master)](https://travis-ci.org/ANXS/postgresql) Ansible role which installs and configures PostgreSQL, extensions, databases and users. From 896e87bf12f1380353a2e844accb42715c32472d Mon Sep 17 00:00:00 2001 From: Colin Hoglund Date: Thu, 4 May 2017 10:31:13 -0400 Subject: [PATCH 8/8] postgresql_service_enabled is already a boolean --- tasks/configure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index da2ac36a5..aa4e41605 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -156,7 +156,7 @@ service: name: "{{ postgresql_service_name }}" enabled: yes - when: "{{ postgresql_service_enabled | bool }}" + when: postgresql_service_enabled - name: PostgreSQL | Restart PostgreSQL service: