forked from ungleich-public/cdist
		
	add sudo example
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								837489ce85
							
						
					
				
			
			
				commit
				
					
						27fd9cd61b
					
				
			
		
					 8 changed files with 107 additions and 0 deletions
				
			
		
							
								
								
									
										2
									
								
								other/examples/types/__nico_sudo/README
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								other/examples/types/__nico_sudo/README
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,2 @@ | ||||||
|  | Configure sudoers file to be included. Different types may do so, | ||||||
|  | this one simply uses the "nico" file to store the configuration. | ||||||
							
								
								
									
										13
									
								
								other/examples/types/__nico_sudo/files/sudo-nico
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								other/examples/types/__nico_sudo/files/sudo-nico
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | ||||||
|  | # | ||||||
|  | # Cdist managed file | ||||||
|  | # | ||||||
|  | 
 | ||||||
|  | # Personal one: nico, shared one: lyni | ||||||
|  | User_Alias NICO = nico, lyni | ||||||
|  | 
 | ||||||
|  | Defaults timestamp_timeout=5 | ||||||
|  | Defaults !tty_tickets | ||||||
|  | 
 | ||||||
|  | # Give out permissions | ||||||
|  | NICO ALL=(ALL) ALL | ||||||
|  | NICO ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend | ||||||
							
								
								
									
										30
									
								
								other/examples/types/__nico_sudo/manifest
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										30
									
								
								other/examples/types/__nico_sudo/manifest
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,30 @@ | ||||||
|  | #!/bin/sh | ||||||
|  | # | ||||||
|  | # 2011 Nico Schottelius (nico-cdist at schottelius.org) | ||||||
|  | # | ||||||
|  | # This file is part of cdist. | ||||||
|  | # | ||||||
|  | # cdist is free software: you can redistribute it and/or modify | ||||||
|  | # it under the terms of the GNU General Public License as published by | ||||||
|  | # the Free Software Foundation, either version 3 of the License, or | ||||||
|  | # (at your option) any later version. | ||||||
|  | # | ||||||
|  | # cdist is distributed in the hope that it will be useful, | ||||||
|  | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
|  | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||||
|  | # GNU General Public License for more details. | ||||||
|  | # | ||||||
|  | # You should have received a copy of the GNU General Public License | ||||||
|  | # along with cdist. If not, see <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | # | ||||||
|  | 
 | ||||||
|  | destination=/etc/sudoers.d/nico | ||||||
|  | source="$__type/files/sudo-nico" | ||||||
|  | 
 | ||||||
|  | __package sudo --state installed | ||||||
|  | __directory /etc/sudoers.d --parents yes | ||||||
|  | 
 | ||||||
|  | require="__directory/etc/sudoers.d" \ | ||||||
|  |    __file "$destination" --source "$source" --mode 0440 | ||||||
|  | 
 | ||||||
							
								
								
									
										31
									
								
								other/examples/types/__nico_sudo/parameter/gencode
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								other/examples/types/__nico_sudo/parameter/gencode
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | ||||||
|  | #!/bin/sh | ||||||
|  | # | ||||||
|  | # 2011 Nico Schottelius (nico-cdist at schottelius.org) | ||||||
|  | # | ||||||
|  | # This file is part of cdist. | ||||||
|  | # | ||||||
|  | # cdist is free software: you can redistribute it and/or modify | ||||||
|  | # it under the terms of the GNU General Public License as published by | ||||||
|  | # the Free Software Foundation, either version 3 of the License, or | ||||||
|  | # (at your option) any later version. | ||||||
|  | # | ||||||
|  | # cdist is distributed in the hope that it will be useful, | ||||||
|  | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
|  | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||||
|  | # GNU General Public License for more details. | ||||||
|  | # | ||||||
|  | # You should have received a copy of the GNU General Public License | ||||||
|  | # along with cdist. If not, see <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | # | ||||||
|  | # USEFUL DESCRIPTION | ||||||
|  | # | ||||||
|  | 
 | ||||||
|  | # | ||||||
|  | # This file should generate code on stdout, which will be collected by cdist | ||||||
|  | # and run on the target. | ||||||
|  | # | ||||||
|  | # To tell cdist to make use of it, you need to make it executable (chmod +x) | ||||||
|  | # | ||||||
|  | # | ||||||
|  | 
 | ||||||
							
								
								
									
										31
									
								
								other/examples/types/__nico_sudo/parameter/manifest
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								other/examples/types/__nico_sudo/parameter/manifest
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | ||||||
|  | #!/bin/sh | ||||||
|  | # | ||||||
|  | # 2011 Nico Schottelius (nico-cdist at schottelius.org) | ||||||
|  | # | ||||||
|  | # This file is part of cdist. | ||||||
|  | # | ||||||
|  | # cdist is free software: you can redistribute it and/or modify | ||||||
|  | # it under the terms of the GNU General Public License as published by | ||||||
|  | # the Free Software Foundation, either version 3 of the License, or | ||||||
|  | # (at your option) any later version. | ||||||
|  | # | ||||||
|  | # cdist is distributed in the hope that it will be useful, | ||||||
|  | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
|  | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||||
|  | # GNU General Public License for more details. | ||||||
|  | # | ||||||
|  | # You should have received a copy of the GNU General Public License | ||||||
|  | # along with cdist. If not, see <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | # | ||||||
|  | # USEFUL DESCRIPTION | ||||||
|  | # | ||||||
|  | 
 | ||||||
|  | # | ||||||
|  | # This is the manifest, which can be used to create other objects like this: | ||||||
|  | # __file /path/to/destination --source /from/where/ | ||||||
|  | # | ||||||
|  | # To tell cdist to make use of it, you need to make it executable (chmod +x) | ||||||
|  | # | ||||||
|  | # | ||||||
|  | 
 | ||||||
							
								
								
									
										0
									
								
								other/examples/types/__nico_sudo/parameter/optional
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								other/examples/types/__nico_sudo/parameter/optional
									
										
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								other/examples/types/__nico_sudo/parameter/required
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								other/examples/types/__nico_sudo/parameter/required
									
										
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								other/examples/types/__nico_sudo/singleton
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								other/examples/types/__nico_sudo/singleton
									
										
									
									
									
										Normal file
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue