mirror of
				https://github.com/saltstack-formulas/sudoers-formula.git
				synced 2025-11-01 00:07:55 +01:00 
			
		
		
		
	feat(ordering): optionally append includefiles to main config
This commit is contained in:
		
							parent
							
								
									25cd2cf0e3
								
							
						
					
					
						commit
						751eff7218
					
				| @ -51,7 +51,7 @@ Set up the sudoers file | |||||||
| ``sudoers.included`` | ``sudoers.included`` | ||||||
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^ | ||||||
| 
 | 
 | ||||||
| Set up an additional sudoers included file | Set up an additional sudoers included file. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Testing | Testing | ||||||
|  | |||||||
| @ -63,3 +63,9 @@ sudoers: | |||||||
|       netgroups: |       netgroups: | ||||||
|         other_netgroup: |         other_netgroup: | ||||||
|           - 'ALL=(ALL) ALL' |           - 'ALL=(ALL) ALL' | ||||||
|  |   # ordering is important. The sudoers manpage says when multiple | ||||||
|  |   # entries match, the last match is used. However, if we do not | ||||||
|  |   # manage the main config, our included files may not match last. | ||||||
|  |   # To guarantee included files match last, set 'true' below to append | ||||||
|  |   # each '#include <includefile>' to sudoers file. | ||||||
|  |   append_included_files_to_endof_main_config: true | ||||||
|  | |||||||
| @ -10,3 +10,4 @@ sudoers: | |||||||
|   execprefix: /usr/sbin |   execprefix: /usr/sbin | ||||||
|   includedir: /etc/sudoers.d |   includedir: /etc/sudoers.d | ||||||
|   included_files: {} |   included_files: {} | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								sudoers/included/init.sls
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								sudoers/included/init.sls
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | # vim: ft=sls | ||||||
|  | 
 | ||||||
|  | include: | ||||||
|  |   - .install | ||||||
| @ -40,5 +40,9 @@ sudoers include {{ included_file }}: | |||||||
|       - file: {{ sudoers.configpath }}/sudoers |       - file: {{ sudoers.configpath }}/sudoers | ||||||
|     - require_in: |     - require_in: | ||||||
|       - file: {{ sudoers.includedir }} |       - file: {{ sudoers.includedir }} | ||||||
|  |     {% elif sudoers.append_included_files_to_endof_main_config %} | ||||||
|  |   file.append: | ||||||
|  |     - name: {{ sudoers.configpath }}/sudoers | ||||||
|  |     - text: '#include {{ sudoers.configpath }}/sudoers.d/{{ included_file }}' | ||||||
|     {% endif %} |     {% endif %} | ||||||
| {% endfor %} | {% endfor %} | ||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ values: | |||||||
|       - millert |       - millert | ||||||
|       - dowdy |       - dowdy | ||||||
|       - mikef |       - mikef | ||||||
|  |   append_included_files_to_endof_main_config: false | ||||||
|   arch: amd64 |   arch: amd64 | ||||||
|   configpath: /etc |   configpath: /etc | ||||||
|   defaults: |   defaults: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user