Skip to content

Instantly share code, notes, and snippets.

@yawn
Created March 14, 2012 10:23
Show Gist options
  • Save yawn/2035598 to your computer and use it in GitHub Desktop.
Save yawn/2035598 to your computer and use it in GitHub Desktop.
Enable sudo upstart for a deployment $user
augeas { "Allow upstart operations w/o password":
context => "/files/etc/sudoers",
changes => [
"set Cmnd_Alias[alias/name = \"UPSTART\"]/alias/name UPSTART",
"set Cmnd_Alias[alias/name = \"UPSTART\"]/alias/command[1] /sbin/start",
"set Cmnd_Alias[alias/name = \"UPSTART\"]/alias/command[2] /sbin/stop",
"set Cmnd_Alias[alias/name = \"UPSTART\"]/alias/command[3] /sbin/restart",
"set Cmnd_Alias[alias/name = \"UPSTART\"]/alias/command[4] /sbin/initctl",
"set spec[user = \"${user}\"]/user ${user}",
"set spec[user = \"${user}\"]/host_group/host ALL",
"set spec[user = \"${user}\"]/host_group/command UPSTART",
"set spec[user = \"${user}\"]/host_group/command/runas_user root",
"set spec[user = \"${user}\"]/host_group/command/tag NOPASSWD",
],
require => Package["augeas"],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment