FAQ
Hi,

I'm working on a module and run into an issue. I would like to install
multiple PHP versions from source. I know the preferred way is packages,
but I don't want to maintain a custom APT repository. I have two files:
install.pp which does the installation (download, extract, configure, make,
make install) and params.pp which provides parameters.

https://gist.github.com/gergoerdosi/4990967
https://gist.github.com/gergoerdosi/4991012

The first call to php::install::source { '5.3.21': } runs fine, however
when it reaches php::install::source { '5.4.11': }, it downloads 5.3.21
again instead 5.4.11. This is happening because the $url uses $version in
params.pp, which doesn't get updated on the second call. This an expected
behavior, but I don't know how else could I do it. What I want to do is to
provide parameters for the different PHP versions (different URL, configure
options etc). Any idea? My Puppet version is 2.7.19.

Gergo Erdosi

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Peter Brown at Feb 20, 2013 at 2:39 am
    Hi Gerdo,

    You are on the right track using a define but the problem is one of scope.
    The version parameter for your define will only get set once in your
    php::params class because classes are almost singletons in puppet (as in
    they can exist only once for a node no matter how many times you call them).
    You will have to set the configure parameters inside your define which will
    be ugly I know but there isn't any other way around it.
    I haven't used them but inline templates may help alleviate the ugliness.
    I would also recommend splitting your define out into a separate file so
    it's easier to maintain.

    Hope that helps.

    Pete.


    On 20 February 2013 09:04, wrote:

    Hi,

    I'm working on a module and run into an issue. I would like to install
    multiple PHP versions from source. I know the preferred way is packages,
    but I don't want to maintain a custom APT repository. I have two files:
    install.pp which does the installation (download, extract, configure, make,
    make install) and params.pp which provides parameters.

    https://gist.github.com/gergoerdosi/4990967
    https://gist.github.com/gergoerdosi/4991012

    The first call to php::install::source { '5.3.21': } runs fine, however
    when it reaches php::install::source { '5.4.11': }, it downloads 5.3.21
    again instead 5.4.11. This is happening because the $url uses $version in
    params.pp, which doesn't get updated on the second call. This an expected
    behavior, but I don't know how else could I do it. What I want to do is to
    provide parameters for the different PHP versions (different URL, configure
    options etc). Any idea? My Puppet version is 2.7.19.

    Gergo Erdosi

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Gergo at Feb 20, 2013 at 12:07 pm
    Hi Pete,

    I hoped there is a more elegant solution, but looks like there isn't. :) I
    can't test it today, but putting the variables inside define should work
    indeed. Thanks for the help!

    Gergo Erdosi

    On Wednesday, February 20, 2013 3:39:17 AM UTC+1, Pete wrote:

    Hi Gerdo,

    You are on the right track using a define but the problem is one of scope.
    The version parameter for your define will only get set once in your
    php::params class because classes are almost singletons in puppet (as in
    they can exist only once for a node no matter how many times you call them).
    You will have to set the configure parameters inside your define which
    will be ugly I know but there isn't any other way around it.
    I haven't used them but inline templates may help alleviate the ugliness.
    I would also recommend splitting your define out into a separate file so
    it's easier to maintain.

    Hope that helps.

    Pete.


    On 20 February 2013 09:04, <ge...@timble.net <javascript:>> wrote:

    Hi,

    I'm working on a module and run into an issue. I would like to install
    multiple PHP versions from source. I know the preferred way is packages,
    but I don't want to maintain a custom APT repository. I have two files:
    install.pp which does the installation (download, extract, configure, make,
    make install) and params.pp which provides parameters.

    https://gist.github.com/gergoerdosi/4990967
    https://gist.github.com/gergoerdosi/4991012

    The first call to php::install::source { '5.3.21': } runs fine, however
    when it reaches php::install::source { '5.4.11': }, it downloads 5.3.21
    again instead 5.4.11. This is happening because the $url uses $version in
    params.pp, which doesn't get updated on the second call. This an expected
    behavior, but I don't know how else could I do it. What I want to do is to
    provide parameters for the different PHP versions (different URL, configure
    options etc). Any idea? My Puppet version is 2.7.19.

    Gergo Erdosi

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to puppet-users...@googlegroups.com <javascript:>.
    To post to this group, send email to puppet...@googlegroups.com<javascript:>
    .
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jcbollinger at Feb 20, 2013 at 1:56 pm

    On Tuesday, February 19, 2013 5:04:36 PM UTC-6, ge...@timble.net wrote:
    Hi,

    I'm working on a module and run into an issue. I would like to install
    multiple PHP versions from source.

    Yes, that is an issue.


    I know the preferred way is packages, but I don't want to maintain a
    custom APT repository.

    There are good reasons why packages are the preferred way. Why don't you
    want to maintain a custom repository?


    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Gergo at Feb 20, 2013 at 2:48 pm
    Hi John,

    This Puppet module will be for a Vagrant development environment for about
    5-10 people in our team. Setting up an APT repository and building packages
    each time there is a new release takes too much time. If we used it on
    production, I would definitely create packages, but I don't see the need in
    this case.

    Gergo Erdosi

    On Wednesday, February 20, 2013 2:56:29 PM UTC+1, jcbollinger wrote:


    On Tuesday, February 19, 2013 5:04:36 PM UTC-6, ge...@timble.net wrote:

    Hi,

    I'm working on a module and run into an issue. I would like to install
    multiple PHP versions from source.

    Yes, that is an issue.


    I know the preferred way is packages, but I don't want to maintain a
    custom APT repository.

    There are good reasons why packages are the preferred way. Why don't you
    want to maintain a custom repository?


    John
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jcbollinger at Feb 20, 2013 at 3:08 pm

    On Wednesday, February 20, 2013 8:40:48 AM UTC-6, ge...@timble.net wrote:
    Hi John,

    This Puppet module will be for a Vagrant development environment for about
    5-10 people in our team. Setting up an APT repository and building packages
    each time there is a new release takes too much time. If we used it on
    production, I would definitely create packages, but I don't see the need in
    this case.
    You will do as you think best, of course.

    I can't believe, however, that setting up an APT repository is much harder
    than setting up a YUM repository, which takes maybe five minutes for the
    basic setup, and almost no time to add / remove packages.

    As for building packages, it's no harder to build packages than to teach
    Puppet to install the same software from source. You may need to get over
    a learning curve, but even that may be minimal if you start from existing
    packaging for some version of the software you want to build. For the cost
    of a bit of time spent learning a useful skill, you would gain use of
    packages for managing the software on your systems, which is a big
    advantage even before Puppet is considered.

    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedFeb 20, '13 at 12:02a
activeFeb 20, '13 at 3:08p
posts6
users3
websitepuppetlabs.com

3 users in discussion

Gergo: 3 posts Jcbollinger: 2 posts Peter Brown: 1 post

People

Translate

site design / logo © 2022 Grokbase