You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by gj...@apache.org on 2017/07/19 01:47:43 UTC

svn commit: r1802348 - in /bloodhound/trunk: Vagrantfile salt/roots/pillar/settings.sls salt/roots/salt/bloodhound/init.sls salt/roots/salt/postgresql/init.sls salt/roots/salt/webserver/init.sls

Author: gjm
Date: Wed Jul 19 01:47:43 2017
New Revision: 1802348

URL: http://svn.apache.org/viewvc?rev=1802348&view=rev
Log:
towards fixing vagrant development with salt

Modified:
    bloodhound/trunk/Vagrantfile
    bloodhound/trunk/salt/roots/pillar/settings.sls
    bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
    bloodhound/trunk/salt/roots/salt/postgresql/init.sls
    bloodhound/trunk/salt/roots/salt/webserver/init.sls

Modified: bloodhound/trunk/Vagrantfile
URL: http://svn.apache.org/viewvc/bloodhound/trunk/Vagrantfile?rev=1802348&r1=1802347&r2=1802348&view=diff
==============================================================================
--- bloodhound/trunk/Vagrantfile (original)
+++ bloodhound/trunk/Vagrantfile Wed Jul 19 01:47:43 2017
@@ -21,8 +21,7 @@
 # Vagrant configuration version 2
 # Please don't change it unless you know what you're doing.
 Vagrant.configure(2) do |config|
-  config.vm.box = "precise64"
-  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
+  config.vm.box = "bento/ubuntu-16.04"
 
   # Forwarded port mappings:
   # For apache served bloodhound use http://localhost:8280/

Modified: bloodhound/trunk/salt/roots/pillar/settings.sls
URL: http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/pillar/settings.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
==============================================================================
--- bloodhound/trunk/salt/roots/pillar/settings.sls (original)
+++ bloodhound/trunk/salt/roots/pillar/settings.sls Wed Jul 19 01:47:43 2017
@@ -26,12 +26,19 @@ enable_webserver: True
 # these settings are not tested thoroughly with many boxes so will probably
 # need correcting
 {% if grains['oscodename'] in ['lucid', 'natty', 'maverick', 'squeeze'] %}
+pg_version: 8.4
 postgresql: postgresql-8.4
-pg_hba_file: /etc/postgresql/8.4/main/pg_hba.conf
+pg_hba_file: /etc/postgresql/8.4/bhcluster/pg_hba.conf
 pg_hba_replace: pg_hba_8.4.conf
+{% elif grains['oscodename'] == 'xenial' %}
+pg_version: 9.5
+postgresql: postgresql-9.5
+pg_hba_file: /etc/postgresql/9.5/bhcluster/pg_hba.conf
+pg_hba_replace: pg_hba_9.1.conf
 {% else %}
+pg_version: 9.1
 postgresql: postgresql-9.1
-pg_hba_file: /etc/postgresql/9.1/main/pg_hba.conf
+pg_hba_file: /etc/postgresql/9.1/bhcluster/pg_hba.conf
 pg_hba_replace: pg_hba_9.1.conf
 {% endif %}
 {% if grains['oscodename'] in ['lucid', 'natty', 'maverick'] %}
@@ -48,7 +55,7 @@ projects:
     dbuser: bloodhound
     dbpassword: bloodhound
     dbhost: localhost
-    dbport: 5432
+    dbport: 5434
     adminuser: admin
     adminpassword: adminpass
     project: test

Modified: bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
URL: http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/bloodhound/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
==============================================================================
--- bloodhound/trunk/salt/roots/salt/bloodhound/init.sls (original)
+++ bloodhound/trunk/salt/roots/salt/bloodhound/init.sls Wed Jul 19 01:47:43 2017
@@ -22,9 +22,9 @@ include:
 
 /home/vagrant/bhenv:
   virtualenv.managed:
-    - no_site_packages: True
+    - system_site_packages: False
     - user: vagrant
-    - requirements: salt://bloodhound/requirements.txt
+    - requirements: /vagrant/installer/requirements-dev.txt
     - cwd: /vagrant/installer/
     - require:
       - pkg: python-dev
@@ -36,7 +36,7 @@ project environment requirements:
     - user: vagrant
     - cwd: /vagrant/installer/
     - name: "source /home/vagrant/bhenv/bin/activate
-             && pip install -r requirements-dev.txt"
+             && pip install -r pgrequirements.txt"
     - require:
       - virtualenv: /home/vagrant/bhenv
 
@@ -81,17 +81,20 @@ bloodhounduser for {{ project }}:
     - name: {{ data['dbuser'] }}
     - password: {{ data['dbpassword'] }}
     - user: postgres
+    - db_port: {{ data['dbport'] }}
     - require:
       - pkg: {{ pillar['postgresql'] }}
       - service: {{ pillar['postgresql_service'] }}
 
+
 bloodhounddb for {{ project }}:
   postgres_database.present:
     - name: {{ data['dbname'] }}
-    - encoding: UTF8
+    - encoding: 'UTF8'
     - template: template0
     - owner: {{ data['dbuser'] }}
     - user: postgres
+    - db_port: {{ data['dbport'] }}
     - require:
       - postgres_user: bloodhounduser for {{ project }}
 {% endif %}

Modified: bloodhound/trunk/salt/roots/salt/postgresql/init.sls
URL: http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/postgresql/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
==============================================================================
--- bloodhound/trunk/salt/roots/salt/postgresql/init.sls (original)
+++ bloodhound/trunk/salt/roots/salt/postgresql/init.sls Wed Jul 19 01:47:43 2017
@@ -29,6 +29,7 @@ pg_hb.conf:
     - group: postgres
     - mode: 644
     - require:
+      - postgres_cluster: bhcluster
       - pkg: {{ pillar['postgresql'] }}
 
 postgresql:
@@ -40,5 +41,16 @@ postgresql:
     - enable: True
     - watch:
       - file: {{ pillar['pg_hba_file'] }}
+
+bhcluster:
+  postgres_cluster.present:
+    - name: 'bhcluster'
+    - version: '{{ pillar["pg_version"] }}'
+    - encoding: 'UTF8'
+    - port: '{{ data["dbport"] }}'
+    - require:
+      - pkg: {{ pillar['postgresql'] }}
+    - unless: test -d /etc/postgresql/{{ pillar["pg_version"] }}/bhcluster
+
 {% endif %}
 {% endif %} {% endfor %}

Modified: bloodhound/trunk/salt/roots/salt/webserver/init.sls
URL: http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/webserver/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
==============================================================================
--- bloodhound/trunk/salt/roots/salt/webserver/init.sls (original)
+++ bloodhound/trunk/salt/roots/salt/webserver/init.sls Wed Jul 19 01:47:43 2017
@@ -40,7 +40,7 @@ bloodhound_site:
   file:
     - managed
     - template: jinja
-    - name: /etc/apache2/sites-available/bloodhound
+    - name: /etc/apache2/sites-available/bloodhound.conf
     - source: salt://webserver/bloodhound.site
     - require:
       - pkg: apache2
@@ -48,14 +48,14 @@ bloodhound_site:
 {% if grains['os_family'] == 'Debian' %}
 a2dissite 000-default:
   cmd.run:
-    - onlyif: test -L /etc/apache2/sites-enabled/000-default
+    - onlyif: test -L /etc/apache2/sites-enabled/000-default.conf
     - require:
       - pkg: apache2
 {% endif %}
 
 a2ensite bloodhound:
   cmd.run:
-    - unless: test -L /etc/apache2/sites-enabled/bloodhound
+    - unless: test -L /etc/apache2/sites-enabled/bloodhound.conf
     - watch:
       - file: bloodhound_site
     - require:



Re: svn commit: r1802348 - in /bloodhound/trunk: Vagrantfile salt/roots/pillar/settings.sls salt/roots/salt/bloodhound/init.sls salt/roots/salt/postgresql/init.sls salt/roots/salt/webserver/init.sls

Posted by Gary <ga...@physics.org>.
My apologies.. I intended to link to the bento box that I was referring
to in case anyone finds it useful:
https://app.vagrantup.com/bento/boxes/ubuntu-16.04

Cheers,
    Gary

On Wed, 19 Jul 2017, at 03:03 AM, Gary wrote:
> Hi,
> 
> This is my attempt to get the vagrant based development back to a state
> where it is working via saltstack provisioning. There is a bit more work
> required for the webserver to serve properly and some of the work is a
> bit messy still with the old attempt to allow for various platforms.
> 
> At this point I find that the `vagrant up --provider=virtualbox` command
> goes through the steps without obvious error and repeating provisioning
> does not break anything.
> 
> Among the changes include swapping to the Ubuntu 16.04 via those
> provided by 'bento' - I find in my work that these are generally
> reliable, at least in the sense of having relatively few issues in
> running on various platforms.
> 
> The move to Ubuntu 16.04 to an extent feeds into work for maintaining
> our main issue tracker although the plan there is currently to use
> puppet for the provisioning instead.
> 
> Cheers,
>     Gary
> 
> On Wed, 19 Jul 2017, at 02:47 AM, gjm@apache.org wrote:
> > Author: gjm
> > Date: Wed Jul 19 01:47:43 2017
> > New Revision: 1802348
> > 
> > URL: http://svn.apache.org/viewvc?rev=1802348&view=rev
> > Log:
> > towards fixing vagrant development with salt
> > 
> > Modified:
> >     bloodhound/trunk/Vagrantfile
> >     bloodhound/trunk/salt/roots/pillar/settings.sls
> >     bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
> >     bloodhound/trunk/salt/roots/salt/postgresql/init.sls
> >     bloodhound/trunk/salt/roots/salt/webserver/init.sls
> > 
> > Modified: bloodhound/trunk/Vagrantfile
> > URL:
> > http://svn.apache.org/viewvc/bloodhound/trunk/Vagrantfile?rev=1802348&r1=1802347&r2=1802348&view=diff
> > ==============================================================================
> > --- bloodhound/trunk/Vagrantfile (original)
> > +++ bloodhound/trunk/Vagrantfile Wed Jul 19 01:47:43 2017
> > @@ -21,8 +21,7 @@
> >  # Vagrant configuration version 2
> >  # Please don't change it unless you know what you're doing.
> >  Vagrant.configure(2) do |config|
> > -  config.vm.box = "precise64"
> > -  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
> > +  config.vm.box = "bento/ubuntu-16.04"
> >  
> >    # Forwarded port mappings:
> >    # For apache served bloodhound use http://localhost:8280/
> > 
> > Modified: bloodhound/trunk/salt/roots/pillar/settings.sls
> > URL:
> > http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/pillar/settings.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
> > ==============================================================================
> > --- bloodhound/trunk/salt/roots/pillar/settings.sls (original)
> > +++ bloodhound/trunk/salt/roots/pillar/settings.sls Wed Jul 19 01:47:43
> > 2017
> > @@ -26,12 +26,19 @@ enable_webserver: True
> >  # these settings are not tested thoroughly with many boxes so will
> >  probably
> >  # need correcting
> >  {% if grains['oscodename'] in ['lucid', 'natty', 'maverick', 'squeeze']
> >  %}
> > +pg_version: 8.4
> >  postgresql: postgresql-8.4
> > -pg_hba_file: /etc/postgresql/8.4/main/pg_hba.conf
> > +pg_hba_file: /etc/postgresql/8.4/bhcluster/pg_hba.conf
> >  pg_hba_replace: pg_hba_8.4.conf
> > +{% elif grains['oscodename'] == 'xenial' %}
> > +pg_version: 9.5
> > +postgresql: postgresql-9.5
> > +pg_hba_file: /etc/postgresql/9.5/bhcluster/pg_hba.conf
> > +pg_hba_replace: pg_hba_9.1.conf
> >  {% else %}
> > +pg_version: 9.1
> >  postgresql: postgresql-9.1
> > -pg_hba_file: /etc/postgresql/9.1/main/pg_hba.conf
> > +pg_hba_file: /etc/postgresql/9.1/bhcluster/pg_hba.conf
> >  pg_hba_replace: pg_hba_9.1.conf
> >  {% endif %}
> >  {% if grains['oscodename'] in ['lucid', 'natty', 'maverick'] %}
> > @@ -48,7 +55,7 @@ projects:
> >      dbuser: bloodhound
> >      dbpassword: bloodhound
> >      dbhost: localhost
> > -    dbport: 5432
> > +    dbport: 5434
> >      adminuser: admin
> >      adminpassword: adminpass
> >      project: test
> > 
> > Modified: bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
> > URL:
> > http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/bloodhound/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
> > ==============================================================================
> > --- bloodhound/trunk/salt/roots/salt/bloodhound/init.sls (original)
> > +++ bloodhound/trunk/salt/roots/salt/bloodhound/init.sls Wed Jul 19
> > 01:47:43 2017
> > @@ -22,9 +22,9 @@ include:
> >  
> >  /home/vagrant/bhenv:
> >    virtualenv.managed:
> > -    - no_site_packages: True
> > +    - system_site_packages: False
> >      - user: vagrant
> > -    - requirements: salt://bloodhound/requirements.txt
> > +    - requirements: /vagrant/installer/requirements-dev.txt
> >      - cwd: /vagrant/installer/
> >      - require:
> >        - pkg: python-dev
> > @@ -36,7 +36,7 @@ project environment requirements:
> >      - user: vagrant
> >      - cwd: /vagrant/installer/
> >      - name: "source /home/vagrant/bhenv/bin/activate
> > -             && pip install -r requirements-dev.txt"
> > +             && pip install -r pgrequirements.txt"
> >      - require:
> >        - virtualenv: /home/vagrant/bhenv
> >  
> > @@ -81,17 +81,20 @@ bloodhounduser for {{ project }}:
> >      - name: {{ data['dbuser'] }}
> >      - password: {{ data['dbpassword'] }}
> >      - user: postgres
> > +    - db_port: {{ data['dbport'] }}
> >      - require:
> >        - pkg: {{ pillar['postgresql'] }}
> >        - service: {{ pillar['postgresql_service'] }}
> >  
> > +
> >  bloodhounddb for {{ project }}:
> >    postgres_database.present:
> >      - name: {{ data['dbname'] }}
> > -    - encoding: UTF8
> > +    - encoding: 'UTF8'
> >      - template: template0
> >      - owner: {{ data['dbuser'] }}
> >      - user: postgres
> > +    - db_port: {{ data['dbport'] }}
> >      - require:
> >        - postgres_user: bloodhounduser for {{ project }}
> >  {% endif %}
> > 
> > Modified: bloodhound/trunk/salt/roots/salt/postgresql/init.sls
> > URL:
> > http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/postgresql/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
> > ==============================================================================
> > --- bloodhound/trunk/salt/roots/salt/postgresql/init.sls (original)
> > +++ bloodhound/trunk/salt/roots/salt/postgresql/init.sls Wed Jul 19
> > 01:47:43 2017
> > @@ -29,6 +29,7 @@ pg_hb.conf:
> >      - group: postgres
> >      - mode: 644
> >      - require:
> > +      - postgres_cluster: bhcluster
> >        - pkg: {{ pillar['postgresql'] }}
> >  
> >  postgresql:
> > @@ -40,5 +41,16 @@ postgresql:
> >      - enable: True
> >      - watch:
> >        - file: {{ pillar['pg_hba_file'] }}
> > +
> > +bhcluster:
> > +  postgres_cluster.present:
> > +    - name: 'bhcluster'
> > +    - version: '{{ pillar["pg_version"] }}'
> > +    - encoding: 'UTF8'
> > +    - port: '{{ data["dbport"] }}'
> > +    - require:
> > +      - pkg: {{ pillar['postgresql'] }}
> > +    - unless: test -d /etc/postgresql/{{ pillar["pg_version"]
> > }}/bhcluster
> > +
> >  {% endif %}
> >  {% endif %} {% endfor %}
> > 
> > Modified: bloodhound/trunk/salt/roots/salt/webserver/init.sls
> > URL:
> > http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/webserver/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
> > ==============================================================================
> > --- bloodhound/trunk/salt/roots/salt/webserver/init.sls (original)
> > +++ bloodhound/trunk/salt/roots/salt/webserver/init.sls Wed Jul 19
> > 01:47:43 2017
> > @@ -40,7 +40,7 @@ bloodhound_site:
> >    file:
> >      - managed
> >      - template: jinja
> > -    - name: /etc/apache2/sites-available/bloodhound
> > +    - name: /etc/apache2/sites-available/bloodhound.conf
> >      - source: salt://webserver/bloodhound.site
> >      - require:
> >        - pkg: apache2
> > @@ -48,14 +48,14 @@ bloodhound_site:
> >  {% if grains['os_family'] == 'Debian' %}
> >  a2dissite 000-default:
> >    cmd.run:
> > -    - onlyif: test -L /etc/apache2/sites-enabled/000-default
> > +    - onlyif: test -L /etc/apache2/sites-enabled/000-default.conf
> >      - require:
> >        - pkg: apache2
> >  {% endif %}
> >  
> >  a2ensite bloodhound:
> >    cmd.run:
> > -    - unless: test -L /etc/apache2/sites-enabled/bloodhound
> > +    - unless: test -L /etc/apache2/sites-enabled/bloodhound.conf
> >      - watch:
> >        - file: bloodhound_site
> >      - require:
> > 
> > 

Re: svn commit: r1802348 - in /bloodhound/trunk: Vagrantfile salt/roots/pillar/settings.sls salt/roots/salt/bloodhound/init.sls salt/roots/salt/postgresql/init.sls salt/roots/salt/webserver/init.sls

Posted by Gary <ga...@physics.org>.
Hi,

This is my attempt to get the vagrant based development back to a state
where it is working via saltstack provisioning. There is a bit more work
required for the webserver to serve properly and some of the work is a
bit messy still with the old attempt to allow for various platforms.

At this point I find that the `vagrant up --provider=virtualbox` command
goes through the steps without obvious error and repeating provisioning
does not break anything.

Among the changes include swapping to the Ubuntu 16.04 via those
provided by 'bento' - I find in my work that these are generally
reliable, at least in the sense of having relatively few issues in
running on various platforms.

The move to Ubuntu 16.04 to an extent feeds into work for maintaining
our main issue tracker although the plan there is currently to use
puppet for the provisioning instead.

Cheers,
    Gary

On Wed, 19 Jul 2017, at 02:47 AM, gjm@apache.org wrote:
> Author: gjm
> Date: Wed Jul 19 01:47:43 2017
> New Revision: 1802348
> 
> URL: http://svn.apache.org/viewvc?rev=1802348&view=rev
> Log:
> towards fixing vagrant development with salt
> 
> Modified:
>     bloodhound/trunk/Vagrantfile
>     bloodhound/trunk/salt/roots/pillar/settings.sls
>     bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
>     bloodhound/trunk/salt/roots/salt/postgresql/init.sls
>     bloodhound/trunk/salt/roots/salt/webserver/init.sls
> 
> Modified: bloodhound/trunk/Vagrantfile
> URL:
> http://svn.apache.org/viewvc/bloodhound/trunk/Vagrantfile?rev=1802348&r1=1802347&r2=1802348&view=diff
> ==============================================================================
> --- bloodhound/trunk/Vagrantfile (original)
> +++ bloodhound/trunk/Vagrantfile Wed Jul 19 01:47:43 2017
> @@ -21,8 +21,7 @@
>  # Vagrant configuration version 2
>  # Please don't change it unless you know what you're doing.
>  Vagrant.configure(2) do |config|
> -  config.vm.box = "precise64"
> -  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
> +  config.vm.box = "bento/ubuntu-16.04"
>  
>    # Forwarded port mappings:
>    # For apache served bloodhound use http://localhost:8280/
> 
> Modified: bloodhound/trunk/salt/roots/pillar/settings.sls
> URL:
> http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/pillar/settings.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
> ==============================================================================
> --- bloodhound/trunk/salt/roots/pillar/settings.sls (original)
> +++ bloodhound/trunk/salt/roots/pillar/settings.sls Wed Jul 19 01:47:43
> 2017
> @@ -26,12 +26,19 @@ enable_webserver: True
>  # these settings are not tested thoroughly with many boxes so will
>  probably
>  # need correcting
>  {% if grains['oscodename'] in ['lucid', 'natty', 'maverick', 'squeeze']
>  %}
> +pg_version: 8.4
>  postgresql: postgresql-8.4
> -pg_hba_file: /etc/postgresql/8.4/main/pg_hba.conf
> +pg_hba_file: /etc/postgresql/8.4/bhcluster/pg_hba.conf
>  pg_hba_replace: pg_hba_8.4.conf
> +{% elif grains['oscodename'] == 'xenial' %}
> +pg_version: 9.5
> +postgresql: postgresql-9.5
> +pg_hba_file: /etc/postgresql/9.5/bhcluster/pg_hba.conf
> +pg_hba_replace: pg_hba_9.1.conf
>  {% else %}
> +pg_version: 9.1
>  postgresql: postgresql-9.1
> -pg_hba_file: /etc/postgresql/9.1/main/pg_hba.conf
> +pg_hba_file: /etc/postgresql/9.1/bhcluster/pg_hba.conf
>  pg_hba_replace: pg_hba_9.1.conf
>  {% endif %}
>  {% if grains['oscodename'] in ['lucid', 'natty', 'maverick'] %}
> @@ -48,7 +55,7 @@ projects:
>      dbuser: bloodhound
>      dbpassword: bloodhound
>      dbhost: localhost
> -    dbport: 5432
> +    dbport: 5434
>      adminuser: admin
>      adminpassword: adminpass
>      project: test
> 
> Modified: bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
> URL:
> http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/bloodhound/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
> ==============================================================================
> --- bloodhound/trunk/salt/roots/salt/bloodhound/init.sls (original)
> +++ bloodhound/trunk/salt/roots/salt/bloodhound/init.sls Wed Jul 19
> 01:47:43 2017
> @@ -22,9 +22,9 @@ include:
>  
>  /home/vagrant/bhenv:
>    virtualenv.managed:
> -    - no_site_packages: True
> +    - system_site_packages: False
>      - user: vagrant
> -    - requirements: salt://bloodhound/requirements.txt
> +    - requirements: /vagrant/installer/requirements-dev.txt
>      - cwd: /vagrant/installer/
>      - require:
>        - pkg: python-dev
> @@ -36,7 +36,7 @@ project environment requirements:
>      - user: vagrant
>      - cwd: /vagrant/installer/
>      - name: "source /home/vagrant/bhenv/bin/activate
> -             && pip install -r requirements-dev.txt"
> +             && pip install -r pgrequirements.txt"
>      - require:
>        - virtualenv: /home/vagrant/bhenv
>  
> @@ -81,17 +81,20 @@ bloodhounduser for {{ project }}:
>      - name: {{ data['dbuser'] }}
>      - password: {{ data['dbpassword'] }}
>      - user: postgres
> +    - db_port: {{ data['dbport'] }}
>      - require:
>        - pkg: {{ pillar['postgresql'] }}
>        - service: {{ pillar['postgresql_service'] }}
>  
> +
>  bloodhounddb for {{ project }}:
>    postgres_database.present:
>      - name: {{ data['dbname'] }}
> -    - encoding: UTF8
> +    - encoding: 'UTF8'
>      - template: template0
>      - owner: {{ data['dbuser'] }}
>      - user: postgres
> +    - db_port: {{ data['dbport'] }}
>      - require:
>        - postgres_user: bloodhounduser for {{ project }}
>  {% endif %}
> 
> Modified: bloodhound/trunk/salt/roots/salt/postgresql/init.sls
> URL:
> http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/postgresql/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
> ==============================================================================
> --- bloodhound/trunk/salt/roots/salt/postgresql/init.sls (original)
> +++ bloodhound/trunk/salt/roots/salt/postgresql/init.sls Wed Jul 19
> 01:47:43 2017
> @@ -29,6 +29,7 @@ pg_hb.conf:
>      - group: postgres
>      - mode: 644
>      - require:
> +      - postgres_cluster: bhcluster
>        - pkg: {{ pillar['postgresql'] }}
>  
>  postgresql:
> @@ -40,5 +41,16 @@ postgresql:
>      - enable: True
>      - watch:
>        - file: {{ pillar['pg_hba_file'] }}
> +
> +bhcluster:
> +  postgres_cluster.present:
> +    - name: 'bhcluster'
> +    - version: '{{ pillar["pg_version"] }}'
> +    - encoding: 'UTF8'
> +    - port: '{{ data["dbport"] }}'
> +    - require:
> +      - pkg: {{ pillar['postgresql'] }}
> +    - unless: test -d /etc/postgresql/{{ pillar["pg_version"]
> }}/bhcluster
> +
>  {% endif %}
>  {% endif %} {% endfor %}
> 
> Modified: bloodhound/trunk/salt/roots/salt/webserver/init.sls
> URL:
> http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/webserver/init.sls?rev=1802348&r1=1802347&r2=1802348&view=diff
> ==============================================================================
> --- bloodhound/trunk/salt/roots/salt/webserver/init.sls (original)
> +++ bloodhound/trunk/salt/roots/salt/webserver/init.sls Wed Jul 19
> 01:47:43 2017
> @@ -40,7 +40,7 @@ bloodhound_site:
>    file:
>      - managed
>      - template: jinja
> -    - name: /etc/apache2/sites-available/bloodhound
> +    - name: /etc/apache2/sites-available/bloodhound.conf
>      - source: salt://webserver/bloodhound.site
>      - require:
>        - pkg: apache2
> @@ -48,14 +48,14 @@ bloodhound_site:
>  {% if grains['os_family'] == 'Debian' %}
>  a2dissite 000-default:
>    cmd.run:
> -    - onlyif: test -L /etc/apache2/sites-enabled/000-default
> +    - onlyif: test -L /etc/apache2/sites-enabled/000-default.conf
>      - require:
>        - pkg: apache2
>  {% endif %}
>  
>  a2ensite bloodhound:
>    cmd.run:
> -    - unless: test -L /etc/apache2/sites-enabled/bloodhound
> +    - unless: test -L /etc/apache2/sites-enabled/bloodhound.conf
>      - watch:
>        - file: bloodhound_site
>      - require:
> 
>