dev/modules/sysconfig/manifests/virtualenv.pp
changeset 0 54f4e0f9d636
child 12 8ca7be41e3ca
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev/modules/sysconfig/manifests/virtualenv.pp	Thu Nov 20 17:44:01 2014 +0100
@@ -0,0 +1,42 @@
+class sysconfig::virtualenv (
+    $path_to_virtualenv = hiera('sysconfig::params::path_to_virtualenv', $sysconfig::params::path_to_virtualenv )
+) inherits sysconfig::params {
+
+    exec {
+            'easy_install_pip':
+             command     => 'sudo easy_install pip',
+             timeout     => 2400,
+             returns     => [ 0, 100 ],
+             provider => 'shell';
+            'pip_install_virtualenv':
+             command     => 'sudo pip install virtualenv',
+             timeout     => 2400,
+             returns     => [ 0, 100 ],
+             provider => 'shell',
+             require     => Exec['easy_install_pip'];
+             'create_virtualenv':
+             command     => "virtualenv ${path_to_virtualenv}",
+             timeout     => 2400,
+             returns     => [ 0, 100 ],
+             provider => 'shell',
+             require     => Exec['pip_install_virtualenv'];
+            'pip_install_requirements':
+             command     => ". ${path_to_virtualenv}/bin/activate && pip install -r /srv/catedit/virtualenv/requirements.txt",
+             timeout     => 2400,
+             returns     => [ 0, 100 ],
+             provider => 'shell',
+             require     => Exec['create_virtualenv'];
+            # 'create_python_env_script':
+            # command     => '/usr/bin/python /srv/catedit/virtualenv/web/create_python_env.py',
+            # timeout     => 2400,
+            # returns     => [ 0, 100 ],
+            # provider => 'shell';
+            # 'project_boot_script':
+            # command     => "python /srv/catedit/virtualenv/web/project-boot.py ${path_to_virtualenv}",
+            # timeout     => 2400,
+            # returns     => [ 0, 100 ],
+            # provider => 'shell',
+            # require     => Exec['create_python_env_script']
+            }
+    
+}
\ No newline at end of file