dev/modules/sysconfig/manifests/django_init.pp
author ymh <ymh.work@gmail.com>
Fri, 14 Mar 2014 03:08:58 +0100
changeset 609 736fdedb7774
parent 597 6cbcec19079b
permissions -rw-r--r--
clean the test-suite folder. create necessary files in dev env
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
class sysconfig::django_init (
609
736fdedb7774 clean the test-suite folder. create necessary files in dev env
ymh <ymh.work@gmail.com>
parents: 597
diff changeset
     2
    $superuser_name = hiera('sysconfig::params::superuser_name', $sysconfig::params::superuser_name ),
736fdedb7774 clean the test-suite folder. create necessary files in dev env
ymh <ymh.work@gmail.com>
parents: 597
diff changeset
     3
    $superuser_pw   = hiera('sysconfig::params::superuser_pw'  , $sysconfig::params::superuser_pw   )
588
8e9ea314e06e dev box bug correction + minimal doc in README.txt
ymh <ymh.work@gmail.com>
parents: 587
diff changeset
     4
) inherits sysconfig::params {
587
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
    
609
736fdedb7774 clean the test-suite folder. create necessary files in dev env
ymh <ymh.work@gmail.com>
parents: 597
diff changeset
     6
    notify {'django_init': name => "django init \$superuser_name : ${superuser_name}, \$superuser_pw : ${superuser_pw}", withpath => true }->
587
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
    exec { 'syncdb':
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
        command => '/srv/comt/bin/django syncdb --noinput --migrate',
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
        user    => 'vagrant' 
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    }
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    exec { 'loaddata':
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
        command => '/srv/comt/bin/django loaddata roles_generic',
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
        user    => 'vagrant',
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
        require => Exec['syncdb']
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    }
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    exec { 'createsuperuser':
588
8e9ea314e06e dev box bug correction + minimal doc in README.txt
ymh <ymh.work@gmail.com>
parents: 587
diff changeset
    20
        command => "/bin/echo \"from django.contrib.auth.models import User; User.objects.create_superuser('${superuser_name}', 'admin@example.com', '${superuser_pw}')\" | /srv/comt/bin/django shell",
587
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
        cwd     => '/srv/comt',
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
        user    => 'vagrant',
588
8e9ea314e06e dev box bug correction + minimal doc in README.txt
ymh <ymh.work@gmail.com>
parents: 587
diff changeset
    23
        onlyif  => "/bin/echo \"from django.contrib.auth.models import User; exit(User.objects.filter(username='${superuser_name}').count())\" | /srv/comt/bin/django shell",
8e9ea314e06e dev box bug correction + minimal doc in README.txt
ymh <ymh.work@gmail.com>
parents: 587
diff changeset
    24
       require => Exec['syncdb']
587
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
    }
593
8156e6e3c503 add karma test configuration creation in vagrant provision and add supervisor entry to launch (open|libre)office headless
ymh <ymh.work@gmail.com>
parents: 588
diff changeset
    26
587
a1aa29e7809f add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
}