From 957c53ecb2bcac243c35b564edb8fe87e5943f2d Mon Sep 17 00:00:00 2001 From: Enno Gotthold Date: Tue, 21 Nov 2023 23:07:43 +0100 Subject: [PATCH] feat(config): add default configuration files --- cobbler/config/file.sls | 2 +- cobbler/files/default/example.tmpl | 6 - cobbler/files/default/example.tmpl.jinja | 11 - cobbler/files/default/modules.conf.jinja | 20 ++ cobbler/files/default/mongodb.conf.jinja | 6 + cobbler/files/default/settings.yaml.jinja | 226 ++++++++++++++++++ cobbler/parameters/defaults.yaml | 64 ++++- cobbler/parameters/os/Ubuntu.yaml | 7 +- cobbler/parameters/os_family/Debian.yaml | 10 + cobbler/parameters/os_family/RedHat.yaml | 5 + cobbler/parameters/os_family/Suse.yaml | 3 +- test/integration/default/controls/config.rb | 33 +-- test/integration/default/controls/services.rb | 12 +- .../default/files/_mapdata/almalinux-8.yaml | 70 +++++- .../default/files/_mapdata/centos-8.yaml | 70 +++++- .../default/files/_mapdata/debian-10.yaml | 3 +- .../default/files/_mapdata/debian-11.yaml | 70 +++++- .../default/files/_mapdata/debian-9.yaml | 3 +- .../default/files/_mapdata/fedora-36.yaml | 70 +++++- .../default/files/_mapdata/opensuse-15.yaml | 70 +++++- .../files/_mapdata/opensuse-tumbleweed.yaml | 70 +++++- .../default/files/_mapdata/rockylinux-8.yaml | 70 +++++- .../default/files/_mapdata/ubuntu-22.yaml | 70 +++++- test/salt/pillar/default.sls | 20 +- test/salt/pillar/upstart.sls | 3 +- 25 files changed, 817 insertions(+), 177 deletions(-) delete mode 100644 cobbler/files/default/example.tmpl delete mode 100644 cobbler/files/default/example.tmpl.jinja create mode 100644 cobbler/files/default/modules.conf.jinja create mode 100644 cobbler/files/default/mongodb.conf.jinja create mode 100644 cobbler/files/default/settings.yaml.jinja diff --git a/cobbler/config/file.sls b/cobbler/config/file.sls index 38eac9d3..92fcae1a 100644 --- a/cobbler/config/file.sls +++ b/cobbler/config/file.sls @@ -13,7 +13,7 @@ include: cobbler-config-file-file-managed: file.managed: - name: {{ cobbler.config }} - - source: {{ files_switch(['example.tmpl'], + - source: {{ files_switch(['settings.yaml.jinja'], lookup='cobbler-config-file-file-managed' ) }} diff --git a/cobbler/files/default/example.tmpl b/cobbler/files/default/example.tmpl deleted file mode 100644 index 2c9c60f9..00000000 --- a/cobbler/files/default/example.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -######################################################################## -# File managed by Salt at <{{ source }}>. -# Your changes will be overwritten. -######################################################################## - -This is an example file from SaltStack template-formula. diff --git a/cobbler/files/default/example.tmpl.jinja b/cobbler/files/default/example.tmpl.jinja deleted file mode 100644 index e8345d26..00000000 --- a/cobbler/files/default/example.tmpl.jinja +++ /dev/null @@ -1,11 +0,0 @@ -######################################################################## -# File managed by Salt at <{{ source }}>. -# Your changes will be overwritten. -######################################################################## - -This is another example file from SaltStack template-formula. - -# This is here for testing purposes -{{ cobbler | json }} - -winner of the merge: {{ cobbler['winner'] }} diff --git a/cobbler/files/default/modules.conf.jinja b/cobbler/files/default/modules.conf.jinja new file mode 100644 index 00000000..46e54d8d --- /dev/null +++ b/cobbler/files/default/modules.conf.jinja @@ -0,0 +1,20 @@ +# Cobbler module configuration file +# Documentation: https://cobbler.readthedocs.io/en/latest/cobbler-conf.html#modules-conf + +# THIS FILE IS MANAGED BY SALTSTACK! + +[authentication] +module = authentication.configfile +hash_algorithm = sha3_512 + +[authorization] +module = authorization.allowall + +[dns] +module = managers.bind + +[dhcp] +module = managers.isc + +[tftpd] +module = managers.in_tftpd \ No newline at end of file diff --git a/cobbler/files/default/mongodb.conf.jinja b/cobbler/files/default/mongodb.conf.jinja new file mode 100644 index 00000000..cef167e9 --- /dev/null +++ b/cobbler/files/default/mongodb.conf.jinja @@ -0,0 +1,6 @@ +# Cobbler MongoDB configuration file +# THIS FILE IS MANAGED BY SALTSTACK! + +[connection] +host = localhost +port = 27017 \ No newline at end of file diff --git a/cobbler/files/default/settings.yaml.jinja b/cobbler/files/default/settings.yaml.jinja new file mode 100644 index 00000000..04caf0ee --- /dev/null +++ b/cobbler/files/default/settings.yaml.jinja @@ -0,0 +1,226 @@ +# Cobbler settings file +# THIS FILE IS MANAGED BY SALTSTACK! +# This config file is in YAML 1.2 format; see "http://yaml.org". + +auto_migrate_settings: {{ cobbler['auto_migrate_settings']|yaml_encode }} +allow_duplicate_hostnames: false +allow_duplicate_ips: false +allow_duplicate_macs: false +allow_dynamic_settings: false +anamon_enabled: false +authn_pam_service: "login" +auth_token_expiration: 3600 +autoinstall_snippets_dir: /var/lib/cobbler/snippets +autoinstall_templates_dir: /var/lib/cobbler/templates +boot_loader_conf_template_dir: "/etc/cobbler/boot_loader_conf" +bootloaders_dir: "/var/lib/cobbler/loaders" +bootloaders_formats: + aarch64: + binary_name: grubaa64.efi + arm: + binary_name: bootarm.efi + arm64-efi: + binary_name: grubaa64.efi + extra_modules: + - efinet + i386-efi: + binary_name: bootia32.efi + i386-pc-pxe: + binary_name: grub.0 + mod_dir: i386-pc + extra_modules: + - chain + - pxe + - biosdisk + i686: + binary_name: bootia32.efi + IA64: + binary_name: bootia64.efi + powerpc-ieee1275: + binary_name: grub.ppc64le + extra_modules: + - net + - ofnet + x86_64-efi: + binary_name: grubx86.efi + extra_modules: + - chain + - efinet +bootloaders_modules: + - btrfs + - ext2 + - xfs + - jfs + - reiserfs + - all_video + - boot + - cat + - configfile + - echo + - fat + - font + - gfxmenu + - gfxterm + - gzio + - halt + - iso9660 + - jpeg + - linux + - loadenv + - minicmd + - normal + - part_apple + - part_gpt + - part_msdos + - password_pbkdf2 + - png + - reboot + - search + - search_fs_file + - search_fs_uuid + - search_label + - sleep + - test + - "true" + - video + - mdraid09 + - mdraid1x + - lvm + - serial + - regexp + - tr + - tftp + - http + - luks + - gcry_rijndael + - gcry_sha1 + - gcry_sha256 +syslinux_dir: {{ cobbler['bootloaders']['syslinux']['location']|yaml_encode }} +syslinux_memdisk_folder: {{ cobbler['bootloaders']['syslinux']['memdisk_location']|yaml_encode }} +syslinux_pxelinux_folder: {{ cobbler['bootloaders']['syslinux']['pxelinux_location']|yaml_encode }} +grub2_mod_dir: {{ cobbler['bootloaders']['grub2']['mod_location']|yaml_encode }} +bootloaders_shim_folder: {{ cobbler['bootloaders']['shim']['location']|yaml_encode }} +bootloaders_shim_file: {{ cobbler['bootloaders']['shim']['file']|yaml_encode }} +bootloaders_ipxe_folder: {{ cobbler['bootloaders']['ipxe']['location']|yaml_encode }} +build_reporting_enabled: false +build_reporting_sender: "" +build_reporting_email: [ 'root@localhost' ] +build_reporting_smtp_server: "localhost" +build_reporting_subject: "" +build_reporting_ignorelist: [] +cheetah_import_whitelist: + - "random" + - "re" + - "time" + - "netaddr" +createrepo_flags: "-c cache -s sha" +autoinstall: "default.ks" +default_name_servers: [] +default_name_servers_search: [] +default_ownership: + - "admin" +default_password_crypted: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." +default_template_type: "cheetah" +default_virt_bridge: xenbr0 +default_virt_file_size: 5.0 +default_virt_ram: 512 +default_virt_type: xenpv +enable_ipxe: {{ cobbler['bootloaders']['ipxe']['enabled']|yaml_encode }} +enable_menu: {{ cobbler['menu']['enabled']|yaml_encode }} +http_port: 80 +kernel_options: {} +ldap_server: "ldap.example.com" +ldap_base_dn: "DC=example,DC=com" +ldap_port: 389 +ldap_tls: true +ldap_anonymous_bind: true +ldap_search_bind_dn: '' +ldap_search_passwd: '' +ldap_search_prefix: 'uid=' +ldap_tls_cacertfile: '' +ldap_tls_keyfile: '' +ldap_tls_certfile: '' +ldap_tls_cacertdir: '' +ldap_tls_cipher_suite: '' +ldap_tls_reqcert: '' +mgmt_classes: [] +mgmt_parameters: + from_cobbler: true +puppet_auto_setup: false +sign_puppet_certs_automatically: false +puppetca_path: "/usr/bin/puppet" +remove_old_puppet_certs_automatically: false +puppet_server: 'puppet' +puppet_version: 2 +puppet_parameterized_classes: true +manage_dhcp: {{ (cobbler['dhcp']['v4'] or cobbler['dhcp']['v6'])|yaml_encode }} +manage_dhcp_v6: {{ cobbler['dhcp']['v6']|yaml_encode }} +manage_dhcp_v4: {{ cobbler['dhcp']['v4']|yaml_encode }} +next_server_v4: {{ cobbler['nextserver']['v4']|yaml_dquote }} +next_server_v6: {{ cobbler['nextserver']['v6']|yaml_dquote }} +manage_dns: {{ cobbler['dns']['enabled']|yaml_encode }} +bind_chroot_path: "" +bind_zonefile_path: {{ cobbler['dns']['bind']['location']|yaml_encode }} +bind_master: {{ cobbler['dns']['bind']['master']|yaml_encode }} +manage_forward_zones: [] +manage_reverse_zones: [] +manage_tftpd: {{ cobbler['tftp']['enabled']|yaml_encode }} +tftpboot_location: {{ cobbler['tftp']['location']|yaml_encode }} +manage_rsync: {{ cobbler['rsync']['enabled']|yaml_encode }} +power_management_default_type: {{ cobbler['power_management']['default_type']|yaml_dquote }} +pxe_just_once: true +nopxe_with_triggers: true +redhat_management_server: "xmlrpc.rhn.redhat.com" +redhat_management_permissive: false +redhat_management_key: "" +register_new_installs: false +reposync_flags: "--newest-only --delete --refresh --remote-time" +reposync_rsync_flags: "-rltDv --copy-unsafe-links" +restart_dns: true +restart_dhcp: true +run_install_triggers: true +scm_track_enabled: {{ cobbler['scm_track']['enabled']|yaml_encode }} +scm_track_mode: {{ cobbler['scm_track']['mode']|yaml_dquote }} +scm_track_author: {{ cobbler['scm_track']['author']|yaml_dquote }} +scm_push_script: {{ cobbler['scm_track']['push_script']|yaml_dquote }} +server: {{ cobbler['server'] }} +client_use_localhost: false +client_use_https: false +virt_auto_boot: true +webdir: "{{ cobbler['webdir'] }}/cobbler" +webdir_whitelist: + - misc + - web + - webui + - localmirror + - repo_mirror + - distro_mirror + - images + - links + - pub + - repo_profile + - repo_system + - svc + - rendered + - .link_cache +xmlrpc_port: 25151 +yum_post_install_mirror: true +yum_distro_priority: 1 +yumdownloader_flags: "--resolve" +serializer_pretty_json: false +replicate_rsync_options: "-avzH" +replicate_repo_rsync_options: "-avzH" +always_write_dhcp_entries: false +proxy_url_ext: "" +proxy_url_int: "" +jinja2_includedir: "/var/lib/cobbler/jinja2" +convert_server_to_ip: false +buildisodir: "/var/cache/cobbler/buildiso" +cobbler_master: "" +default_virt_disk_driver: "raw" +grubconfig_dir: "/var/lib/cobbler/grub_config" +iso_template_dir: "/etc/cobbler/iso" +puppet_version: 2 +signature_path: "/var/lib/cobbler/distro_signatures.json" +signature_url: "https://cobbler.github.io/signatures/3.0.x/latest.json" +include: [ "/etc/cobbler/settings.d/*.settings" ] diff --git a/cobbler/parameters/defaults.yaml b/cobbler/parameters/defaults.yaml index d2c28d82..5500d848 100644 --- a/cobbler/parameters/defaults.yaml +++ b/cobbler/parameters/defaults.yaml @@ -17,11 +17,61 @@ values: # This is mutually exclusive with "communityrepo"! enabled: false name: cobbler - rootgroup: root - config: '/etc/cobbler' service: - name: cobbler - # Just here for testing - added_in_defaults: defaults_value - winner: defaults -... + name: cobblerd + rootgroup: root + auto_migrate_settings: false + server: "127.0.0.1" + menu: + enabled: true + default_kernel_options: {} + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + module: "allowall" + default_ownership: "admin" + bootloaders: + syslinux: + location: "/usr/share/syslinux" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + grub2: + mod_location: "/usr/share/grub2" + shim: + location: "/usr/share/efi/*/" + # This is YAML as such we need a double backslash to get a single one. + file: "shim\\.efi" + ipxe: + enabled: false + location: /usr/share/ipxe/ + dhcp: + v4: false + v6: false + module: "isc" + dns: + enabled: false + module: "bind" + bind: + location: /var/lib/named + master: "127.0.0.1" + forward_zones: [] + reverse_zones: [] + tftp: + enabled: true + module: "in_tftpd" + location: "/srv/tftpboot" + nextserver: + v4: "127.0.0.1" + v6: "::1" + rsync: + enabled: false + power_management: + default_type: "ipmilanplus" + scm_track: + enabled: false + mode: "git" + author: "cobbler " + push_script: "/bin/true" + config: /etc/cobbler/settings.yaml + webdir: /var/www diff --git a/cobbler/parameters/os/Ubuntu.yaml b/cobbler/parameters/os/Ubuntu.yaml index 3c35cb7f..1886cfae 100644 --- a/cobbler/parameters/os/Ubuntu.yaml +++ b/cobbler/parameters/os/Ubuntu.yaml @@ -11,5 +11,10 @@ # you can remove this file or provide at least an empty dict, e.g. # values: {} --- -values: {} +values: + dns: + bind: + location: /etc/bind/db. + tftp: + location: /var/lib/tftpboot ... diff --git a/cobbler/parameters/os_family/Debian.yaml b/cobbler/parameters/os_family/Debian.yaml index bae297c8..ffdbb48a 100644 --- a/cobbler/parameters/os_family/Debian.yaml +++ b/cobbler/parameters/os_family/Debian.yaml @@ -12,7 +12,17 @@ # values: {} --- values: + bootloaders: + ipxe: + location: "/usr/lib/ipxe/" + shim: + location: "/usr/lib/shim/" + file: "shim.*\\.efi\\.signed" + syslinux: + location: "/usr/lib/syslinux/modules/bios/" pkg: communityrepo: enabled: true + tftp: + location: "/srv/tftp" ... diff --git a/cobbler/parameters/os_family/RedHat.yaml b/cobbler/parameters/os_family/RedHat.yaml index 01067622..9afc5566 100644 --- a/cobbler/parameters/os_family/RedHat.yaml +++ b/cobbler/parameters/os_family/RedHat.yaml @@ -12,7 +12,12 @@ # values: {} --- values: + dns: + bind: + location: /var/named pkg: epel: enabled: true + tftp: + location: "/var/lib/tftpboot" ... diff --git a/cobbler/parameters/os_family/Suse.yaml b/cobbler/parameters/os_family/Suse.yaml index a6088457..b8df81d0 100644 --- a/cobbler/parameters/os_family/Suse.yaml +++ b/cobbler/parameters/os_family/Suse.yaml @@ -11,5 +11,6 @@ # you can remove this file or provide at least an empty dict, e.g. # values: {} --- -values: {} +values: + webdir: /srv/www ... diff --git a/test/integration/default/controls/config.rb b/test/integration/default/controls/config.rb index afa5dde8..c8347896 100644 --- a/test/integration/default/controls/config.rb +++ b/test/integration/default/controls/config.rb @@ -3,36 +3,19 @@ control 'cobbler.config.file' do title 'Verify the configuration file' - describe file('/etc/template-formula.conf') do + describe file('/etc/cobbler/settings.yaml') do it { should be_file } it { should be_owned_by 'root' } it { should be_grouped_into 'root' } its('mode') { should cmp '0644' } its('content') do - should include( - 'This is another example file from SaltStack template-formula.' - ) + should include('# THIS FILE IS MANAGED BY SALTSTACK!') end - its('content') { should include '"added_in_pillar": "pillar_value"' } - its('content') { should include '"added_in_defaults": "defaults_value"' } - its('content') { should include '"added_in_lookup": "lookup_value"' } - its('content') { should include '"config": "/etc/template-formula.conf"' } - its('content') { should include '"lookup": {"added_in_lookup": "lookup_value",' } - its('content') { should include '"pkg": {"communityrepo": {' } - its('content') { should include '"service": {"name": "' } - its('content') do - # rubocop:disable Lint/RedundantCopDisableDirective - # rubocop:disable Layout/LineLength - should include( - '"tofs": {"files_switch": ["any/path/can/be/used/here", "id", '\ - '"roles", "osfinger", "os", "os_family"], "source_files": '\ - '{"cobbler-config-file-file-managed": ["example.tmpl.jinja"]}}' - ) - # rubocop:enable Layout/LineLength - # rubocop:enable Lint/RedundantCopDisableDirective - end - its('content') { should include '"arch": "amd64"' } - its('content') { should include '"winner": "pillar"}' } - its('content') { should include 'winner of the merge: pillar' } + # Added in pillar + its('content') { should include 'manage_dns: true' } + # Added in defaults + its('content') { should include 'auto_migrate_settings: false' } + # Lookup value + its('content') { should include 'manage_dhcp_v4: true' } end end diff --git a/test/integration/default/controls/services.rb b/test/integration/default/controls/services.rb index a40300bb..0be0eb7a 100644 --- a/test/integration/default/controls/services.rb +++ b/test/integration/default/controls/services.rb @@ -1,19 +1,9 @@ # frozen_string_literal: true -# Prepare platform "finger" -platform_finger = system.platform[:finger].split('.').first.to_s - control 'cobbler.service.running' do title 'The service should be installed, enabled and running' - # Override by `platform_finger` - service_name = - case platform_finger - when 'centos-6', 'amazonlinux-1' - 'crond' - else - 'systemd-journald' - end + service_name = 'cobblerd' describe service(service_name) do it { should be_installed } diff --git a/test/integration/default/files/_mapdata/almalinux-8.yaml b/test/integration/default/files/_mapdata/almalinux-8.yaml index 2005f879..e66135ac 100644 --- a/test/integration/default/files/_mapdata/almalinux-8.yaml +++ b/test/integration/default/files/_mapdata/almalinux-8.yaml @@ -2,15 +2,44 @@ # AlmaLinux-8 --- values: - added_in_defaults: defaults_value - added_in_lookup: lookup_value - added_in_pillar: pillar_value arch: amd64 - config: /etc/template-formula.conf + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + default_ownership: "admin" + module: "allowall" + auto_migrate_settings: false + bootloaders: + grub2: + mod_location: "/usr/share/grub2" + ipxe: + enabled: false + location: "/usr/share/ipxe/" + shim: + file: shim\.efi + location: "/usr/share/efi/*/" + syslinux: + location: "/usr/share/syslinux" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + config: /etc/cobbler/settings.yaml + default_kernel_options: {} + dhcp: + module: "isc" + v4: true + v6: false + dns: + bind: + forward_zones: [] + location: "/var/named" + master: "127.0.0.1" + reverse_zones: [] + enabled: true + module: "bind" lookup: - added_in_lookup: lookup_value - master: template-master - winner: lookup + dhcp: + v4: true map_jinja: sources: - Y:G@osarch @@ -20,7 +49,11 @@ values: - C@cobbler:lookup - C@cobbler - Y:G@id - master: template-master + menu: + enabled: true + nextserver: + v4: "127.0.0.1" + v6: ::1 pkg: communityrepo: enabled: false @@ -31,12 +64,25 @@ values: source: enabled: false version: main + power_management: + default_type: "ipmilanplus" rootgroup: root + rsync: + enabled: false + scm_track: + author: "cobbler " + enabled: false + mode: "git" + push_script: "/bin/true" + server: "127.0.0.1" service: - name: systemd-journald + name: cobblerd + tftp: + enabled: true + location: "/var/lib/tftpboot" + module: "in_tftpd" tofs: files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -44,5 +90,5 @@ values: - os_family source_files: cobbler-config-file-file-managed: - - example.tmpl.jinja - winner: pillar + - settings.yaml.jinja + webdir: "/var/www" diff --git a/test/integration/default/files/_mapdata/centos-8.yaml b/test/integration/default/files/_mapdata/centos-8.yaml index ad7d16fa..b954e4a0 100644 --- a/test/integration/default/files/_mapdata/centos-8.yaml +++ b/test/integration/default/files/_mapdata/centos-8.yaml @@ -2,15 +2,44 @@ # CentOS Linux-8 --- values: - added_in_defaults: defaults_value - added_in_lookup: lookup_value - added_in_pillar: pillar_value arch: amd64 - config: /etc/template-formula.conf + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + default_ownership: "admin" + module: "allowall" + auto_migrate_settings: false + bootloaders: + grub2: + mod_location: "/usr/share/grub2" + ipxe: + enabled: false + location: "/usr/share/ipxe/" + shim: + file: shim\.efi + location: "/usr/share/efi/*/" + syslinux: + location: "/usr/share/syslinux" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + config: /etc/cobbler/settings.yaml + default_kernel_options: {} + dhcp: + module: "isc" + v4: true + v6: false + dns: + bind: + forward_zones: [] + location: "/var/named" + master: "127.0.0.1" + reverse_zones: [] + enabled: true + module: "bind" lookup: - added_in_lookup: lookup_value - master: template-master - winner: lookup + dhcp: + v4: true map_jinja: sources: - Y:G@osarch @@ -20,7 +49,11 @@ values: - C@cobbler:lookup - C@cobbler - Y:G@id - master: template-master + menu: + enabled: true + nextserver: + v4: "127.0.0.1" + v6: ::1 pkg: communityrepo: enabled: false @@ -31,12 +64,25 @@ values: source: enabled: false version: main + power_management: + default_type: "ipmilanplus" rootgroup: root + rsync: + enabled: false + scm_track: + author: "cobbler " + enabled: false + mode: "git" + push_script: "/bin/true" + server: "127.0.0.1" service: - name: systemd-journald + name: cobblerd + tftp: + enabled: true + location: "/var/lib/tftpboot" + module: "in_tftpd" tofs: files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -44,5 +90,5 @@ values: - os_family source_files: cobbler-config-file-file-managed: - - example.tmpl.jinja - winner: pillar + - settings.yaml.jinja + webdir: "/var/www" diff --git a/test/integration/default/files/_mapdata/debian-10.yaml b/test/integration/default/files/_mapdata/debian-10.yaml index 8cd5fa2e..d5f22b73 100644 --- a/test/integration/default/files/_mapdata/debian-10.yaml +++ b/test/integration/default/files/_mapdata/debian-10.yaml @@ -22,7 +22,8 @@ values: - Y:G@id master: template-master pkg: - name: bash + communityrepo: + enabled: true rootgroup: root service: name: systemd-journald diff --git a/test/integration/default/files/_mapdata/debian-11.yaml b/test/integration/default/files/_mapdata/debian-11.yaml index b5223f9d..2eed3fec 100644 --- a/test/integration/default/files/_mapdata/debian-11.yaml +++ b/test/integration/default/files/_mapdata/debian-11.yaml @@ -2,15 +2,44 @@ # Debian-11 --- values: - added_in_defaults: defaults_value - added_in_lookup: lookup_value - added_in_pillar: pillar_value arch: amd64 - config: /etc/template-formula.conf + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + default_ownership: "admin" + module: "allowall" + auto_migrate_settings: false + bootloaders: + grub2: + mod_location: "/usr/share/grub2" + ipxe: + enabled: false + location: "/usr/lib/ipxe/" + shim: + file: "shim.*\\.efi\\.signed" + location: "/usr/lib/shim/" + syslinux: + location: "/usr/lib/syslinux/modules/bios/" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + config: /etc/cobbler/settings.yaml + default_kernel_options: {} + dhcp: + module: "isc" + v4: true + v6: false + dns: + bind: + forward_zones: [] + location: "/var/lib/named" + master: "127.0.0.1" + reverse_zones: [] + enabled: true + module: "bind" lookup: - added_in_lookup: lookup_value - master: template-master - winner: lookup + dhcp: + v4: true map_jinja: sources: - Y:G@osarch @@ -20,7 +49,11 @@ values: - C@cobbler:lookup - C@cobbler - Y:G@id - master: template-master + menu: + enabled: true + nextserver: + v4: "127.0.0.1" + v6: ::1 pkg: communityrepo: enabled: true @@ -31,12 +64,25 @@ values: source: enabled: false version: "main" + power_management: + default_type: "ipmilanplus" rootgroup: root + rsync: + enabled: false + scm_track: + author: "cobbler " + enabled: false + mode: "git" + push_script: "/bin/true" + server: "127.0.0.1" service: - name: systemd-journald + name: cobblerd + tftp: + enabled: true + location: "/srv/tftp" + module: "in_tftpd" tofs: files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -44,5 +90,5 @@ values: - os_family source_files: cobbler-config-file-file-managed: - - example.tmpl.jinja - winner: pillar + - settings.yaml.jinja + webdir: "/var/www" diff --git a/test/integration/default/files/_mapdata/debian-9.yaml b/test/integration/default/files/_mapdata/debian-9.yaml index 335da2e9..c2fc141a 100644 --- a/test/integration/default/files/_mapdata/debian-9.yaml +++ b/test/integration/default/files/_mapdata/debian-9.yaml @@ -22,7 +22,8 @@ values: - Y:G@id master: template-master pkg: - name: bash + communityrepo: + enabled: true rootgroup: root service: name: systemd-journald diff --git a/test/integration/default/files/_mapdata/fedora-36.yaml b/test/integration/default/files/_mapdata/fedora-36.yaml index e5626d09..17b58c38 100644 --- a/test/integration/default/files/_mapdata/fedora-36.yaml +++ b/test/integration/default/files/_mapdata/fedora-36.yaml @@ -2,15 +2,44 @@ # Fedora-36 --- values: - added_in_defaults: defaults_value - added_in_lookup: lookup_value - added_in_pillar: pillar_value arch: amd64 - config: /etc/template-formula.conf + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + default_ownership: "admin" + module: "allowall" + auto_migrate_settings: false + bootloaders: + grub2: + mod_location: "/usr/share/grub2" + ipxe: + enabled: false + location: "/usr/share/ipxe/" + shim: + file: shim\.efi + location: "/usr/share/efi/*/" + syslinux: + location: "/usr/share/syslinux" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + config: /etc/cobbler/settings.yaml + default_kernel_options: {} + dhcp: + module: "isc" + v4: true + v6: false + dns: + bind: + forward_zones: [] + location: "/var/named" + master: "127.0.0.1" + reverse_zones: [] + enabled: true + module: "bind" lookup: - added_in_lookup: lookup_value - master: template-master - winner: lookup + dhcp: + v4: true map_jinja: sources: - Y:G@osarch @@ -20,7 +49,11 @@ values: - C@cobbler:lookup - C@cobbler - Y:G@id - master: template-master + menu: + enabled: true + nextserver: + v4: "127.0.0.1" + v6: ::1 pkg: communityrepo: enabled: false @@ -31,12 +64,25 @@ values: source: enabled: false version: main + power_management: + default_type: "ipmilanplus" rootgroup: root + rsync: + enabled: false + scm_track: + author: "cobbler " + enabled: false + mode: "git" + push_script: "/bin/true" + server: "127.0.0.1" service: - name: systemd-journald + name: cobblerd + tftp: + enabled: true + location: "/var/lib/tftpboot" + module: "in_tftpd" tofs: files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -44,5 +90,5 @@ values: - os_family source_files: cobbler-config-file-file-managed: - - example.tmpl.jinja - winner: pillar + - settings.yaml.jinja + webdir: "/var/www" diff --git a/test/integration/default/files/_mapdata/opensuse-15.yaml b/test/integration/default/files/_mapdata/opensuse-15.yaml index a552432b..0bcce9e9 100644 --- a/test/integration/default/files/_mapdata/opensuse-15.yaml +++ b/test/integration/default/files/_mapdata/opensuse-15.yaml @@ -2,15 +2,44 @@ # Leap-15 --- values: - added_in_defaults: defaults_value - added_in_lookup: lookup_value - added_in_pillar: pillar_value arch: amd64 - config: /etc/template-formula.conf + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + default_ownership: "admin" + module: "allowall" + auto_migrate_settings: false + bootloaders: + grub2: + mod_location: "/usr/share/grub2" + ipxe: + enabled: false + location: "/usr/share/ipxe/" + shim: + file: shim\.efi + location: "/usr/share/efi/*/" + syslinux: + location: "/usr/share/syslinux" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + config: /etc/cobbler/settings.yaml + default_kernel_options: {} + dhcp: + module: "isc" + v4: true + v6: false + dns: + bind: + forward_zones: [] + location: "/var/lib/named" + master: "127.0.0.1" + reverse_zones: [] + enabled: true + module: "bind" lookup: - added_in_lookup: lookup_value - master: template-master - winner: lookup + dhcp: + v4: true map_jinja: sources: - Y:G@osarch @@ -20,7 +49,11 @@ values: - C@cobbler:lookup - C@cobbler - Y:G@id - master: template-master + menu: + enabled: true + nextserver: + v4: "127.0.0.1" + v6: ::1 pkg: communityrepo: enabled: false @@ -31,12 +64,25 @@ values: source: enabled: false version: main + power_management: + default_type: "ipmilanplus" rootgroup: root + rsync: + enabled: false + scm_track: + author: "cobbler " + enabled: false + mode: "git" + push_script: "/bin/true" + server: "127.0.0.1" service: - name: systemd-journald + name: cobblerd + tftp: + enabled: true + location: "/srv/tftpboot" + module: "in_tftpd" tofs: files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -44,5 +90,5 @@ values: - os_family source_files: cobbler-config-file-file-managed: - - example.tmpl.jinja - winner: pillar + - settings.yaml.jinja + webdir: "/srv/www" diff --git a/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml b/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml index 409896c9..2d15476f 100644 --- a/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml +++ b/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml @@ -2,15 +2,44 @@ # openSUSE Tumbleweed-yyyymmdd --- values: - added_in_defaults: defaults_value - added_in_lookup: lookup_value - added_in_pillar: pillar_value arch: amd64 - config: /etc/template-formula.conf + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + default_ownership: "admin" + module: "allowall" + auto_migrate_settings: false + bootloaders: + grub2: + mod_location: "/usr/share/grub2" + ipxe: + enabled: false + location: "/usr/share/ipxe/" + shim: + file: shim\.efi + location: "/usr/share/efi/*/" + syslinux: + location: "/usr/share/syslinux" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + config: /etc/cobbler/settings.yaml + default_kernel_options: {} + dhcp: + module: "isc" + v4: true + v6: false + dns: + bind: + forward_zones: [] + location: "/var/lib/named" + master: "127.0.0.1" + reverse_zones: [] + enabled: true + module: "bind" lookup: - added_in_lookup: lookup_value - master: template-master - winner: lookup + dhcp: + v4: true map_jinja: sources: - Y:G@osarch @@ -20,7 +49,11 @@ values: - C@cobbler:lookup - C@cobbler - Y:G@id - master: template-master + menu: + enabled: true + nextserver: + v4: "127.0.0.1" + v6: ::1 pkg: communityrepo: enabled: false @@ -31,12 +64,25 @@ values: source: enabled: false version: main + power_management: + default_type: "ipmilanplus" rootgroup: root + rsync: + enabled: false + scm_track: + author: "cobbler " + enabled: false + mode: "git" + push_script: "/bin/true" + server: "127.0.0.1" service: - name: systemd-journald + name: cobblerd + tftp: + enabled: true + location: "/srv/tftpboot" + module: "in_tftpd" tofs: files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -44,5 +90,5 @@ values: - os_family source_files: cobbler-config-file-file-managed: - - example.tmpl.jinja - winner: pillar + - settings.yaml.jinja + webdir: "/srv/www" diff --git a/test/integration/default/files/_mapdata/rockylinux-8.yaml b/test/integration/default/files/_mapdata/rockylinux-8.yaml index 8fb67724..80cfc419 100644 --- a/test/integration/default/files/_mapdata/rockylinux-8.yaml +++ b/test/integration/default/files/_mapdata/rockylinux-8.yaml @@ -2,15 +2,44 @@ # Rocky Linux-8 --- values: - added_in_defaults: defaults_value - added_in_lookup: lookup_value - added_in_pillar: pillar_value arch: amd64 - config: /etc/template-formula.conf + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + default_ownership: "admin" + module: "allowall" + auto_migrate_settings: false + bootloaders: + grub2: + mod_location: "/usr/share/grub2" + ipxe: + enabled: false + location: "/usr/share/ipxe/" + shim: + file: shim\.efi + location: "/usr/share/efi/*/" + syslinux: + location: "/usr/share/syslinux" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + config: /etc/cobbler/settings.yaml + default_kernel_options: {} + dhcp: + module: "isc" + v4: true + v6: false + dns: + bind: + forward_zones: [] + location: "/var/named" + master: "127.0.0.1" + reverse_zones: [] + enabled: true + module: "bind" lookup: - added_in_lookup: lookup_value - master: template-master - winner: lookup + dhcp: + v4: true map_jinja: sources: - Y:G@osarch @@ -20,7 +49,11 @@ values: - C@cobbler:lookup - C@cobbler - Y:G@id - master: template-master + menu: + enabled: true + nextserver: + v4: "127.0.0.1" + v6: ::1 pkg: communityrepo: enabled: false @@ -31,12 +64,25 @@ values: source: enabled: false version: main + power_management: + default_type: "ipmilanplus" rootgroup: root + rsync: + enabled: false + scm_track: + author: "cobbler " + enabled: false + mode: "git" + push_script: "/bin/true" + server: "127.0.0.1" service: - name: systemd-journald + name: cobblerd + tftp: + enabled: true + location: "/var/lib/tftpboot" + module: "in_tftpd" tofs: files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -44,5 +90,5 @@ values: - os_family source_files: cobbler-config-file-file-managed: - - example.tmpl.jinja - winner: pillar + - settings.yaml.jinja + webdir: "/var/www" diff --git a/test/integration/default/files/_mapdata/ubuntu-22.yaml b/test/integration/default/files/_mapdata/ubuntu-22.yaml index 88c29bb8..a3689dd3 100644 --- a/test/integration/default/files/_mapdata/ubuntu-22.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-22.yaml @@ -2,15 +2,44 @@ # Ubuntu-22.04 --- values: - added_in_defaults: defaults_value - added_in_lookup: lookup_value - added_in_pillar: pillar_value arch: amd64 - config: /etc/template-formula.conf + authentication: + module: "configfile" + password: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." + authorization: + default_ownership: "admin" + module: "allowall" + auto_migrate_settings: false + bootloaders: + grub2: + mod_location: "/usr/share/grub2" + ipxe: + enabled: false + location: "/usr/lib/ipxe/" + shim: + file: "shim.*\\.efi\\.signed" + location: "/usr/lib/shim/" + syslinux: + location: "/usr/lib/syslinux/modules/bios/" + memdisk_location: "/usr/share/syslinux" + pxelinux_location: "/usr/share/syslinux" + config: /etc/cobbler/settings.yaml + default_kernel_options: {} + dhcp: + module: "isc" + v4: true + v6: false + dns: + bind: + forward_zones: [] + location: "/etc/bind/db." + master: "127.0.0.1" + reverse_zones: [] + enabled: true + module: "bind" lookup: - added_in_lookup: lookup_value - master: template-master - winner: lookup + dhcp: + v4: true map_jinja: sources: - Y:G@osarch @@ -20,7 +49,11 @@ values: - C@cobbler:lookup - C@cobbler - Y:G@id - master: template-master + menu: + enabled: true + nextserver: + v4: "127.0.0.1" + v6: ::1 pkg: communityrepo: enabled: true @@ -31,12 +64,25 @@ values: source: enabled: false version: main + power_management: + default_type: "ipmilanplus" rootgroup: root + rsync: + enabled: false + scm_track: + author: "cobbler " + enabled: false + mode: "git" + push_script: "/bin/true" + server: "127.0.0.1" service: - name: systemd-journald + name: cobblerd + tftp: + enabled: true + location: "/var/lib/tftpboot" + module: "in_tftpd" tofs: files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -44,5 +90,5 @@ values: - os_family source_files: cobbler-config-file-file-managed: - - example.tmpl.jinja - winner: pillar + - settings.yaml.jinja + webdir: "/var/www" diff --git a/test/salt/pillar/default.sls b/test/salt/pillar/default.sls index 139fd6cd..7f0dbba5 100644 --- a/test/salt/pillar/default.sls +++ b/test/salt/pillar/default.sls @@ -2,15 +2,12 @@ # vim: ft=yaml --- cobbler: + # Lookup dictionary lookup: - master: template-master - # Just for testing purposes - winner: lookup - added_in_lookup: lookup_value - - service: - name: systemd-journald - config: /etc/template-formula.conf + dhcp: + v4: true + dns: + enabled: true tofs: # The files_switch key serves as a selector for alternative @@ -19,7 +16,6 @@ cobbler: # Note: Any value not evaluated by `config.get` will be used literally. # This can be used to set custom paths, as many levels deep as required. files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -43,8 +39,4 @@ cobbler: # For testing purposes source_files: cobbler-config-file-file-managed: - - 'example.tmpl.jinja' - - # Just for testing purposes - winner: pillar - added_in_pillar: pillar_value + - 'settings.yaml.jinja' diff --git a/test/salt/pillar/upstart.sls b/test/salt/pillar/upstart.sls index 3be19758..6b570d79 100644 --- a/test/salt/pillar/upstart.sls +++ b/test/salt/pillar/upstart.sls @@ -24,7 +24,6 @@ cobbler: # Note: Any value not evaluated by `config.get` will be used literally. # This can be used to set custom paths, as many levels deep as required. files_switch: - - any/path/can/be/used/here - id - roles - osfinger @@ -46,7 +45,7 @@ cobbler: # For testing purposes source_files: cobbler-config-file-file-managed: - - 'example.tmpl.jinja' + - 'settings.yaml.jinja' # Just for testing purposes winner: pillar