|
17 | 17 |
|
18 | 18 | $root = '/home/magento/sites/berbatik'
|
19 | 19 | $mysql_host = 'localhost'
|
20 |
| - $mysql_user = 'berbatik_magento' |
| 20 | + $mysql_user = 'berbatik' |
21 | 21 | $mysql_password = 'bippo'
|
22 | 22 | $mysql_dbname = 'berbatik_magento'
|
23 | 23 | $url = 'http://www.berbatik.com.vm/'
|
| 24 | + $use_rewrites = 'yes' |
24 | 25 | $secure_url = 'http://www.berbatik.com.vm/'
|
25 | 26 | $admin_firstname = 'Berbatik'
|
26 | 27 | $admin_lastname = 'Sysadmin'
|
27 |
| - $admin_email = '[email protected]' |
| 28 | + $admin_email = '[email protected]' # [email protected] is not valid email, WTF? |
28 | 29 | $admin_username = 'sysadmin'
|
29 | 30 | $admin_password = 'admin123'
|
30 | 31 |
|
| 32 | + file { '/home/magento/scripts/extract-magento.sh': |
| 33 | + ensure => file, |
| 34 | + source => 'puppet:///modules/magento/extract-magento.sh', |
| 35 | + owner => magento, |
| 36 | + group => magento, |
| 37 | + mode => 0755, |
| 38 | + } |
| 39 | + |
31 | 40 | if $install {
|
| 41 | + |
| 42 | + # TODO: No download or install is need if Magento is already setup |
| 43 | + file { magento-dist: |
| 44 | + name => '/home/magento/dist', |
| 45 | + ensure => directory, |
| 46 | + owner => magento, |
| 47 | + group => magento, |
| 48 | + } |
| 49 | + exec { download-magento: |
| 50 | + cwd => '/home/magento/dist', |
| 51 | + creates => '/home/magento/dist/magento-bippo-1.6.2.0_1.tar.gz', |
| 52 | + command => 'wget http://192.168.66.17:8080/nexus/service/local/repositories/releases/content/id/co/bippo/commerce/magento-bippo/1.6.2.0_1/magento-bippo-1.6.2.0_1.tar.gz', |
| 53 | + path => ['/usr/local/bin', '/usr/bin'], |
| 54 | + logoutput => true, |
| 55 | + user => 'magento', |
| 56 | + require => File['magento-dist'], |
| 57 | + } |
| 58 | + exec { extract-magento: |
| 59 | + creates => '/home/magento/sites/berbatik', |
| 60 | + command => '/home/magento/scripts/extract-magento.sh /home/magento/sites/berbatik', |
| 61 | + logoutput => true, |
| 62 | + user => 'magento', |
| 63 | + environment => ['HOME=/home/magento'], |
| 64 | + require => [ Exec['download-magento'], File['/home/magento/scripts/extract-magento.sh'] ], |
| 65 | + } |
| 66 | + |
32 | 67 | exec { install-magento:
|
33 | 68 | cwd => $root,
|
34 | 69 | creates => "${root}/app/etc/local.xml",
|
35 |
| - path => '/usr/bin', |
| 70 | + path => ['/usr/local/bin', '/usr/bin'], |
36 | 71 | command => "php -f install.php -- \
|
37 | 72 | --license_agreement_accepted \"yes\" \
|
38 | 73 | --locale \"id_ID\" \
|
|
55 | 90 | --admin_password \"${admin_password}\"",
|
56 | 91 | logoutput => true,
|
57 | 92 | user => 'magento',
|
58 |
| - require => [Exec["setting-permissions"], Exec["create-magentodb-db"]], |
| 93 | + require => [ Exec['extract-magento'] ], |
| 94 | + #require => [Exec["setting-permissions"], Exec["create-magentodb-db"]], |
59 | 95 | }
|
| 96 | + |
| 97 | + file { '/home/magento/sites/berbatik/app/etc/local.xml': |
| 98 | + ensure => file, |
| 99 | + owner => magento, |
| 100 | + group => magento, |
| 101 | + mode => 0400, |
| 102 | + require => Exec['install-magento'], |
| 103 | + } |
| 104 | + |
60 | 105 | }
|
61 | 106 |
|
62 | 107 | }
|
0 commit comments