diff --git a/.project b/.project index 469ffd6..2087feb 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - magento + puppet-magento diff --git a/manifests/init.pp b/manifests/init.pp index 76eaa0d..4ec0895 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -11,7 +11,52 @@ # Sample Usage: # # [Remember: No empty lines between comments and class definition] -class magento { +define magento( + $install = false +) { + $root = '/home/magento/sites/berbatik' + $mysql_host = 'localhost' + $mysql_user = 'berbatik_magento' + $mysql_password = 'bippo' + $mysql_dbname = 'berbatik_magento' + $url = 'http://www.berbatik.com.vm/' + $secure_url = 'http://www.berbatik.com.vm/' + $admin_firstname = 'Berbatik' + $admin_lastname = 'Sysadmin' + $admin_email = 'admin@berbatik.com.vm' + $admin_username = 'sysadmin' + $admin_password = 'admin123' + + if $install { + exec { install-magento: + cwd => $root, + creates => "${root}/app/etc/local.xml", + path => '/usr/bin', + command => "php -f install.php -- \ + --license_agreement_accepted \"yes\" \ + --locale \"id_ID\" \ + --timezone \"Asia/Bangkok\" \ + --default_currency \"IDR\" \ + --db_host \"${mysql_host}\" \ + --db_name \"${mysql_dbname}\" \ + --db_user \"${mysql_user}\" \ + --db_pass \"${mysql_password}\" \ + --url \"${url}\" \ + --use_rewrites \"${use_rewrites}\" \ + --use_secure \"no\" \ + --secure_base_url \"${secure_url}\" \ + --use_secure_admin \"no\" \ + --skip_url_validation \"yes\" \ + --admin_firstname \"${admin_firstname}\" \ + --admin_lastname \"${admin_lastname}\" \ + --admin_email \"${admin_email}\" \ + --admin_username \"${admin_username}\" \ + --admin_password \"${admin_password}\"", + logoutput => true, + user => 'magento', + require => [Exec["setting-permissions"], Exec["create-magentodb-db"]], + } + } } diff --git a/metadata.json b/metadata.json index e306128..b727f21 100644 --- a/metadata.json +++ b/metadata.json @@ -10,7 +10,7 @@ "checksums": { "Modulefile": "0d60817bc185db066165c629d2e46ed4", "README": "7d49d8c7428fc20f80670ba7a1381e83", - "manifests/init.pp": "b9322b0c9ea2cb81132f164396fb50f5", + "manifests/init.pp": "a95562fa01c73c34b423e8726d107015", "spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c", "spec/spec_helper.rb": "ca19ec4f451ebc7fdb035b52eae6e909", "tests/init.pp": "e11cb7cdf9d56f84917d327eaadd7be0"