Re: [Puppet Users] stop service after install

2017-05-17 Thread John Gelnaw
On Wednesday, May 17, 2017 at 5:06:33 PM UTC-4, Poil wrote:
>
> I'm agree with "Debian is just by design stupid, thinks starting all 
> services"
> All other integration are really fine, but  auto-starting after install is 
> terrible for all configuration management :
> Change a path (mysql binary log for example), a mount point (a LV for 
> mysql) before installing : Nope you can't
> You have to write a hack to remove all autostart from the package before 
> installing it that's incredible.
>
> I dream about a Debian mix with RedHat, RPM, no auto-start but all the 
> configuration system from Debian (splited-conf for apache php ... and tools 
> to manage your modules
>

Well, what you're complaining about is the package maintainers, not the 
OS-- it's the post install scripts that start up the services.  You might 
want to look into openSuSE-- RPM based, but package configuration tends to 
be more modular than Red Hat.  The openSuSE build service is also a nice 
feature.

You'll still run into the same thing with openSuSE and Red Hat-- RHEL7, if 
you install "nfs-utils" (traditionally the "nfs client" package-- but now 
it's the server package too), for example, you get the NFS server 
installed, running, set to auto-start, with portmapper running.

And I'm sure for every person who gripes about package X installing itself 
as 'autostart', you'll find at least one person who complains that they've 
got to enable the service after installation.

Personally, I don't care-- ultimately, I use puppet to ensure the package 
is installed, configured, and the service is enabled how *I* want it. 
 Nearly all of my configuration changes are linked to the service, so if I 
update a config file, the service is automatically restarted.  That's kind 
of the whole point of puppet.

Calling an OS "stupid" because they made decisions you disagree with is 
short-sighted.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c94494b2-a5f0-4132-8b8c-041baf174627%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-17 Thread Poil
I'm agree with "Debian is just by design stupid, thinks starting all 
services"
All other integration are really fine, but  auto-starting after install 
is terrible for all configuration management :
Change a path (mysql binary log for example), a mount point (a LV for 
mysql) before installing : Nope you can't
You have to write a hack to remove all autostart from the package before 
installing it that's incredible.


I dream about a Debian mix with RedHat, RPM, no auto-start but all the 
configuration system from Debian (splited-conf for apache php ... and 
tools to manage your modules)



Le 17/05/2017 à 19:21, John Gelnaw a écrit :

On Monday, May 15, 2017 at 8:16:38 AM UTC-4, R.I. Pienaar wrote:


debian will not overwrite configs on package install - suggest you
put a
config down that does what you want first.


Or, I dunno, maybe he could could tie the service to the config file, 
and restart apache when the config file changes, and "require" the 
apache2 class as part of his nginx setup.


So Puppet would install apache (starting the service), install the 
config file (restarting apache), and then install nginx.


|
classapache2 {

  $pkglist =['apache2','apache2-dev',]

package{$pkglist:
ensure=>latest,
alias=>'apache2'
}
  file {'/etc/apache2/conf.d/ports.conf':
content =>'Listen 127.0.0.1:80',
require=>Package['apache2'],
notify =>Service['apache2']
}
  service {'apache2':
ensure=>running,
refreshonly =>true
}
}

classnginx {

requireapache2

package{...}

  service {...}

}
|

That's just off the top of my head, and isn't really The Right Way, 
but it's got all the components.


Debian is just by design stupid, thinks starting all services
unconfigured on install is a good idea, suggest you use a OS
designed to
be used on servers and not peoples basements.


That is probably the single worst piece of advice I've seen on this 
forum.  It's hostile, short-sighted, and not terribly useful.


Debian has been a better "server" OS for years, in that it supports 
in-place upgrades, and makes it easier to control which packages are 
installed from which repositories.


Our environment has about 200 web and database servers, about 60% of 
which are Red Hat, and the rest are Debian.  They're both perfectly 
good operating systems for production servers, but they do require the 
admin be open-minded enough to actually learn the differences between 
the two paradigms-- otherwise, you might as well run Windows.


--
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+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a3979ccc-0761-4a26-8a3d-26d38ff7f6bb%40googlegroups.com 
.

For more options, visit 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f8810064-75c6-ee73-5e45-4384b7ab471f%40quake.fr.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-17 Thread John Gelnaw
On Monday, May 15, 2017 at 8:16:38 AM UTC-4, R.I. Pienaar wrote:
>
>
> debian will not overwrite configs on package install - suggest you put a 
> config down that does what you want first. 
>

Or, I dunno, maybe he could could tie the service to the config file, and 
restart apache when the config file changes, and "require" the apache2 
class as part of his nginx setup.

So Puppet would install apache (starting the service), install the config 
file (restarting apache), and then install nginx.

class apache2  {

  $pkglist = ['apache2', 'apache2-dev',  ]

  package { $pkglist:
 ensure   => latest,
 alias=> 'apache2'
  }
  file { '/etc/apache2/conf.d/ports.conf':
content => 'Listen 127.0.0.1:80',
require => Package['apache2'],
notify  => Service['apache2']
  }
  service { 'apache2':
ensure  => running,
refreshonly => true
  } 
}

class nginx  {

  require apache2

  package { ... } 

  service { ... }

}

That's just off the top of my head, and isn't really The Right Way, but 
it's got all the components.
 

> Debian is just by design stupid, thinks starting all services 
> unconfigured on install is a good idea, suggest you use a OS designed to 
> be used on servers and not peoples basements. 
>

That is probably the single worst piece of advice I've seen on this forum. 
 It's hostile, short-sighted, and not terribly useful.

Debian has been a better "server" OS for years, in that it supports 
in-place upgrades, and makes it easier to control which packages are 
installed from which repositories.

Our environment has about 200 web and database servers, about 60% of which 
are Red Hat, and the rest are Debian.  They're both perfectly good 
operating systems for production servers, but they do require the admin be 
open-minded enough to actually learn the differences between the two 
paradigms-- otherwise, you might as well run Windows.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a3979ccc-0761-4a26-8a3d-26d38ff7f6bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-17 Thread Anton Gorlov
Hi.
At the current moment I need bind  the apache to localhost:80 and nginx
to external_ip:80.
I cannot change nginx config before it installed and debian start nginx
automatic after install  package with  default configuration (bind to
*:80) => conflict.

So first I stop  the apache service, after install nginx and go update
config's...


14.05.2017 16:10, Poil пишет:
> Why do you want to stop it ? I think you want to change the listen port.
>
> So I think something like this will do the job :
>
> package { 'apache2': ensure => installed, }
>
> service { 'apache2':
>   ensure => running,
>   enable => true,
> }
>
> file { '/etc/apache2/conf.d/listen_port.conf':
>   content => "your_template.conf.erb",
>   require => Package['apache2'],
>   notify => Service['apache2'], # Refresh apache after the listen_port
> is changed
> }
>
> package {'nginx':
>   ensure => installed,
>   require => Service['apache2'], # Install nginx after apache have
> been restarted with another config
> }
>
>
> Le 13/05/2017 à 11:45, Anton Gorlov a écrit :
>> Hi.
>>
>> I need stop service (apache) after it install from puppet.
>> platform is debian 9 and puppet version is 4.8.2
>>
>> I my class i wrote:
>>
>> 
>> class webpackages {
>>
>> exec { 'apachechk':
>>  command => "/bin/systemctl stop apache2;",
>>  onlyif => "/bin/grep -c 'Listen 80' /etc/apache2/ports.conf",
>> }
>>
>> package { 'libapache2-mpm-itk':
>> ensure => latest,
>> }
>>
>> package { 'apache2':
>> require => Exec['apachechk'],
>> ensure => latest,
>> }
>>
>> package { 'apache2-dev':
>> ensure => latest,
>> }
>> package { 'apache2-suexec-pristine':
>> ensure => latest,
>> }
>> package { 'apache2-utils':
>> ensure => latest,
>> }
>> package { 'apache2-bin':
>> ensure => latest,
>> }
>> package { 'apachetop':
>> ensure => latest,
>> }
>> package { 'libapache2-mod-rpaf':
>> ensure => latest,
>> }
>> package { 'nginx-light':
>> require => Exec['apachechk'],
>> ensure => latest,
>> }
>>
>> }
>> ===
>>
>> but apache not stopping and install nginx is fail because port is busy
>> by apache
>>
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> 0.0.0.…se)
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> 0.0.0.…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] still could
>> not bind()
>>
>> What is wrong and what is right way to do it?
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/57fa4c2b-06b8-8663-daff-02cfdaeea65a%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-15 Thread Anton Gorlov
15.05.2017 15:16, R.I.Pienaar пишет:
> Debian is just by design stupid, thinks starting all services
> unconfigured on install is a good idea, suggest you use a OS designed to
> be used on servers and not peoples basements.

Yes this is true...
But I can't change OS at current time.


Question why does not work exec in package install


package { 'nginx-light':
require => Exec['apachechk'],
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0358969c-0796-eddc-c6c7-ede0c9742f53%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-15 Thread R.I.Pienaar


On Mon, May 15, 2017, at 13:52, Anton Gorlov wrote:
> Hi.
> At the current moment I need bind  the apache to localhost:80 and nginx
> to external_ip:80.
> I cannot change nginx config before it installed and debian start nginx
> automatic after install  package with  default configuration (bind to
> *:80) => conflict.
> 
> So first I stop  the apache service, after install nginx and go update
> config's...

debian will not overwrite configs on package install - suggest you put a
config down that does what you want first.

Debian is just by design stupid, thinks starting all services
unconfigured on install is a good idea, suggest you use a OS designed to
be used on servers and not peoples basements.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1494850584.255916.976928248.0CBF54C4%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-15 Thread Anton Gorlov
Hi.
At the current moment I need bind  the apache to localhost:80 and nginx
to external_ip:80.
I cannot change nginx config before it installed and debian start nginx
automatic after install  package with  default configuration (bind to
*:80) => conflict.

So first I stop  the apache service, after install nginx and go update
config's...


14.05.2017 16:10, Poil пишет:
> Why do you want to stop it ? I think you want to change the listen port.
>
> So I think something like this will do the job :
>
> package { 'apache2': ensure => installed, }
>
> service { 'apache2':
>   ensure => running,
>   enable => true,
> }
>
> file { '/etc/apache2/conf.d/listen_port.conf':
>   content => "your_template.conf.erb",
>   require => Package['apache2'],
>   notify => Service['apache2'], # Refresh apache after the listen_port
> is changed
> }
>
> package {'nginx':
>   ensure => installed,
>   require => Service['apache2'], # Install nginx after apache have
> been restarted with another config
> }
>
>
> Le 13/05/2017 à 11:45, Anton Gorlov a écrit :
>> Hi.
>>
>> I need stop service (apache) after it install from puppet.
>> platform is debian 9 and puppet version is 4.8.2
>>
>> I my class i wrote:
>>
>> 
>> class webpackages {
>>
>> exec { 'apachechk':
>>  command => "/bin/systemctl stop apache2;",
>>  onlyif => "/bin/grep -c 'Listen 80' /etc/apache2/ports.conf",
>> }
>>
>> package { 'libapache2-mpm-itk':
>> ensure => latest,
>> }
>>
>> package { 'apache2':
>> require => Exec['apachechk'],
>> ensure => latest,
>> }
>>
>> package { 'apache2-dev':
>> ensure => latest,
>> }
>> package { 'apache2-suexec-pristine':
>> ensure => latest,
>> }
>> package { 'apache2-utils':
>> ensure => latest,
>> }
>> package { 'apache2-bin':
>> ensure => latest,
>> }
>> package { 'apachetop':
>> ensure => latest,
>> }
>> package { 'libapache2-mod-rpaf':
>> ensure => latest,
>> }
>> package { 'nginx-light':
>> require => Exec['apachechk'],
>> ensure => latest,
>> }
>>
>> }
>> ===
>>
>> but apache not stopping and install nginx is fail because port is busy
>> by apache
>>
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> 0.0.0.…se)
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> 0.0.0.…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] still could
>> not bind()
>>
>> What is wrong and what is right way to do it?
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b40462e2-620d-3245-c0c2-92b0d442e3bc%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-14 Thread Rob Nelson
It might be worth pointing out that puppetlabs/apache is a component module
that helps address some of these common issues, and using it instead of
writing your own apache module is probably worth considering in this case.


Rob Nelson
rnels...@gmail.com

On Sun, May 14, 2017 at 3:07 PM, Ramin K  wrote:

> I'd guess that installing new modules are restarting the service. You
> probably need something with better ordering.
>
> class apache {
>   contain ::apache::install
>   contain ::apache::config
>   contain ::apache::service
>   Class['::apache::install'] ->
>   Class['::apache::config'] ~>
>   Class['::apache::config']
> }
> class apache::install {
>   package { 'libapache2-mpm-itk':
> ensure => latest,
>   }
>   package { 'apache2':
> ensure => latest,
>   }
>   # etc etc
> }
> class apache::config {
>   file { '/etc/apache2/ports.conf':
> ensure  => file,
> content => "Listen 8080\n",
>   }
> }
> class apache::service {
>   service { 'apache':
> ensure => running
> enable => true,
>   }
> }
> class nginx {
>   package { 'nginx-light':
> ensure => latest,
>   }
> }
> class profile::webstack {
>   include ::apache
>   include ::nginx
>   Class['::apache'] -> Class['nginx']
> }
>
> On 5/13/17 2:45 AM, Anton Gorlov wrote:
>
>> Hi.
>>
>> I need stop service (apache) after it install from puppet.
>> platform is debian 9 and puppet version is 4.8.2
>>
>> I my class i wrote:
>>
>> 
>> class webpackages {
>>
>> exec { 'apachechk':
>> command => "/bin/systemctl stop apache2;",
>> onlyif => "/bin/grep -c 'Listen 80' /etc/apache2/ports.conf",
>> }
>>
>> package { 'libapache2-mpm-itk':
>> ensure => latest,
>>}
>>
>> package { 'apache2':
>> require => Exec['apachechk'],
>> ensure => latest,
>>}
>>
>> package { 'apache2-dev':
>> ensure => latest,
>>}
>> package { 'apache2-suexec-pristine':
>> ensure => latest,
>>}
>> package { 'apache2-utils':
>> ensure => latest,
>>}
>> package { 'apache2-bin':
>> ensure => latest,
>>}
>> package { 'apachetop':
>> ensure => latest,
>>}
>> package { 'libapache2-mod-rpaf':
>> ensure => latest,
>>}
>> package { 'nginx-light':
>> require => Exec['apachechk'],
>> ensure => latest,
>> }
>>
>> }
>> ===
>>
>> but apache not stopping and install nginx is fail because port is busy
>> by apache
>>
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> 0.0.0.…se)
>> May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> 0.0.0.…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
>> [::]:8…se)
>> May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] still could
>> not bind()
>>
>> What is wrong and what is right way to do it?
>>
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/puppet-users/1da0051d-a3d1-6472-2ad6-3af335f7503a%40badapple.net.
> For more options, visit 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAC76iT_nRnEQv5PFsoq0gpi6G-mMHVDB6d_Xzi%3DncUB7kNR2cQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-14 Thread Ramin K
I'd guess that installing new modules are restarting the service. You 
probably need something with better ordering.


class apache {
  contain ::apache::install
  contain ::apache::config
  contain ::apache::service
  Class['::apache::install'] ->
  Class['::apache::config'] ~>
  Class['::apache::config']
}
class apache::install {
  package { 'libapache2-mpm-itk':
ensure => latest,
  }
  package { 'apache2':
ensure => latest,
  }
  # etc etc
}
class apache::config {
  file { '/etc/apache2/ports.conf':
ensure  => file,
content => "Listen 8080\n",
  }
}
class apache::service {
  service { 'apache':
ensure => running
enable => true,
  }
}
class nginx {
  package { 'nginx-light':
ensure => latest,
  }
}
class profile::webstack {
  include ::apache
  include ::nginx
  Class['::apache'] -> Class['nginx']
}

On 5/13/17 2:45 AM, Anton Gorlov wrote:

Hi.

I need stop service (apache) after it install from puppet.
platform is debian 9 and puppet version is 4.8.2

I my class i wrote:


class webpackages {

exec { 'apachechk':
command => "/bin/systemctl stop apache2;",
onlyif => "/bin/grep -c 'Listen 80' /etc/apache2/ports.conf",
}

package { 'libapache2-mpm-itk':
ensure => latest,
   }

package { 'apache2':
require => Exec['apachechk'],
ensure => latest,
   }

package { 'apache2-dev':
ensure => latest,
   }
package { 'apache2-suexec-pristine':
ensure => latest,
   }
package { 'apache2-utils':
ensure => latest,
   }
package { 'apache2-bin':
ensure => latest,
   }
package { 'apachetop':
ensure => latest,
   }
package { 'libapache2-mod-rpaf':
ensure => latest,
   }
package { 'nginx-light':
require => Exec['apachechk'],
ensure => latest,
}

}
===

but apache not stopping and install nginx is fail because port is busy
by apache

May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
0.0.0.…se)
May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
0.0.0.…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] still could
not bind()

What is wrong and what is right way to do it?



--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1da0051d-a3d1-6472-2ad6-3af335f7503a%40badapple.net.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stop service after install

2017-05-14 Thread Poil

Why do you want to stop it ? I think you want to change the listen port.

So I think something like this will do the job :

package { 'apache2': ensure => installed, }

service { 'apache2':
  ensure => running,
  enable => true,
}

file { '/etc/apache2/conf.d/listen_port.conf':
  content => "your_template.conf.erb",
  require => Package['apache2'],
  notify => Service['apache2'], # Refresh apache after the listen_port 
is changed

}

package {'nginx':
  ensure => installed,
  require => Service['apache2'], # Install nginx after apache have been 
restarted with another config

}


Le 13/05/2017 à 11:45, Anton Gorlov a écrit :

Hi.

I need stop service (apache) after it install from puppet.
platform is debian 9 and puppet version is 4.8.2

I my class i wrote:


class webpackages {

exec { 'apachechk':
 command => "/bin/systemctl stop apache2;",
 onlyif => "/bin/grep -c 'Listen 80' /etc/apache2/ports.conf",
}

package { 'libapache2-mpm-itk':
ensure => latest,
}

package { 'apache2':
require => Exec['apachechk'],
ensure => latest,
}

package { 'apache2-dev':
ensure => latest,
}
package { 'apache2-suexec-pristine':
ensure => latest,
}
package { 'apache2-utils':
ensure => latest,
}
package { 'apache2-bin':
ensure => latest,
}
package { 'apachetop':
ensure => latest,
}
package { 'libapache2-mod-rpaf':
ensure => latest,
}
package { 'nginx-light':
require => Exec['apachechk'],
ensure => latest,
}

}
===

but apache not stopping and install nginx is fail because port is busy
by apache

May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
0.0.0.…se)
May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
0.0.0.…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] still could
not bind()

What is wrong and what is right way to do it?



--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7f0333ac-2aff-d936-3337-d1fb143019ae%40quake.fr.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] stop service after install

2017-05-13 Thread Anton Gorlov
Hi.

I need stop service (apache) after it install from puppet.
platform is debian 9 and puppet version is 4.8.2

I my class i wrote:


class webpackages {

exec { 'apachechk':
command => "/bin/systemctl stop apache2;",
onlyif => "/bin/grep -c 'Listen 80' /etc/apache2/ports.conf",
}

package { 'libapache2-mpm-itk':
ensure => latest,
   }

package { 'apache2':
require => Exec['apachechk'],
ensure => latest,
   }

package { 'apache2-dev':
ensure => latest,
   }
package { 'apache2-suexec-pristine':
ensure => latest,
   }
package { 'apache2-utils':
ensure => latest,
   }
package { 'apache2-bin':
ensure => latest,
   }
package { 'apachetop':
ensure => latest,
   }
package { 'libapache2-mod-rpaf':
ensure => latest,
   }
package { 'nginx-light':
require => Exec['apachechk'],
ensure => latest,
}

}
===

but apache not stopping and install nginx is fail because port is busy
by apache

May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
0.0.0.…se)
May 13 12:21:29 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
0.0.0.…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] listen() to
[::]:8…se)
May 13 12:21:30 debian9-lab3 nginx[19538]: nginx: [emerg] still could
not bind()

What is wrong and what is right way to do it?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0dc1d498-9963-171f-c223-e3af643a1b20%40gmail.com.
For more options, visit https://groups.google.com/d/optout.