Andrew Bogott has submitted this change and it was merged.

Change subject: vagrant: Add upstart script to start container on boot
......................................................................


vagrant: Add upstart script to start container on boot

Add an Upstart script that will look for an existing MediaWiki-Vagrant
LXC container and start it if found.

Bug: T127129
Change-Id: Icf4cad56770cb992a1c6937c60c8976d5d9328b9
---
M modules/vagrant/manifests/mediawiki.pp
A modules/vagrant/templates/mediawiki-vagrant.conf.erb
2 files changed, 21 insertions(+), 0 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/vagrant/manifests/mediawiki.pp 
b/modules/vagrant/manifests/mediawiki.pp
index f2122d8..ad3f297 100644
--- a/modules/vagrant/manifests/mediawiki.pp
+++ b/modules/vagrant/manifests/mediawiki.pp
@@ -81,4 +81,14 @@
         mode   => '0444',
         source => 'puppet:///modules/vagrant/umask-wikidev-profile-d.sh',
     }
+
+    # T127129: Attempt to start an existing MediaWiki-Vagrant LXC container on
+    # instance boot.
+    file { '/etc/init/mediawiki-vagrant.conf':
+        ensure  => present,
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0444',
+        content => template('vagrant/mediawiki-vagrant.conf.erb'),
+    }
 }
diff --git a/modules/vagrant/templates/mediawiki-vagrant.conf.erb 
b/modules/vagrant/templates/mediawiki-vagrant.conf.erb
new file mode 100644
index 0000000..362ac9d
--- /dev/null
+++ b/modules/vagrant/templates/mediawiki-vagrant.conf.erb
@@ -0,0 +1,11 @@
+description "Start MediaWiki-Vagrant on system startup"
+author "Bryan Davis <[email protected]>"
+task
+start on filesystem and net-device-up IFACE!=lo
+env LANG=en_US.UTF-8
+script
+    cd <%= @install_directory %> &&
+    /usr/local/bin/mwvagrant status |
+    grep -q 'stopped (lxc)' &&
+    /usr/local/bin/mwvagrant up
+end script

-- 
To view, visit https://gerrit.wikimedia.org/r/271171
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf4cad56770cb992a1c6937c60c8976d5d9328b9
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Chasemp <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to