Andrew Bogott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/92338
Change subject: Added the system_role module.
......................................................................
Added the system_role module.
This is pretty tiny, not sure if it deserves its own module. On the
other hand, making a new module saves me having to
s/system_role/whatever in every single file.
Change-Id: I1000245464fca3e0e98184f790fe01e7d6e98525
---
M manifests/generic-definitions.pp
A modules/system_role/manifests/init.pp
2 files changed, 20 insertions(+), 21 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/38/92338/1
diff --git a/manifests/generic-definitions.pp b/manifests/generic-definitions.pp
index 43d6b2f..223e2a4 100644
--- a/manifests/generic-definitions.pp
+++ b/manifests/generic-definitions.pp
@@ -2,27 +2,6 @@
#
# File that contains generally useful definitions, e.g. for creating system
users
-# Prints a MOTD message about the role of this system
-define system_role($description, $ensure=present) {
- $role_script_content = "#!/bin/sh
-
-echo \"$(hostname) is a Wikimedia ${description} (${title}).\"
-"
-
- $rolename = regsubst($title, ":", "-", "G")
- $motd_filename = "/etc/update-motd.d/05-role-${rolename}"
-
- if $::lsbdistid == "Ubuntu" and versioncmp($::lsbdistrelease, "9.10")
>= 0 {
- file { $motd_filename:
- owner => root,
- group => root,
- mode => 0555,
- content => $role_script_content,
- ensure => $ensure;
- }
- }
-}
-
# Creates a system username with associated group, random uid/gid, and
/bin/false as shell
define systemuser($name, $home=undef, $managehome=true, $shell="/bin/false",
$groups=undef, $default_group=$name, $ensure=present) {
# FIXME: deprecate $name parameter in favor of just using $title
diff --git a/modules/system_role/manifests/init.pp
b/modules/system_role/manifests/init.pp
new file mode 100644
index 0000000..871e0fe
--- /dev/null
+++ b/modules/system_role/manifests/init.pp
@@ -0,0 +1,20 @@
+# Prints a MOTD message about the role of this system
+define system_role($description, $ensure=present) {
+ $role_script_content = "#!/bin/sh
+
+echo \"$(hostname) is a Wikimedia ${description} (${title}).\"
+"
+
+ $rolename = regsubst($title, ":", "-", "G")
+ $motd_filename = "/etc/update-motd.d/05-role-${rolename}"
+
+ if $::lsbdistid == "Ubuntu" and versioncmp($::lsbdistrelease, "9.10")
>= 0 {
+ file { $motd_filename:
+ owner => root,
+ group => root,
+ mode => 0555,
+ content => $role_script_content,
+ ensure => $ensure;
+ }
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/92338
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1000245464fca3e0e98184f790fe01e7d6e98525
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits