From 9bc7e07e8484221dbc0bb2dee7848033b7c62dba Mon Sep 17 00:00:00 2001 From: AdamCousins Date: Fri, 10 Jun 2016 21:19:38 +1000 Subject: [PATCH 1/4] add user to untar tarball with to allow for creating directories --- manifests/app.pp | 4 ++++ manifests/init.pp | 11 ++++++++++- manifests/instance.pp | 15 +++++++++++++-- manifests/instance/app.pp | 10 ++++++---- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/manifests/app.pp b/manifests/app.pp index b9f42cc..bfa819f 100644 --- a/manifests/app.pp +++ b/manifests/app.pp @@ -8,6 +8,8 @@ $db_password, $wp_owner, $wp_group, + $tar_owner, + $tar_group, $wp_lang, $wp_config_content, $wp_plugin_dir, @@ -31,6 +33,8 @@ db_password => $db_password, wp_owner => $wp_owner, wp_group => $wp_group, + tar_owner => $tar_owner, + tar_group => $tar_group, wp_lang => $wp_lang, wp_plugin_dir => $wp_plugin_dir, wp_additional_config => $wp_additional_config, diff --git a/manifests/init.pp b/manifests/init.pp index 4ba78c1..18f7ce2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -43,10 +43,15 @@ # Specifies the group of the wordpress files. Default: 0 (*BSD/Darwin # compatible GID) # +# [*tar_owner*] +# Specifies the owner of the wordpress tarball to download and extract. Default: root +# +# [*tar_group*] +# Specifies the group of the wordpress tarball to download and extract. Default: 0 (*BSD/Darwin +# # [*wp_lang*] # WordPress Localized Language. Default: '' # -# # [*wp_plugin_dir*] # WordPress Plugin Directory. Full path, no trailing slash. Default: WordPress Default # @@ -93,6 +98,8 @@ $db_password = 'password', $wp_owner = 'root', $wp_group = '0', + $tar_owner = 'root' + $tar_group = '0', $wp_lang = '', $wp_config_content = undef, $wp_plugin_dir = 'DEFAULT', @@ -118,6 +125,8 @@ db_password => $db_password, wp_owner => $wp_owner, wp_group => $wp_group, + tar_owner => $tar_owner, + tar_group => $tar_group, wp_lang => $wp_lang, wp_config_content => $wp_config_content, wp_plugin_dir => $wp_plugin_dir, diff --git a/manifests/instance.pp b/manifests/instance.pp index bd4c0a8..70fa8a5 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -41,6 +41,13 @@ # Specifies the group of the wordpress files. Default: 0 (*BSD/Darwin # compatible GID) # +# [*tar_owner*] +# Specifies the owner of the wordpress tarball to download and extract. Default: root +# +# [*tar_group*] +# Specifies the group of the wordpress tarball to download and extract. Default: 0 (*BSD/Darwin +# compatible GID) +# # [*wp_lang*] # WordPress Localized Language. Default: '' # @@ -82,6 +89,8 @@ $db_password = 'password', $wp_owner = 'root', $wp_group = '0', + $tar_owner = 'root' + $tar_group = '0', $wp_lang = '', $wp_config_content = undef, $wp_plugin_dir = 'DEFAULT', @@ -105,6 +114,8 @@ db_password => $db_password, wp_owner => $wp_owner, wp_group => $wp_group, + tar_owner => $tar_owner, + tar_group => $tar_group, wp_lang => $wp_lang, wp_config_content => $wp_config_content, wp_plugin_dir => $wp_plugin_dir, @@ -119,12 +130,12 @@ wp_debug_display => $wp_debug_display, } - wordpress::instance::db { "${db_host}/${db_name}": + /* wordpress::instance::db { "${db_host}/${db_name}": create_db => $create_db, create_db_user => $create_db_user, db_name => $db_name, db_host => $db_host, db_user => $db_user, db_password => $db_password, - } + } */ } diff --git a/manifests/instance/app.pp b/manifests/instance/app.pp index 467c800..13d7491 100644 --- a/manifests/instance/app.pp +++ b/manifests/instance/app.pp @@ -8,6 +8,8 @@ $db_password, $wp_owner, $wp_group, + $tar_owner, + $tar_group, $wp_lang, $wp_config_content, $wp_plugin_dir, @@ -75,14 +77,14 @@ command => "wget ${install_url}/${install_file_name}", creates => "${install_dir}/${install_file_name}", require => File[$install_dir], - user => $wp_owner, - group => $wp_group, + user => $tar_owner, + group => $tar_group, } -> exec { "Extract wordpress ${install_dir}": command => "tar zxvf ./${install_file_name} --strip-components=1", creates => "${install_dir}/index.php", - user => $wp_owner, - group => $wp_group, + user => $tar_owner, + group => $tar_group, } ~> exec { "Change ownership ${install_dir}": command => "chown -R ${wp_owner}:${wp_group} ${install_dir}", From 3dee9e10642985344623f6d77fce056969b31db6 Mon Sep 17 00:00:00 2001 From: AdamCousins Date: Fri, 10 Jun 2016 21:21:39 +1000 Subject: [PATCH 2/4] fix syntax error --- manifests/init.pp | 2 +- manifests/instance.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 18f7ce2..d5326bf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -98,7 +98,7 @@ $db_password = 'password', $wp_owner = 'root', $wp_group = '0', - $tar_owner = 'root' + $tar_owner = 'root', $tar_group = '0', $wp_lang = '', $wp_config_content = undef, diff --git a/manifests/instance.pp b/manifests/instance.pp index 70fa8a5..a67058c 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -89,7 +89,7 @@ $db_password = 'password', $wp_owner = 'root', $wp_group = '0', - $tar_owner = 'root' + $tar_owner = 'root', $tar_group = '0', $wp_lang = '', $wp_config_content = undef, From 36f063f663d392a09a271561b1b76c13f6b63953 Mon Sep 17 00:00:00 2001 From: AdamCousins Date: Fri, 10 Jun 2016 21:40:21 +1000 Subject: [PATCH 3/4] add same user for chown command --- manifests/instance/app.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/instance/app.pp b/manifests/instance/app.pp index 13d7491..86914af 100644 --- a/manifests/instance/app.pp +++ b/manifests/instance/app.pp @@ -89,8 +89,8 @@ ~> exec { "Change ownership ${install_dir}": command => "chown -R ${wp_owner}:${wp_group} ${install_dir}", refreshonly => true, - user => $wp_owner, - group => $wp_group, + user => $tar_owner, + group => $tar_group, } ## Configure wordpress From a5f0e3f499fa5d8b146f549f13b0704e76c3dbe0 Mon Sep 17 00:00:00 2001 From: AdamCousins Date: Fri, 1 Jul 2016 18:20:01 +1000 Subject: [PATCH 4/4] fix commenting out --- manifests/instance.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/instance.pp b/manifests/instance.pp index a67058c..9b3cd5c 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -130,12 +130,12 @@ wp_debug_display => $wp_debug_display, } - /* wordpress::instance::db { "${db_host}/${db_name}": + wordpress::instance::db { "${db_host}/${db_name}": create_db => $create_db, create_db_user => $create_db_user, db_name => $db_name, db_host => $db_host, db_user => $db_user, db_password => $db_password, - } */ + } }