Best Practice in updating a zipped joomla config file


#1

Hello Guys,

I am trying to figure out things as I learn a little more in chef. I am
sorry if this is still basic for you gurus :slight_smile: , it’s because I learn
effectively by doing.

I posted in another thread decision that has to be taken between hosted
chef and aws opsworks. In any case nodes are in aws.

joomla site is zipped from staging server outside aws made accessible via
http. Since it’s a copy from a different environment its configuration.php
file has details of user,password,db,hostname,logs and tmp path on staging
environment.
To update that in production, I am to do search_file_replace_line or use a
full template and replace the one from staging env? I am thinking the
latter make sense but, it also means , I will need to keep the
configuration.php.erb for example updated as joomla releases a new version
with a slightly different configuraiton.php file. I am not too sure how
these things are done when it comes to maintain the version of joomla
through the configuration in the template.

Thank you in advance


Joseph Kodjo-Kuma Djomeda
check out my pains at : www.mycodingpains.com
We become what we think about ourselves…


#2

Joseph,

I feel that it’s always best to keep the config file close to the application that’s being configured. If at all possible, I’d ask the team that creates the pre-configured Joomla zip file that you’re consuming to keep the .erb template in the zip file as well, and ask them to make it their responsibility to keep your template up-to-date with config file changes.

Then you can use a template resource in Chef like so:

template ‘/path/to/joomla_configuration.php’ do
local true
source '/my/local/joomla_configuration.php.erb’
end
This will have Chef pick up the template from the local filesystem, rather than looking for it in the cookbook. You can then use Chef like to manage the application’s configuration, and not have to worry about the config file being packaged separately in a cookbook, away from the Joomla application. The app and the config file can be packaged together.

--Charles

On July 14, 2015 at 11:49:45 AM, Joseph Djomeda (joseph@djomeda.com) wrote:

Hello Guys,

I am trying to figure out things as I learn a little more in chef. I am sorry if this is still basic for you gurus :slight_smile: , it’s because I learn effectively by doing.

I posted in another thread decision that has to be taken between hosted chef and aws opsworks. In any case nodes are in aws.

joomla site is zipped from staging server outside aws made accessible via http. Since it’s a copy from a different environment its configuration.php file has details of user,password,db,hostname,logs and tmp path on staging environment.
To update that in production, I am to do search_file_replace_line or use a full template and replace the one from staging env? I am thinking the latter make sense but, it also means , I will need to keep the configuration.php.erb for example updated as joomla releases a new version with a slightly different configuraiton.php file. I am not too sure how these things are done when it comes to maintain the version of joomla through the configuration in the template.

Thank you in advance


Joseph Kodjo-Kuma Djomeda
check out my pains at : www.mycodingpains.com
We become what we think about ourselves…


#3

Hello Charles,

Thanks for your email. I think it makes sense.

Best Regards,

On Tue, Jul 14, 2015 at 7:21 PM Charles Johnson charles@chef.io wrote:

Joseph,

I feel that it’s always best to keep the config file close to the
application that’s being configured. If at all possible, I’d ask the team
that creates the pre-configured Joomla zip file that you’re consuming to
keep the .erb template in the zip file as well, and ask them to make it
their responsibility to keep your template up-to-date with config file
changes.

Then you can use a template resource in Chef like so:

template ‘/path/to/joomla_configuration.php’ do
local true
source '/my/local/joomla_configuration.php.erb’
end

This will have Chef pick up the template from the local filesystem, rather
than looking for it in the cookbook. You can then use Chef like to manage
the application’s configuration, and not have to worry about the config
file being packaged separately in a cookbook, away from the Joomla
application. The app and the config file can be packaged together.

--Charles

On July 14, 2015 at 11:49:45 AM, Joseph Djomeda (joseph@djomeda.com)
wrote:

Hello Guys,

I am trying to figure out things as I learn a little more in chef. I am
sorry if this is still basic for you gurus :slight_smile: , it’s because I learn
effectively by doing.

I posted in another thread decision that has to be taken between hosted
chef and aws opsworks. In any case nodes are in aws.

joomla site is zipped from staging server outside aws made accessible via
http. Since it’s a copy from a different environment its configuration.php
file has details of user,password,db,hostname,logs and tmp path on staging
environment.
To update that in production, I am to do search_file_replace_line or use a
full template and replace the one from staging env? I am thinking the
latter make sense but, it also means , I will need to keep the
configuration.php.erb for example updated as joomla releases a new version
with a slightly different configuraiton.php file. I am not too sure how
these things are done when it comes to maintain the version of joomla
through the configuration in the template.

Thank you in advance


Joseph Kodjo-Kuma Djomeda
check out my pains at : www.mycodingpains.com
We become what we think about ourselves…


Joseph Kodjo-Kuma Djomeda
check out my pains at : www.mycodingpains.com
We become what we think about ourselves…


#4

Hello Charles,

Your suggestion has been agreed on and tested and it’s working.

Thanks so much

Best Regards,

On Wed, Jul 15, 2015 at 12:30 PM Joseph Djomeda joseph@djomeda.com wrote:

Hello Charles,

Thanks for your email. I think it makes sense.

Best Regards,

On Tue, Jul 14, 2015 at 7:21 PM Charles Johnson charles@chef.io wrote:

Joseph,

I feel that it’s always best to keep the config file close to the
application that’s being configured. If at all possible, I’d ask the team
that creates the pre-configured Joomla zip file that you’re consuming to
keep the .erb template in the zip file as well, and ask them to make it
their responsibility to keep your template up-to-date with config file
changes.

Then you can use a template resource in Chef like so:

template ‘/path/to/joomla_configuration.php’ do
local true
source '/my/local/joomla_configuration.php.erb’
end

This will have Chef pick up the template from the local filesystem,
rather than looking for it in the cookbook. You can then use Chef like to
manage the application’s configuration, and not have to worry about the
config file being packaged separately in a cookbook, away from the Joomla
application. The app and the config file can be packaged together.

--Charles

On July 14, 2015 at 11:49:45 AM, Joseph Djomeda (joseph@djomeda.com)
wrote:

Hello Guys,

I am trying to figure out things as I learn a little more in chef. I am
sorry if this is still basic for you gurus :slight_smile: , it’s because I learn
effectively by doing.

I posted in another thread decision that has to be taken between hosted
chef and aws opsworks. In any case nodes are in aws.

joomla site is zipped from staging server outside aws made accessible via
http. Since it’s a copy from a different environment its configuration.php
file has details of user,password,db,hostname,logs and tmp path on staging
environment.
To update that in production, I am to do search_file_replace_line or use
a full template and replace the one from staging env? I am thinking the
latter make sense but, it also means , I will need to keep the
configuration.php.erb for example updated as joomla releases a new version
with a slightly different configuraiton.php file. I am not too sure how
these things are done when it comes to maintain the version of joomla
through the configuration in the template.

Thank you in advance


Joseph Kodjo-Kuma Djomeda
check out my pains at : www.mycodingpains.com
We become what we think about ourselves…


Joseph Kodjo-Kuma Djomeda
check out my pains at : www.mycodingpains.com
We become what we think about ourselves…


Joseph Kodjo-Kuma Djomeda
check out my pains at : www.mycodingpains.com
We become what we think about ourselves…