Bug 1344939 - Installing newer version of python on buildduty-tools breaks puppet, r?coop draft
authorAlin Selagea <aselagea@mozilla.com>
Mon, 13 Mar 2017 17:15:01 +0200
changeset 4994 37f0f8a65bd9ddaf04a7a7dcdf723a296b7ca9a7
parent 4993 40fbe00dc246ea13901077153c09951af272ee43
push id2605
push useraselagea@mozilla.com
push dateMon, 13 Mar 2017 15:15:15 +0000
reviewerscoop
bugs1344939
Bug 1344939 - Installing newer version of python on buildduty-tools breaks puppet, r?coop MozReview-Commit-ID: 46Itq0vbugD
modules/buildduty_tools/manifests/config.pp
modules/buildduty_tools/manifests/httpd.pp
modules/buildduty_tools/manifests/init.pp
modules/buildduty_tools/templates/buildduty_tools.conf.erb
new file mode 100644
--- /dev/null
+++ b/modules/buildduty_tools/manifests/config.pp
@@ -0,0 +1,6 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+class buildduty_tools::config {
+    include packages::httpd
+}
new file mode 100644
--- /dev/null
+++ b/modules/buildduty_tools/manifests/httpd.pp
@@ -0,0 +1,36 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+class buildduty_tools::httpd {
+    include ::config
+    include users::buildduty
+
+    case $::operatingsystem {
+        CentOS: {
+            # Create RootDir
+            file {
+                "/var/www/html/builds/":
+                    ensure => directory,
+                    owner  => "${users::buildduty::username}",
+                    group => "${users::buildduty::group}";
+            }
+
+            httpd::config {
+                "buildduty_tools.conf":
+                    content => template("buildduty_tools/buildduty_tools.conf.erb");
+            }
+
+            # add a dependency between resources not defined here
+            File['/etc/puppet/puppet.conf'] ~> Service['httpd']
+            Package['openssl'] ~> Service['httpd']
+
+
+            # add a dependency between resources not defined here
+            #Package['openssl'] ~> Service['httpd']
+        }
+
+        default: {
+            fail("buildduty_tools::httpd support missing for $::operatingsystem")
+        }
+    }
+}
--- a/modules/buildduty_tools/manifests/init.pp
+++ b/modules/buildduty_tools/manifests/init.pp
@@ -1,7 +1,8 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 class buildduty_tools {
     include buildduty_tools::install
+    include buildduty_tools::httpd
     include buildduty_tools::buildduty-tools
 }
new file mode 100644
--- /dev/null
+++ b/modules/buildduty_tools/templates/buildduty_tools.conf.erb
@@ -0,0 +1,8 @@
+# VHost setup for buildduty-tools
+<VirtualHost *:80>
+    ServerAdmin release@mozilla.com
+    DocumentRoot /var/www/html
+    ServerName buildduty-tools-build.mozilla.org
+    ErrorLog logs/buildduty-tools_error.log
+    CustomLog logs/buildduty-tools_access.log common
+</VirtualHost>