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:


Reply via email to