diff --git a/manifests/init.pp b/manifests/init.pp index 6f36236..1ad8827 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,6 +3,7 @@ class apps_site ( $vhost_name = $::fqdn, $root_dir = '/opt/apps_site', + $install_dir = '/usr/local/lib/python2.7/dist-packages/openstack_catalog/', $serveradmin = "webmaster@${::domain}", $commit = 'master', $ssl_cert_file_contents = undef, @@ -99,23 +100,23 @@ class apps_site ( } } - file { "${root_dir}/openstack_catalog/local_settings.py": + exec { 'install-app_catalog' : + command => "/usr/local/bin/pip install ${root_dir}", + cwd => $root_dir, + refreshonly => true, + subscribe => Vcsrepo[$root_dir], + require => File["${install_dir}/local_settings.py"], + notify => Service['httpd'], + } + + file { "${install_dir}/local_settings.py": ensure => present, mode => '0644', content => template('apps_site/local_settings.erb'), require => Vcsrepo[$root_dir], } - exec { 'install-app_catalog' : - command => "/usr/local/bin/pip install ${root_dir}", - cwd => $root_dir, - refreshonly => true, - subscribe => Vcsrepo[$root_dir], - require => File["${root_dir}/openstack_catalog/local_settings.py"], - notify => Service['httpd'], - } - - file { "${root_dir}/openstack_catalog/web/static/CACHE": + file { "${install_dir}/web/static/CACHE": ensure => directory, owner => 'www-data', group => 'www-data', @@ -127,7 +128,7 @@ class apps_site ( command => "/usr/bin/python ${root_dir}/manage.py collectstatic --noinput", refreshonly => true, subscribe => Vcsrepo[$root_dir], - require => File["${root_dir}/openstack_catalog/web/static/CACHE"], + require => File["${install_dir}/web/static/CACHE"], } exec { 'make_assets_json' : diff --git a/templates/local_settings.erb b/templates/local_settings.erb index 6cb43c6..c2d7ee8 100644 --- a/templates/local_settings.erb +++ b/templates/local_settings.erb @@ -1,3 +1,3 @@ ASSETS_FILE = '<%= @root_dir %>/openstack_catalog/web/api/v1/assets' -STATIC_ROOT = '<%= @root_dir %>/openstack_catalog/web/static' +STATIC_ROOT = '<%= @install_dir %>/web/static' COMPRESS_ENABLED = True diff --git a/templates/vhost.erb b/templates/vhost.erb index 75288cf..9e798cd 100644 --- a/templates/vhost.erb +++ b/templates/vhost.erb @@ -6,7 +6,7 @@ WSGIDaemonProcess appcatalog user=www-data group=www-data threads=5 python-path=/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages WSGIScriptAlias / /usr/local/lib/python2.7/dist-packages/openstack_catalog/wsgi.py - Alias /static/ <%= @root_dir %>/openstack_catalog/web/static/ + Alias /static/ <%= @install_dir %>/web/static/ DocumentRoot <%= @docroot %> @@ -41,7 +41,7 @@ WSGIDaemonProcess appcatalogssl user=www-data group=www-data threads=5 python-path=/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages WSGIScriptAlias / /usr/local/lib/python2.7/dist-packages/openstack_catalog/wsgi.py - Alias /static/ <%= @root_dir %>/openstack_catalog/web/static/ + Alias /static/ <%= @install_dir %>/web/static/ SSLEngine on SSLProtocol All -SSLv2 -SSLv3