You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Akila Ravihansa Perera <ra...@wso2.com> on 2014/04/12 07:45:09 UTC

Create a base Puppet module

Hi,

I was thinking that we could simplify cartridge creation process by
creating a base Puppet module which would install common tools like zip,
unzip, tar, wget and also include Java module in this base module.

Basically, the module structure will be like this (not tested);

node /base/ {

    <declarations here>

}


class base {

   package { 'unzip': ensure => installed }
   package { 'tar': ensure => installed }
   package { 'wget': ensure => installed }

   class {'java'}
   class {'agent':}

   Class['java'] ~> Class['agent']

}


Then other Stratos module can include this

node /lb/ inherits base {
  class {'lb': maintenance_mode   => 'norestart',}
}

This will remove lot of redundancy and ugly dependencies we have
now....WDYT?


-- 
Akila Ravihansa Perera
Software Engineer
WSO2 Inc.
http://wso2.com

Phone: +94 77 64 154 38
Blog: http://ravihansa3000.blogspot.com

Re: Create a base Puppet module

Posted by Thilina Piyasundara <th...@gmail.com>.
IMO it is better to use a base class which contains all the basic things
like wget, unzip, etc. Create a switch in the init.pp file then you can
select what to install and what not to.

Eg :-

stratos-base
├── files
├── LICENSE
├── manifests
│   ├── environment.pp
│   ├── hosts.pp
│   ├── init.pp
│   ├── java.pp
│   ├── maven.pp
│   ├── packages.pp
│   ├── params.pp
│   └── users.pp
├── metadata.json
├── Modulefile
├── README
├── spec
│   └── spec_helper.rb
 |── templates
   ├── environment.erb
   └── hosts.erb


in nodes.pp

node base {

<your configs>

  class { 'stratos-base':
    java => true,
    php => false,
    packages => [ "wget", "htop", "tree" ],

   }

}


node sc.node inherits base {

<your node configs>

}


But it's always better if you can use pre-setuped AMIs or images to reduce
puppeting time in the bootup process.



On Sun, Apr 13, 2014 at 9:50 AM, Akila Ravihansa Perera
<ra...@wso2.com>wrote:

> Hi Nirmal,
>
> I think I may have not clearly explained the reasons behind the suggested
> structure. So I'll list down some of the problems we have in the current
> cartridge creation process. These are not major issues but would be nice to
> make it cleaner before the release :-)
>
> As for the installation of Puppet master/agent, we don't need zip, unzip
> or wget (or anything). The puppetinstall script just do a simple "apt-get
> install puppet/puppetmaster". We need wget just to download this
> puppetinstall and config shell scripts from Stratos Git repo. We can
> transfer those scripts to the instance via ssh from another machine. But
> still, Puppet does *not* install wget anyway, it just *assumes* wget is
> already installed (we only need that to download installation scripts from
> Stratos Git repo). Usually wget is already present in almost every
> distribution.
>
> 1. zip/unzip has to be installed *manually* in the current workflow [1]
> But this can be done via Puppet. It makes no sense to let users install
> zip/unzip manually when we're using Puppet.
>
> 2. While I was trying to include zip/unzip package to a Puppet module, I
> couldn't find a base *class* to add this. I know we have a base *node* but
> the official Puppet documentation says we should not include package
> declarations in node blocks (nodes.pp).
>
> 3. Therefore we need a base class to include all those common tools. We
> can consider Stratos agent, zip, unzip, tar and Java as common tools. I
> believe every cartridge instance must have those?
>
> 4. Currently we don't have a base *class* to include those packages. I
> could include that to Java class since it is being required by all other
> *nodes* but it will be a very ugly dependency.
>
> 5. Actually I tried doing that (and it works too), but when I try to
> create a php cartridge it throws this "package already defined error".
> Further investigation revealed that php class has included "zip/unzip"
> package, hence it doesn't allow any other class to include that
> package....that doesn't make any sense to include zip/unzip only in php
> class.
>
> 5. In each *node* declaration, we have this "require java" and "class
> {'agent'}" statements. If we are using inheritance, we don't need this in
> every node, IMO. We could move that to base node block.
>
> If you're convinced this needs to be re-factored, I could work on a patch.
> Otherwise, apologies for the noise.
>
> [1] -
> https://cwiki.apache.org/confluence/display/STRATOS/4.0.0+Creating+a+Cartridge+Image+on+EC2+or+OpenStack
>
>
> Thanks.
>
>
> On Sat, Apr 12, 2014 at 6:47 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> We already have a 'base' node AFAIS and all the other nodes inherited
>> from that.
>>
>>
>> On Sat, Apr 12, 2014 at 1:52 PM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>>
>>> On Sat, Apr 12, 2014 at 1:02 PM, Nirmal Fernando <nirmal070125@gmail.com
>>> > wrote:
>>>
>>>>
>>>>
>>>>
>>>> On Sat, Apr 12, 2014 at 12:49 PM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> Hi Nirmal,
>>>>>
>>>>> We don't need zip/unzip to install Puppet. Actually I managed to
>>>>> install a default node without zip/unzip by adding package { 'unzip':
>>>>> ensure => installed } to Puppet Java module.
>>>>>
>>>>
>>>> Well, we still need wget? :-)
>>>>
>>>
>>> Not really...we need wget just to download installation scripts. This
>>> can be done via ssh :-)
>>>
>>
>> SSH from where?
>>
>>>
>>>>> What I'm trying to address is the redundant code in current Puppet
>>>>> master module structure. Currently we have "require java", class
>>>>> {'agent':} on each module, which can be avoided by creating a base module
>>>>> and other modules can inherit stuff from this.
>>>>>
>>>>> For eg. php module has  package { 'zip': ensure => installed }
>>>>> dependency, and also Java module need this package as well. Instead of
>>>>> putting these common tools in individual classes we can create a base class
>>>>> and others will inherit stuff from this.
>>>>>
>>>>
>>>> :-) if you check the nodes.pp file, we already leverage puppet
>>>> inheritance.
>>>>
>>>
>>> Yes, but Puppet classes do not :-)
>>>
>>>>
>>>>> If you're interested, I can create a patch for this to be reviewed.
>>>>>
>>>>
>>>> It's better if you test it fully for all the existing scenarios
>>>> (judgemental) and I think these improvements can go for 4.1 but not for
>>>> 4.0, since we're wrapping up 4.0 and this is not a blocker.
>>>>
>>>
>>> Absolutely :-)
>>>
>>> How about we add zip/unzip packages + Stratos agent class declaration
>>> (common tools) to a base *class* and have other *classes* inherit from that?
>>>
>>>>
>>>>>
>>>>> On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando <
>>>>> nirmal070125@gmail.com> wrote:
>>>>>
>>>>>> Hi Akila,
>>>>>>
>>>>>> If you have a look at the current nodes.pp file, Dinesh have already
>>>>>> added a default section, which will be used to create a base image with
>>>>>> minimal software (without wget, zip).
>>>>>>
>>>>>> What problems you are trying to address here? Is it to avoid the
>>>>>> redundant code in nodes.pp file? Cause to install puppet you need these
>>>>>> wget etc. packages, hence no point of adding it in the default node.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <
>>>>>> ravihansa@wso2.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I was thinking that we could simplify cartridge creation process by
>>>>>>> creating a base Puppet module which would install common tools like zip,
>>>>>>> unzip, tar, wget and also include Java module in this base module.
>>>>>>>
>>>>>>> Basically, the module structure will be like this (not tested);
>>>>>>>
>>>>>>> node /base/ {
>>>>>>>
>>>>>>>     <declarations here>
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> class base {
>>>>>>>
>>>>>>>    package { 'unzip': ensure => installed }
>>>>>>>    package { 'tar': ensure => installed }
>>>>>>>    package { 'wget': ensure => installed }
>>>>>>>
>>>>>>>    class {'java'}
>>>>>>>    class {'agent':}
>>>>>>>
>>>>>>>    Class['java'] ~> Class['agent']
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Then other Stratos module can include this
>>>>>>>
>>>>>>> node /lb/ inherits base {
>>>>>>>   class {'lb': maintenance_mode   => 'norestart',}
>>>>>>> }
>>>>>>>
>>>>>>> This will remove lot of redundancy and ugly dependencies we have
>>>>>>> now....WDYT?
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Akila Ravihansa Perera
>>>>>>> Software Engineer
>>>>>>> WSO2 Inc.
>>>>>>> http://wso2.com
>>>>>>>
>>>>>>> Phone: +94 77 64 154 38
>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Best Regards,
>>>>>> Nirmal
>>>>>>
>>>>>> Nirmal Fernando.
>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>
>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Akila Ravihansa Perera
>>>>> Software Engineer
>>>>> WSO2 Inc.
>>>>> http://wso2.com
>>>>>
>>>>> Phone: +94 77 64 154 38
>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> Software Engineer
>>> WSO2 Inc.
>>> http://wso2.com
>>>
>>> Phone: +94 77 64 154 38
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Akila Ravihansa Perera
> Software Engineer
> WSO2 Inc.
> http://wso2.com
>
> Phone: +94 77 64 154 38
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Thanks and regards,
Thilina Piyasundara.

Re: Create a base Puppet module

Posted by Nirmal Fernando <ni...@gmail.com>.
+1, as long as you don't break anything :-)


On Sun, Apr 13, 2014 at 9:50 AM, Akila Ravihansa Perera
<ra...@wso2.com>wrote:

> Hi Nirmal,
>
> I think I may have not clearly explained the reasons behind the suggested
> structure. So I'll list down some of the problems we have in the current
> cartridge creation process. These are not major issues but would be nice to
> make it cleaner before the release :-)
>
> As for the installation of Puppet master/agent, we don't need zip, unzip
> or wget (or anything). The puppetinstall script just do a simple "apt-get
> install puppet/puppetmaster". We need wget just to download this
> puppetinstall and config shell scripts from Stratos Git repo. We can
> transfer those scripts to the instance via ssh from another machine. But
> still, Puppet does *not* install wget anyway, it just *assumes* wget is
> already installed (we only need that to download installation scripts from
> Stratos Git repo). Usually wget is already present in almost every
> distribution.
>
> 1. zip/unzip has to be installed *manually* in the current workflow [1]
> But this can be done via Puppet. It makes no sense to let users install
> zip/unzip manually when we're using Puppet.
>
> 2. While I was trying to include zip/unzip package to a Puppet module, I
> couldn't find a base *class* to add this. I know we have a base *node* but
> the official Puppet documentation says we should not include package
> declarations in node blocks (nodes.pp).
>
> 3. Therefore we need a base class to include all those common tools. We
> can consider Stratos agent, zip, unzip, tar and Java as common tools. I
> believe every cartridge instance must have those?
>
> 4. Currently we don't have a base *class* to include those packages. I
> could include that to Java class since it is being required by all other
> *nodes* but it will be a very ugly dependency.
>
> 5. Actually I tried doing that (and it works too), but when I try to
> create a php cartridge it throws this "package already defined error".
> Further investigation revealed that php class has included "zip/unzip"
> package, hence it doesn't allow any other class to include that
> package....that doesn't make any sense to include zip/unzip only in php
> class.
>
> 5. In each *node* declaration, we have this "require java" and "class
> {'agent'}" statements. If we are using inheritance, we don't need this in
> every node, IMO. We could move that to base node block.
>
> If you're convinced this needs to be re-factored, I could work on a patch.
> Otherwise, apologies for the noise.
>
> [1] -
> https://cwiki.apache.org/confluence/display/STRATOS/4.0.0+Creating+a+Cartridge+Image+on+EC2+or+OpenStack
>
>
> Thanks.
>
>
> On Sat, Apr 12, 2014 at 6:47 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> We already have a 'base' node AFAIS and all the other nodes inherited
>> from that.
>>
>>
>> On Sat, Apr 12, 2014 at 1:52 PM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>>
>>> On Sat, Apr 12, 2014 at 1:02 PM, Nirmal Fernando <nirmal070125@gmail.com
>>> > wrote:
>>>
>>>>
>>>>
>>>>
>>>> On Sat, Apr 12, 2014 at 12:49 PM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> Hi Nirmal,
>>>>>
>>>>> We don't need zip/unzip to install Puppet. Actually I managed to
>>>>> install a default node without zip/unzip by adding package { 'unzip':
>>>>> ensure => installed } to Puppet Java module.
>>>>>
>>>>
>>>> Well, we still need wget? :-)
>>>>
>>>
>>> Not really...we need wget just to download installation scripts. This
>>> can be done via ssh :-)
>>>
>>
>> SSH from where?
>>
>>>
>>>>> What I'm trying to address is the redundant code in current Puppet
>>>>> master module structure. Currently we have "require java", class
>>>>> {'agent':} on each module, which can be avoided by creating a base module
>>>>> and other modules can inherit stuff from this.
>>>>>
>>>>> For eg. php module has  package { 'zip': ensure => installed }
>>>>> dependency, and also Java module need this package as well. Instead of
>>>>> putting these common tools in individual classes we can create a base class
>>>>> and others will inherit stuff from this.
>>>>>
>>>>
>>>> :-) if you check the nodes.pp file, we already leverage puppet
>>>> inheritance.
>>>>
>>>
>>> Yes, but Puppet classes do not :-)
>>>
>>>>
>>>>> If you're interested, I can create a patch for this to be reviewed.
>>>>>
>>>>
>>>> It's better if you test it fully for all the existing scenarios
>>>> (judgemental) and I think these improvements can go for 4.1 but not for
>>>> 4.0, since we're wrapping up 4.0 and this is not a blocker.
>>>>
>>>
>>> Absolutely :-)
>>>
>>> How about we add zip/unzip packages + Stratos agent class declaration
>>> (common tools) to a base *class* and have other *classes* inherit from that?
>>>
>>>>
>>>>>
>>>>> On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando <
>>>>> nirmal070125@gmail.com> wrote:
>>>>>
>>>>>> Hi Akila,
>>>>>>
>>>>>> If you have a look at the current nodes.pp file, Dinesh have already
>>>>>> added a default section, which will be used to create a base image with
>>>>>> minimal software (without wget, zip).
>>>>>>
>>>>>> What problems you are trying to address here? Is it to avoid the
>>>>>> redundant code in nodes.pp file? Cause to install puppet you need these
>>>>>> wget etc. packages, hence no point of adding it in the default node.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <
>>>>>> ravihansa@wso2.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I was thinking that we could simplify cartridge creation process by
>>>>>>> creating a base Puppet module which would install common tools like zip,
>>>>>>> unzip, tar, wget and also include Java module in this base module.
>>>>>>>
>>>>>>> Basically, the module structure will be like this (not tested);
>>>>>>>
>>>>>>> node /base/ {
>>>>>>>
>>>>>>>     <declarations here>
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> class base {
>>>>>>>
>>>>>>>    package { 'unzip': ensure => installed }
>>>>>>>    package { 'tar': ensure => installed }
>>>>>>>    package { 'wget': ensure => installed }
>>>>>>>
>>>>>>>    class {'java'}
>>>>>>>    class {'agent':}
>>>>>>>
>>>>>>>    Class['java'] ~> Class['agent']
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Then other Stratos module can include this
>>>>>>>
>>>>>>> node /lb/ inherits base {
>>>>>>>   class {'lb': maintenance_mode   => 'norestart',}
>>>>>>> }
>>>>>>>
>>>>>>> This will remove lot of redundancy and ugly dependencies we have
>>>>>>> now....WDYT?
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Akila Ravihansa Perera
>>>>>>> Software Engineer
>>>>>>> WSO2 Inc.
>>>>>>> http://wso2.com
>>>>>>>
>>>>>>> Phone: +94 77 64 154 38
>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Best Regards,
>>>>>> Nirmal
>>>>>>
>>>>>> Nirmal Fernando.
>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>
>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Akila Ravihansa Perera
>>>>> Software Engineer
>>>>> WSO2 Inc.
>>>>> http://wso2.com
>>>>>
>>>>> Phone: +94 77 64 154 38
>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> Software Engineer
>>> WSO2 Inc.
>>> http://wso2.com
>>>
>>> Phone: +94 77 64 154 38
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Akila Ravihansa Perera
> Software Engineer
> WSO2 Inc.
> http://wso2.com
>
> Phone: +94 77 64 154 38
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Re: Create a base Puppet module

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Nirmal,

I think I may have not clearly explained the reasons behind the suggested
structure. So I'll list down some of the problems we have in the current
cartridge creation process. These are not major issues but would be nice to
make it cleaner before the release :-)

As for the installation of Puppet master/agent, we don't need zip, unzip or
wget (or anything). The puppetinstall script just do a simple "apt-get
install puppet/puppetmaster". We need wget just to download this
puppetinstall and config shell scripts from Stratos Git repo. We can
transfer those scripts to the instance via ssh from another machine. But
still, Puppet does *not* install wget anyway, it just *assumes* wget is
already installed (we only need that to download installation scripts from
Stratos Git repo). Usually wget is already present in almost every
distribution.

1. zip/unzip has to be installed *manually* in the current workflow [1]
But this can be done via Puppet. It makes no sense to let users install
zip/unzip manually when we're using Puppet.

2. While I was trying to include zip/unzip package to a Puppet module, I
couldn't find a base *class* to add this. I know we have a base *node* but
the official Puppet documentation says we should not include package
declarations in node blocks (nodes.pp).

3. Therefore we need a base class to include all those common tools. We can
consider Stratos agent, zip, unzip, tar and Java as common tools. I believe
every cartridge instance must have those?

4. Currently we don't have a base *class* to include those packages. I
could include that to Java class since it is being required by all other
*nodes* but it will be a very ugly dependency.

5. Actually I tried doing that (and it works too), but when I try to create
a php cartridge it throws this "package already defined error". Further
investigation revealed that php class has included "zip/unzip" package,
hence it doesn't allow any other class to include that package....that
doesn't make any sense to include zip/unzip only in php class.

5. In each *node* declaration, we have this "require java" and "class
{'agent'}" statements. If we are using inheritance, we don't need this in
every node, IMO. We could move that to base node block.

If you're convinced this needs to be re-factored, I could work on a patch.
Otherwise, apologies for the noise.

[1] -
https://cwiki.apache.org/confluence/display/STRATOS/4.0.0+Creating+a+Cartridge+Image+on+EC2+or+OpenStack


Thanks.


On Sat, Apr 12, 2014 at 6:47 PM, Nirmal Fernando <ni...@gmail.com>wrote:

> We already have a 'base' node AFAIS and all the other nodes inherited from
> that.
>
>
> On Sat, Apr 12, 2014 at 1:52 PM, Akila Ravihansa Perera <
> ravihansa@wso2.com> wrote:
>
>>
>> On Sat, Apr 12, 2014 at 1:02 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>
>>>
>>>
>>>
>>> On Sat, Apr 12, 2014 at 12:49 PM, Akila Ravihansa Perera <
>>> ravihansa@wso2.com> wrote:
>>>
>>>> Hi Nirmal,
>>>>
>>>> We don't need zip/unzip to install Puppet. Actually I managed to
>>>> install a default node without zip/unzip by adding package { 'unzip':
>>>> ensure => installed } to Puppet Java module.
>>>>
>>>
>>> Well, we still need wget? :-)
>>>
>>
>> Not really...we need wget just to download installation scripts. This can
>> be done via ssh :-)
>>
>
> SSH from where?
>
>>
>>>> What I'm trying to address is the redundant code in current Puppet
>>>> master module structure. Currently we have "require java", class
>>>> {'agent':} on each module, which can be avoided by creating a base module
>>>> and other modules can inherit stuff from this.
>>>>
>>>> For eg. php module has  package { 'zip': ensure => installed }
>>>> dependency, and also Java module need this package as well. Instead of
>>>> putting these common tools in individual classes we can create a base class
>>>> and others will inherit stuff from this.
>>>>
>>>
>>> :-) if you check the nodes.pp file, we already leverage puppet
>>> inheritance.
>>>
>>
>> Yes, but Puppet classes do not :-)
>>
>>>
>>>> If you're interested, I can create a patch for this to be reviewed.
>>>>
>>>
>>> It's better if you test it fully for all the existing scenarios
>>> (judgemental) and I think these improvements can go for 4.1 but not for
>>> 4.0, since we're wrapping up 4.0 and this is not a blocker.
>>>
>>
>> Absolutely :-)
>>
>> How about we add zip/unzip packages + Stratos agent class declaration
>> (common tools) to a base *class* and have other *classes* inherit from that?
>>
>>>
>>>>
>>>> On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando <
>>>> nirmal070125@gmail.com> wrote:
>>>>
>>>>> Hi Akila,
>>>>>
>>>>> If you have a look at the current nodes.pp file, Dinesh have already
>>>>> added a default section, which will be used to create a base image with
>>>>> minimal software (without wget, zip).
>>>>>
>>>>> What problems you are trying to address here? Is it to avoid the
>>>>> redundant code in nodes.pp file? Cause to install puppet you need these
>>>>> wget etc. packages, hence no point of adding it in the default node.
>>>>>
>>>>>
>>>>>
>>>>> On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <
>>>>> ravihansa@wso2.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I was thinking that we could simplify cartridge creation process by
>>>>>> creating a base Puppet module which would install common tools like zip,
>>>>>> unzip, tar, wget and also include Java module in this base module.
>>>>>>
>>>>>> Basically, the module structure will be like this (not tested);
>>>>>>
>>>>>> node /base/ {
>>>>>>
>>>>>>     <declarations here>
>>>>>>
>>>>>> }
>>>>>>
>>>>>>
>>>>>> class base {
>>>>>>
>>>>>>    package { 'unzip': ensure => installed }
>>>>>>    package { 'tar': ensure => installed }
>>>>>>    package { 'wget': ensure => installed }
>>>>>>
>>>>>>    class {'java'}
>>>>>>    class {'agent':}
>>>>>>
>>>>>>    Class['java'] ~> Class['agent']
>>>>>>
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Then other Stratos module can include this
>>>>>>
>>>>>> node /lb/ inherits base {
>>>>>>   class {'lb': maintenance_mode   => 'norestart',}
>>>>>> }
>>>>>>
>>>>>> This will remove lot of redundancy and ugly dependencies we have
>>>>>> now....WDYT?
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Akila Ravihansa Perera
>>>>>> Software Engineer
>>>>>> WSO2 Inc.
>>>>>> http://wso2.com
>>>>>>
>>>>>> Phone: +94 77 64 154 38
>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Best Regards,
>>>>> Nirmal
>>>>>
>>>>> Nirmal Fernando.
>>>>> PPMC Member & Committer of Apache Stratos,
>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>
>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Akila Ravihansa Perera
>>>> Software Engineer
>>>> WSO2 Inc.
>>>> http://wso2.com
>>>>
>>>> Phone: +94 77 64 154 38
>>>> Blog: http://ravihansa3000.blogspot.com
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> Software Engineer
>> WSO2 Inc.
>> http://wso2.com
>>
>> Phone: +94 77 64 154 38
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Akila Ravihansa Perera
Software Engineer
WSO2 Inc.
http://wso2.com

Phone: +94 77 64 154 38
Blog: http://ravihansa3000.blogspot.com

Re: Create a base Puppet module

Posted by Nirmal Fernando <ni...@gmail.com>.
We already have a 'base' node AFAIS and all the other nodes inherited from
that.


On Sat, Apr 12, 2014 at 1:52 PM, Akila Ravihansa Perera
<ra...@wso2.com>wrote:

>
> On Sat, Apr 12, 2014 at 1:02 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>>
>>
>>
>> On Sat, Apr 12, 2014 at 12:49 PM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> Hi Nirmal,
>>>
>>> We don't need zip/unzip to install Puppet. Actually I managed to install
>>> a default node without zip/unzip by adding package { 'unzip': ensure =>
>>> installed } to Puppet Java module.
>>>
>>
>> Well, we still need wget? :-)
>>
>
> Not really...we need wget just to download installation scripts. This can
> be done via ssh :-)
>

SSH from where?

>
>>> What I'm trying to address is the redundant code in current Puppet
>>> master module structure. Currently we have "require java", class
>>> {'agent':} on each module, which can be avoided by creating a base module
>>> and other modules can inherit stuff from this.
>>>
>>> For eg. php module has  package { 'zip': ensure => installed }
>>> dependency, and also Java module need this package as well. Instead of
>>> putting these common tools in individual classes we can create a base class
>>> and others will inherit stuff from this.
>>>
>>
>> :-) if you check the nodes.pp file, we already leverage puppet
>> inheritance.
>>
>
> Yes, but Puppet classes do not :-)
>
>>
>>> If you're interested, I can create a patch for this to be reviewed.
>>>
>>
>> It's better if you test it fully for all the existing scenarios
>> (judgemental) and I think these improvements can go for 4.1 but not for
>> 4.0, since we're wrapping up 4.0 and this is not a blocker.
>>
>
> Absolutely :-)
>
> How about we add zip/unzip packages + Stratos agent class declaration
> (common tools) to a base *class* and have other *classes* inherit from that?
>
>>
>>>
>>> On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando <
>>> nirmal070125@gmail.com> wrote:
>>>
>>>> Hi Akila,
>>>>
>>>> If you have a look at the current nodes.pp file, Dinesh have already
>>>> added a default section, which will be used to create a base image with
>>>> minimal software (without wget, zip).
>>>>
>>>> What problems you are trying to address here? Is it to avoid the
>>>> redundant code in nodes.pp file? Cause to install puppet you need these
>>>> wget etc. packages, hence no point of adding it in the default node.
>>>>
>>>>
>>>>
>>>> On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I was thinking that we could simplify cartridge creation process by
>>>>> creating a base Puppet module which would install common tools like zip,
>>>>> unzip, tar, wget and also include Java module in this base module.
>>>>>
>>>>> Basically, the module structure will be like this (not tested);
>>>>>
>>>>> node /base/ {
>>>>>
>>>>>     <declarations here>
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>> class base {
>>>>>
>>>>>    package { 'unzip': ensure => installed }
>>>>>    package { 'tar': ensure => installed }
>>>>>    package { 'wget': ensure => installed }
>>>>>
>>>>>    class {'java'}
>>>>>    class {'agent':}
>>>>>
>>>>>    Class['java'] ~> Class['agent']
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>> Then other Stratos module can include this
>>>>>
>>>>> node /lb/ inherits base {
>>>>>   class {'lb': maintenance_mode   => 'norestart',}
>>>>> }
>>>>>
>>>>> This will remove lot of redundancy and ugly dependencies we have
>>>>> now....WDYT?
>>>>>
>>>>>
>>>>> --
>>>>> Akila Ravihansa Perera
>>>>> Software Engineer
>>>>> WSO2 Inc.
>>>>> http://wso2.com
>>>>>
>>>>> Phone: +94 77 64 154 38
>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> Software Engineer
>>> WSO2 Inc.
>>> http://wso2.com
>>>
>>> Phone: +94 77 64 154 38
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Akila Ravihansa Perera
> Software Engineer
> WSO2 Inc.
> http://wso2.com
>
> Phone: +94 77 64 154 38
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Re: Create a base Puppet module

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
On Sat, Apr 12, 2014 at 1:02 PM, Nirmal Fernando <ni...@gmail.com>wrote:

>
>
>
> On Sat, Apr 12, 2014 at 12:49 PM, Akila Ravihansa Perera <
> ravihansa@wso2.com> wrote:
>
>> Hi Nirmal,
>>
>> We don't need zip/unzip to install Puppet. Actually I managed to install
>> a default node without zip/unzip by adding package { 'unzip': ensure =>
>> installed } to Puppet Java module.
>>
>
> Well, we still need wget? :-)
>

Not really...we need wget just to download installation scripts. This can
be done via ssh :-)

>
>> What I'm trying to address is the redundant code in current Puppet master
>> module structure. Currently we have "require java", class {'agent':} on
>> each module, which can be avoided by creating a base module and other
>> modules can inherit stuff from this.
>>
>> For eg. php module has  package { 'zip': ensure => installed }
>> dependency, and also Java module need this package as well. Instead of
>> putting these common tools in individual classes we can create a base class
>> and others will inherit stuff from this.
>>
>
> :-) if you check the nodes.pp file, we already leverage puppet
> inheritance.
>

Yes, but Puppet classes do not :-)

>
>> If you're interested, I can create a patch for this to be reviewed.
>>
>
> It's better if you test it fully for all the existing scenarios
> (judgemental) and I think these improvements can go for 4.1 but not for
> 4.0, since we're wrapping up 4.0 and this is not a blocker.
>

Absolutely :-)

How about we add zip/unzip packages + Stratos agent class declaration
(common tools) to a base *class* and have other *classes* inherit from that?

>
>>
>> On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando <nirmal070125@gmail.com
>> > wrote:
>>
>>> Hi Akila,
>>>
>>> If you have a look at the current nodes.pp file, Dinesh have already
>>> added a default section, which will be used to create a base image with
>>> minimal software (without wget, zip).
>>>
>>> What problems you are trying to address here? Is it to avoid the
>>> redundant code in nodes.pp file? Cause to install puppet you need these
>>> wget etc. packages, hence no point of adding it in the default node.
>>>
>>>
>>>
>>> On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <
>>> ravihansa@wso2.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I was thinking that we could simplify cartridge creation process by
>>>> creating a base Puppet module which would install common tools like zip,
>>>> unzip, tar, wget and also include Java module in this base module.
>>>>
>>>> Basically, the module structure will be like this (not tested);
>>>>
>>>> node /base/ {
>>>>
>>>>     <declarations here>
>>>>
>>>> }
>>>>
>>>>
>>>> class base {
>>>>
>>>>    package { 'unzip': ensure => installed }
>>>>    package { 'tar': ensure => installed }
>>>>    package { 'wget': ensure => installed }
>>>>
>>>>    class {'java'}
>>>>    class {'agent':}
>>>>
>>>>    Class['java'] ~> Class['agent']
>>>>
>>>> }
>>>>
>>>>
>>>> Then other Stratos module can include this
>>>>
>>>> node /lb/ inherits base {
>>>>   class {'lb': maintenance_mode   => 'norestart',}
>>>> }
>>>>
>>>> This will remove lot of redundancy and ugly dependencies we have
>>>> now....WDYT?
>>>>
>>>>
>>>> --
>>>> Akila Ravihansa Perera
>>>> Software Engineer
>>>> WSO2 Inc.
>>>> http://wso2.com
>>>>
>>>> Phone: +94 77 64 154 38
>>>> Blog: http://ravihansa3000.blogspot.com
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> Software Engineer
>> WSO2 Inc.
>> http://wso2.com
>>
>> Phone: +94 77 64 154 38
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Akila Ravihansa Perera
Software Engineer
WSO2 Inc.
http://wso2.com

Phone: +94 77 64 154 38
Blog: http://ravihansa3000.blogspot.com

Re: Create a base Puppet module

Posted by Nirmal Fernando <ni...@gmail.com>.
On Sat, Apr 12, 2014 at 12:49 PM, Akila Ravihansa Perera <ravihansa@wso2.com
> wrote:

> Hi Nirmal,
>
> We don't need zip/unzip to install Puppet. Actually I managed to install a
> default node without zip/unzip by adding package { 'unzip': ensure =>
> installed } to Puppet Java module.
>

Well, we still need wget? :-)

>
> What I'm trying to address is the redundant code in current Puppet master
> module structure. Currently we have "require java", class {'agent':} on
> each module, which can be avoided by creating a base module and other
> modules can inherit stuff from this.
>
> For eg. php module has  package { 'zip': ensure => installed }
> dependency, and also Java module need this package as well. Instead of
> putting these common tools in individual classes we can create a base class
> and others will inherit stuff from this.
>

:-) if you check the nodes.pp file, we already leverage puppet inheritance.

>
> If you're interested, I can create a patch for this to be reviewed.
>

It's better if you test it fully for all the existing scenarios
(judgemental) and I think these improvements can go for 4.1 but not for
4.0, since we're wrapping up 4.0 and this is not a blocker.

>
>
> On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> Hi Akila,
>>
>> If you have a look at the current nodes.pp file, Dinesh have already
>> added a default section, which will be used to create a base image with
>> minimal software (without wget, zip).
>>
>> What problems you are trying to address here? Is it to avoid the
>> redundant code in nodes.pp file? Cause to install puppet you need these
>> wget etc. packages, hence no point of adding it in the default node.
>>
>>
>>
>> On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I was thinking that we could simplify cartridge creation process by
>>> creating a base Puppet module which would install common tools like zip,
>>> unzip, tar, wget and also include Java module in this base module.
>>>
>>> Basically, the module structure will be like this (not tested);
>>>
>>> node /base/ {
>>>
>>>     <declarations here>
>>>
>>> }
>>>
>>>
>>> class base {
>>>
>>>    package { 'unzip': ensure => installed }
>>>    package { 'tar': ensure => installed }
>>>    package { 'wget': ensure => installed }
>>>
>>>    class {'java'}
>>>    class {'agent':}
>>>
>>>    Class['java'] ~> Class['agent']
>>>
>>> }
>>>
>>>
>>> Then other Stratos module can include this
>>>
>>> node /lb/ inherits base {
>>>   class {'lb': maintenance_mode   => 'norestart',}
>>> }
>>>
>>> This will remove lot of redundancy and ugly dependencies we have
>>> now....WDYT?
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> Software Engineer
>>> WSO2 Inc.
>>> http://wso2.com
>>>
>>> Phone: +94 77 64 154 38
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Akila Ravihansa Perera
> Software Engineer
> WSO2 Inc.
> http://wso2.com
>
> Phone: +94 77 64 154 38
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Re: Create a base Puppet module

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Nirmal,

We don't need zip/unzip to install Puppet. Actually I managed to install a
default node without zip/unzip by adding package { 'unzip': ensure =>
installed } to Puppet Java module.

What I'm trying to address is the redundant code in current Puppet master
module structure. Currently we have "require java", class {'agent':} on
each module, which can be avoided by creating a base module and other
modules can inherit stuff from this.

For eg. php module has  package { 'zip': ensure => installed } dependency,
and also Java module need this package as well. Instead of putting these
common tools in individual classes we can create a base class and others
will inherit stuff from this.

If you're interested, I can create a patch for this to be reviewed.


On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando <ni...@gmail.com>wrote:

> Hi Akila,
>
> If you have a look at the current nodes.pp file, Dinesh have already added
> a default section, which will be used to create a base image with minimal
> software (without wget, zip).
>
> What problems you are trying to address here? Is it to avoid the redundant
> code in nodes.pp file? Cause to install puppet you need these wget etc.
> packages, hence no point of adding it in the default node.
>
>
>
> On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <
> ravihansa@wso2.com> wrote:
>
>> Hi,
>>
>> I was thinking that we could simplify cartridge creation process by
>> creating a base Puppet module which would install common tools like zip,
>> unzip, tar, wget and also include Java module in this base module.
>>
>> Basically, the module structure will be like this (not tested);
>>
>> node /base/ {
>>
>>     <declarations here>
>>
>> }
>>
>>
>> class base {
>>
>>    package { 'unzip': ensure => installed }
>>    package { 'tar': ensure => installed }
>>    package { 'wget': ensure => installed }
>>
>>    class {'java'}
>>    class {'agent':}
>>
>>    Class['java'] ~> Class['agent']
>>
>> }
>>
>>
>> Then other Stratos module can include this
>>
>> node /lb/ inherits base {
>>   class {'lb': maintenance_mode   => 'norestart',}
>> }
>>
>> This will remove lot of redundancy and ugly dependencies we have
>> now....WDYT?
>>
>>
>> --
>> Akila Ravihansa Perera
>> Software Engineer
>> WSO2 Inc.
>> http://wso2.com
>>
>> Phone: +94 77 64 154 38
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Akila Ravihansa Perera
Software Engineer
WSO2 Inc.
http://wso2.com

Phone: +94 77 64 154 38
Blog: http://ravihansa3000.blogspot.com

Re: Create a base Puppet module

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Akila,

If you have a look at the current nodes.pp file, Dinesh have already added
a default section, which will be used to create a base image with minimal
software (without wget, zip).

What problems you are trying to address here? Is it to avoid the redundant
code in nodes.pp file? Cause to install puppet you need these wget etc.
packages, hence no point of adding it in the default node.



On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <ravihansa@wso2.com
> wrote:

> Hi,
>
> I was thinking that we could simplify cartridge creation process by
> creating a base Puppet module which would install common tools like zip,
> unzip, tar, wget and also include Java module in this base module.
>
> Basically, the module structure will be like this (not tested);
>
> node /base/ {
>
>     <declarations here>
>
> }
>
>
> class base {
>
>    package { 'unzip': ensure => installed }
>    package { 'tar': ensure => installed }
>    package { 'wget': ensure => installed }
>
>    class {'java'}
>    class {'agent':}
>
>    Class['java'] ~> Class['agent']
>
> }
>
>
> Then other Stratos module can include this
>
> node /lb/ inherits base {
>   class {'lb': maintenance_mode   => 'norestart',}
> }
>
> This will remove lot of redundancy and ugly dependencies we have
> now....WDYT?
>
>
> --
> Akila Ravihansa Perera
> Software Engineer
> WSO2 Inc.
> http://wso2.com
>
> Phone: +94 77 64 154 38
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/