On Thu, Sep 04, 2014 at 11:06:44AM -0700, Bogdan Baba wrote: > H Guys, > I'm kind of new to puppet and programming I've made a few simpler modules > so far but i'm trying to expand and build them better and i think i'm > hitting my "i don't get programming logic bar". > For example i'm trying to build a module that will take parameters such as > php_version=variable and based on that i can install either php 5.3 5.4 > or 5.5 and the necessary yum repo's. > I'm not getting anywhere and was wandering if my case logic and how i > request the variable is correct . > I cannot get to where it just installs the packages i need based on > php_version. > Thank you! > Bogdan > site.pp(node) > $php_version='php55' > include php > php/init.pp
Sounds like that should be php/manifests/init.pp? Also for the other manifests below. https://docs.puppetlabs.com/puppet/latest/reference/modules_fundamentals.html > class php { > include php::install > include php::params > } > php/params.pp > class php::params { > case $php_version { > 'php55': { > $installrepo = "remi-php55" > $package_prefix ="php55" > } > 'php54': { > $installrepo = "remi" > $package_prefix ="php54" > } > 'php53': { > $installrepo = "epel" > $package_prefix ="php" > } > } > } > php/install.pp > class php::install { > include php::params > $packlist = [ "$package_prefix", "$package_prefix-gd", > "$package_prefix-pear", "$package_prefix-devel", "$package_prefix-bcmath", > "$package_prefix-cli", "$package_prefix-fpm", "$package_prefix-imap", > "$package_prefix-mbstring", "$package_prefix-mcrypt", > "$package_prefix-mysql", "$package_prefix-pdo", > "$package_prefix-pecl-apc", "$package_prefix-pecl-memcache", > "$package_prefix-pecl-memcached", "$package_prefix-pecl-sphinx", > "$package_prefix-soap", "$package_prefix-xml" ] > package { "$packlist": > ensure => "latest", > } > } > > -- > 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 [1][email protected]. > To view this discussion on the web visit > > [2]https://groups.google.com/d/msgid/puppet-users/c3e1e83d-5dd4-4f2f-a6d7-043843b99250%40googlegroups.com. > For more options, visit [3]https://groups.google.com/d/optout. > > References > > Visible links > 1. mailto:[email protected] > 2. > https://groups.google.com/d/msgid/puppet-users/c3e1e83d-5dd4-4f2f-a6d7-043843b99250%40googlegroups.com?utm_medium=email&utm_source=footer > 3. https://groups.google.com/d/optout -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20140904182604.GA6425%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.
