Hello all,
I just installed foreman and am trying to get familiar with it.
I have a situation as follows:
- After successfully installed foreman, I added module to foreman.
Module name is myflower-php
- After successfully installed that module (puppet module install -i
/etc/puppet/environments/common mayflower-php), I added php class from
foreman GUI
- Applied the changes above by running puppet agent --test in the server
(let say Server A) that I applied the changes to
- PHP was successful installed on that Server A
So now, I decided to remove php from that server. This is what I did:
- Removed php class from Server A from foreman GUI
- Applied puppet-agent --test in Server A
- PHP is still installed in Server A
Does removing class from host (in this case Server A) from foreman GUI is
basically doing 'ensure = absent' in puppet module?
If it's not, how can I removed the module itself (in this case PHP) from
the host (Server A)?
Thanks!
-Laurentius
Hi,
This is really a Puppet related issue, not Foreman I think.
Puppet will only manage what it knows about, so if you remove a module from
the catalog (removing the class from host in foreman gui), Puppet won't
know about it and won't undo any work it did with that module previously.
Some modules have functionality to remove packages/files that it has
configured, but those are fairly rare in my experience.
You may have to remove the installed software manually in this case, or
write another Puppet module to handle the removal of the packages/files as
required.
Hi Jamese,
Thanks for your response.
So, I have few more questions:
- So, what does it mean removing class from host in foreman gui? Is this
only for display purpose showing the class is not there anymore in the gui?
- So, for example, I, by mistake, installed php (using others module,
i.e. mayflower-php) on database server, and decided to remove it. Since
this module has other application installed besides php, such as pear,
etc., does it mean I have to know all the available applications for this
module, and write my own un-install module based on this? I think it
defeats the purpose of having modules available on
https://forge.puppetlabs.com
I might be wrong about the above, that's the reason why I asked these
question.
For those of you who have done and mastered foreman-puppet workflow, your
advise is much appreciated.
Thanks!
-Laurentius
> Hi Jamese,
>
> Thanks for your response.
>
> So, I have few more questions:
>
> * So, what does it mean removing class from host in foreman gui? Is
> this only for display purpose showing the class is not there anymore
> in the gui?
No, it means that Puppet will no longer apply that class to the server.
Puppet will no longer manage the resources/configuration (packages,
services etc) that are in that module.
You could manually change or remove them on the server and it wouldn't
be put back.
> * So, for example, I, by mistake, installed php (using others module,
> i.e. mayflower-php) on database server, and decided to remove it.
> Since this module has other application installed besides php, such
> as pear, etc., does it mean I have to know all the available
> applications for this module, and write my own un-install module
> based on this? I think it defeats the purpose of having modules
> available on https://forge.puppetlabs.com
> <https://forge.puppetlabs.com/>
As Jamese said, it can be possible to write support into a module to
remove the software as well, but it's rare. In that case you'd perhaps
leave the module applied, but pass a parameter to say to remove it instead.
That's hypothetical though - if that happens, you're probably best
reinstalling the server or leaving it as-is.
···
On 05/08/15 14:45, Laurentius Purba wrote:
–
Dominic Cleal
Red Hat Engineering
Thanks guys for all your responses. I really appreciate it.
···
On Monday, August 10, 2015 at 4:26:15 AM UTC-4, Dominic Cleal wrote:
>
> On 05/08/15 14:45, Laurentius Purba wrote:
> > Hi Jamese,
> >
> > Thanks for your response.
> >
> > So, I have few more questions:
> >
> > * So, what does it mean removing class from host in foreman gui? Is
> > this only for display purpose showing the class is not there anymore
> > in the gui?
>
> No, it means that Puppet will no longer apply that class to the server.
> Puppet will no longer manage the resources/configuration (packages,
> services etc) that are in that module.
>
> You could manually change or remove them on the server and it wouldn't
> be put back.
>
> > * So, for example, I, by mistake, installed php (using others module,
> > i.e. mayflower-php) on database server, and decided to remove it.
> > Since this module has other application installed besides php, such
> > as pear, etc., does it mean I have to know all the available
> > applications for this module, and write my own un-install module
> > based on this? I think it defeats the purpose of having modules
> > available on https://forge.puppetlabs.com
> >
>
> As Jamese said, it can be possible to write support into a module to
> remove the software as well, but it's rare. In that case you'd perhaps
> leave the module applied, but pass a parameter to say to remove it
> instead.
>
> That's hypothetical though - if that happens, you're probably best
> reinstalling the server or leaving it as-is.
>
> --
> Dominic Cleal
> Red Hat Engineering
>