feat(ordering): optionally append includefiles to main config

pull/78/head
noelmcloughlin 2 years ago
parent 25cd2cf0e3
commit 751eff7218
  1. 2
      docs/README.rst
  2. 6
      pillar.example
  3. 1
      sudoers/defaults.yaml
  4. 5
      sudoers/included/init.sls
  5. 4
      sudoers/included/install.sls
  6. 1
      test/integration/default/files/_mapdata/almalinux-8.yaml
  7. 1
      test/integration/default/files/_mapdata/amazonlinux-1.yaml
  8. 1
      test/integration/default/files/_mapdata/amazonlinux-2.yaml
  9. 1
      test/integration/default/files/_mapdata/arch-base-latest.yaml
  10. 1
      test/integration/default/files/_mapdata/centos-6.yaml
  11. 1
      test/integration/default/files/_mapdata/centos-7.yaml
  12. 1
      test/integration/default/files/_mapdata/centos-8.yaml
  13. 1
      test/integration/default/files/_mapdata/debian-10.yaml
  14. 1
      test/integration/default/files/_mapdata/debian-11.yaml
  15. 1
      test/integration/default/files/_mapdata/debian-9.yaml
  16. 1
      test/integration/default/files/_mapdata/fedora-31.yaml
  17. 1
      test/integration/default/files/_mapdata/fedora-32.yaml
  18. 1
      test/integration/default/files/_mapdata/fedora-33.yaml
  19. 1
      test/integration/default/files/_mapdata/fedora-34.yaml
  20. 1
      test/integration/default/files/_mapdata/gentoo-2-sysd.yaml
  21. 1
      test/integration/default/files/_mapdata/gentoo-2-sysv.yaml
  22. 1
      test/integration/default/files/_mapdata/opensuse-15.yaml
  23. 1
      test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml
  24. 1
      test/integration/default/files/_mapdata/oraclelinux-7.yaml
  25. 1
      test/integration/default/files/_mapdata/oraclelinux-8.yaml
  26. 1
      test/integration/default/files/_mapdata/rockylinux-8.yaml
  27. 1
      test/integration/default/files/_mapdata/ubuntu-16.yaml
  28. 1
      test/integration/default/files/_mapdata/ubuntu-18.yaml
  29. 1
      test/integration/default/files/_mapdata/ubuntu-20.yaml

@ -51,7 +51,7 @@ Set up the sudoers file
``sudoers.included``
^^^^^^^^^^^^^^^^^^^^
Set up an additional sudoers included file
Set up an additional sudoers included file.
Testing

@ -63,3 +63,9 @@ sudoers:
netgroups:
other_netgroup:
- '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
includedir: /etc/sudoers.d
included_files: {}
append_included_files_to_endof_main_config: false

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
include:
- .install

@ -40,5 +40,9 @@ sudoers include {{ included_file }}:
- file: {{ sudoers.configpath }}/sudoers
- require_in:
- 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 %}
{% endfor %}

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

@ -20,6 +20,7 @@ values:
- millert
- dowdy
- mikef
append_included_files_to_endof_main_config: false
arch: amd64
configpath: /etc
defaults:

Loading…
Cancel
Save