Last modified: 2014-06-28 05:17:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68751, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66751 - Puppet is erasing growthdoc.wmflabs.org and proveit.wmflabs.org sites-enabled
Puppet is erasing growthdoc.wmflabs.org and proveit.wmflabs.org sites-enabled
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-17 22:37 UTC by Matthew Flaschen
Modified: 2014-06-28 05:17 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Matthew Flaschen 2014-06-17 22:37:21 UTC
http://growthdoc.wmflabs.org/GuidedTour/ (should be a HTTP redirect) and http://proveit.wmflabs.org/ (not a redirect) are both responding with 502 Bad Gateway.

The host they're connecting to is still up (82-day uptime in fact), but I don't know how to test it without the proxy.

Both are still in the proxy list at https://wikitech.wikimedia.org/wiki/Special:NovaProxy
Comment 1 Matthew Flaschen 2014-06-17 22:41:04 UTC
They proxy to docs.eqiad.wmflabs .
Comment 2 Matthew Flaschen 2014-06-17 22:57:41 UTC
Upon further investigation, /etc/apache2/sites-enabled/ is now being affected by puppet.  It is emptying these entires, but there is no "This directory is managed by puppet" warning.
Comment 3 Tim Landscheidt 2014-06-17 23:03:25 UTC
I think ori refactored the apache* classes today.  ori, could this be related?
Comment 4 Ori Livneh 2014-06-18 00:16:37 UTC
Yes, probably. Are these files declared in Puppet?
Comment 5 Matthew Flaschen 2014-06-18 01:27:45 UTC
(In reply to Ori Livneh from comment #4)
> Yes, probably. Are these files declared in Puppet?

Nope.
Comment 6 Andrew Bogott 2014-06-18 16:37:42 UTC
So the new puppet module installs virthosts and also removes any virthosts that aren't currently installed?  That appeals to the obsessive/compulsive in me but does seem a little harsh for labs users.  Could puppet use an alternative to sites-available and permit non-puppetized links on sites-enabled?  Or better yet, somehow know to only wipe out files that it itself created?
Comment 7 Andrew Bogott 2014-06-18 16:38:45 UTC
Or, heck, just check $realm and skip the deletion step on labs.
Comment 8 Matthew Flaschen 2014-06-26 20:06:31 UTC
(In reply to Andrew Bogott from comment #6)
> So the new puppet module installs virthosts and also removes any virthosts
> that aren't currently installed?  That appeals to the obsessive/compulsive
> in me but does seem a little harsh for labs users.  Could puppet use an
> alternative to sites-available and permit non-puppetized links on
> sites-enabled?  Or better yet, somehow know to only wipe out files that it
> itself created?

Puppetizing it probably isn't a big deal for me.  However, I obviously can't commit this to operations/puppet.  That means I need to do some kind of self-hosted thing.

But https://wikitech.wikimedia.org/wiki/Help:Self-hosted_puppetmaster says, "This means that as soon as you add role::puppet::self the instance will stop receiving updates that are pushed into gerrit.", which I'd like to avoid if possible.  Is there any way of having local puppet manifests on a Labs box without losing automatic updates?

(As far whether Puppet should actually clear the directory of unpuppetized stuff, I don't know).
Comment 9 Ori Livneh 2014-06-26 21:19:29 UTC
(In reply to Matthew Flaschen from comment #8)
> (In reply to Andrew Bogott from comment #6)
> > So the new puppet module installs virthosts and also removes any virthosts
> > that aren't currently installed?  That appeals to the obsessive/compulsive
> > in me but does seem a little harsh for labs users.  Could puppet use an
> > alternative to sites-available and permit non-puppetized links on
> > sites-enabled?  Or better yet, somehow know to only wipe out files that it
> > itself created?
> 
> Puppetizing it probably isn't a big deal for me.  However, I obviously can't
> commit this to operations/puppet.  That means I need to do some kind of
> self-hosted thing.
> 
> But https://wikitech.wikimedia.org/wiki/Help:Self-hosted_puppetmaster says,
> "This means that as soon as you add role::puppet::self the instance will
> stop receiving updates that are pushed into gerrit.", which I'd like to
> avoid if possible.  Is there any way of having local puppet manifests on a
> Labs box without losing automatic updates?
> 
> (As far whether Puppet should actually clear the directory of unpuppetized
> stuff, I don't know).

/etc/apache2/apache2.conf is not managed by Puppet, so you can glob config files from an additional path of your choosing by adding an "Include /etc/apache2/unpuppetized-sites/*" (or whatever) line to that file.
Comment 10 Tim Landscheidt 2014-06-26 21:27:40 UTC
(In reply to Matthew Flaschen from comment #8)
> [...]

> But https://wikitech.wikimedia.org/wiki/Help:Self-hosted_puppetmaster says,
> "This means that as soon as you add role::puppet::self the instance will
> stop receiving updates that are pushed into gerrit.", which I'd like to
> avoid if possible.  Is there any way of having local puppet manifests on a
> Labs box without losing automatic updates?

> [...]

At the moment no, but cf. bug #66683.
Comment 11 Andrew Bogott 2014-06-26 21:30:20 UTC
The fact that puppet actively destroys your local apache config is silly.  If you want to puppetize and get me to merge your changes into the prod branch that's great, but we definitely need a path to support local, stable changes that don't require you to set up a puppetmaster.

Possibly Matt's suggestion with apache2.conf will work... failing that, I expect Ori has a master plan which will get us back to a point where we support local vhosts.  Ori, is that wrong?
Comment 12 Ori Livneh 2014-06-26 21:38:00 UTC
(In reply to Andrew Bogott from comment #11)
> we definitely need a path to support local, stable changes that
> don't require you to set up a puppetmaster.

Not for production, IMO. But I do see the use-case for labs.

I propose the following:

    file { '/etc/apache2/local-sites':
        ensure  => directory,
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        require => Package['apache2'],
    }

    file_line { 'load_local_sites':
        path    => '/etc/apache2/apache2.conf',
        line    => 'Include local-sites/*',
        require => File['/etc/apache2/local-sites'],
        notify  => Service['apache2'],
    }
Comment 13 Ori Livneh 2014-06-26 21:38:36 UTC
(These resources would be declared in a Labs-specific manifest.)
Comment 14 Andrew Bogott 2014-06-26 21:40:08 UTC
Sure, that'll work.
Comment 15 Andrew Bogott 2014-06-26 21:41:03 UTC
Well... it's moot now I guess, but I'd really prefer that puppet FAIL when there are untracked vhosts, rather than just cheerfully destroy them.
Comment 16 Ori Livneh 2014-06-26 21:43:41 UTC
In fact, there's an even easier way to do this that doesn't require tampering with apache2.conf, and it's to replace the second (file_line) resource with:

    apache::site { 'local_sites':
       content => "Include /etc/apache2/local-sites/*\n",
       require => File['/etc/apache2/local-sites'],
    }
Comment 17 Gerrit Notification Bot 2014-06-26 22:16:02 UTC
Change 142439 had a related patch set uploaded by Ori.livneh:
On Labs, provision an Apache config dir that is not managed by Puppet

https://gerrit.wikimedia.org/r/142439
Comment 18 Gerrit Notification Bot 2014-06-26 22:57:38 UTC
Change 142439 had a related patch set uploaded by Ori.livneh:
On Labs, provision an Apache config dir that is not managed by Puppet

https://gerrit.wikimedia.org/r/142439
Comment 19 Gerrit Notification Bot 2014-06-26 23:30:05 UTC
Change 142439 merged by Andrew Bogott:
On Labs, provision an Apache config dir that is not managed by Puppet

https://gerrit.wikimedia.org/r/142439
Comment 20 Andrew Bogott 2014-06-26 23:31:36 UTC
ok -- now (well, in an hour or so) you should be able to recreate your sites by hand by placing the vhost files in /etc/apache2/sites-local.  Please try it out and report back here how it works.
Comment 21 Matthew Flaschen 2014-06-28 05:17:51 UTC
Thanks, I added symbolic links there, pointing to sites-available, and it's fixed.

For the record, sites-available was never being erased AFAICT, so sites were being disabled but not being erased completely.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links