diff --git a/modules/bases/debian_bookworm_desktop_kde/secgen_metadata.xml b/modules/bases/debian_bookworm_desktop_kde/secgen_metadata.xml new file mode 100644 index 000000000..eb616d5b1 --- /dev/null +++ b/modules/bases/debian_bookworm_desktop_kde/secgen_metadata.xml @@ -0,0 +1,29 @@ + + + + Debian 12 Bookworm Desktop KDE: PROXMOX ONLY + Z. Cliffe Schreuders + GPLv3 + Debian 12 Bookworm Desktop KDE amd64 -- dist-upgrade from buster box. Use buster on VirtualBox and oVirt. For testing purposes, the default root password is puppet. + I need to build this for VirtualBox. + 64-bit + desktop + + linux + unix + Debian 12 Buster amd64 + https://app.vagrantup.com/secgen/boxes/debian_stretch_desktop_kde/versions/1.2/providers/virtualbox.box + https://app.vagrantup.com/redwiz666/boxes/debian_stretch_desktop_kde/versions/1.0.0/providers/vmware.box + buster_desktop_kde_20230615 + bookworm-desktop-kde-20240703 + + https://atlas.hashicorp.com/puppetlabs + various + + + + bases/.* + + diff --git a/modules/bases/debian_buster_desktop_kde/secgen_metadata.xml b/modules/bases/debian_buster_desktop_kde/secgen_metadata.xml index 05a3ff54d..fedafd0c0 100644 --- a/modules/bases/debian_buster_desktop_kde/secgen_metadata.xml +++ b/modules/bases/debian_buster_desktop_kde/secgen_metadata.xml @@ -17,7 +17,7 @@ https://app.vagrantup.com/secgen/boxes/debian_stretch_desktop_kde/versions/1.2/providers/virtualbox.box https://app.vagrantup.com/redwiz666/boxes/debian_stretch_desktop_kde/versions/1.0.0/providers/vmware.box buster_desktop_kde_20230615 - buster-desktop-kde-20231212 + buster-desktop-kde-20240703 https://atlas.hashicorp.com/puppetlabs various diff --git a/modules/bases/kali_light_msf/secgen_metadata.xml b/modules/bases/kali_light_msf/secgen_metadata.xml index 292b88115..25db0a131 100644 --- a/modules/bases/kali_light_msf/secgen_metadata.xml +++ b/modules/bases/kali_light_msf/secgen_metadata.xml @@ -17,7 +17,7 @@ https://app.vagrantup.com/secgen/boxes/kali_light_msf/versions/1.0/providers/virtualbox.box kali-linux-mfs-20231114 - kali-linux-msf-20230116 + kali-linux-msf-20240703 https://app.vagrantup.com/secgen diff --git a/modules/code_examples/vsftpd_234_backdoor/manifests/install.pp b/modules/code_examples/vsftpd_234_backdoor/manifests/install.pp index 311b707ab..13710476f 100644 --- a/modules/code_examples/vsftpd_234_backdoor/manifests/install.pp +++ b/modules/code_examples/vsftpd_234_backdoor/manifests/install.pp @@ -2,7 +2,7 @@ class vsftpd_234_backdoor::install { # Add 32bit libs for stretch case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch-buster-bookworm stuff exec { 'add_32bit_libs': command => '/usr/bin/dpkg --add-architecture i386 && /usr/bin/apt-get update' } diff --git a/modules/services/unix/database/mysql_kali_compatible/mysql/secgen_metadata.xml b/modules/services/unix/database/mysql_kali_compatible/mysql/secgen_metadata.xml index 3055ac6d7..2cab0a884 100644 --- a/modules/services/unix/database/mysql_kali_compatible/mysql/secgen_metadata.xml +++ b/modules/services/unix/database/mysql_kali_compatible/mysql/secgen_metadata.xml @@ -19,20 +19,18 @@ mysql GPL v2 + - .*debian_stretch.* - - - .*debian_buster.* - - - .*debian_wheezy.* + .*bases/(?!kali).* mysql + + .*/puppet_module/cron.* + update diff --git a/modules/services/unix/database/mysql_stretch_compatible/mysql/manifests/server/installdb.pp b/modules/services/unix/database/mysql_stretch_compatible/mysql/manifests/server/installdb.pp index ee80b4604..4a2832457 100644 --- a/modules/services/unix/database/mysql_stretch_compatible/mysql/manifests/server/installdb.pp +++ b/modules/services/unix/database/mysql_stretch_compatible/mysql/manifests/server/installdb.pp @@ -22,6 +22,13 @@ class mysql::server::installdb { } if $options['mysqld']['log-error'] { + file { '/var/log/mysql': + ensure => 'directory', + owner => $mysqluser, + group => $::mysql::server::mysql_group, + mode => '0750', + before => File[$log_error], + } file { $options['mysqld']['log-error']: ensure => present, owner => $mysqluser, diff --git a/modules/services/unix/database/mysql_stretch_compatible/mysql/secgen_metadata.xml b/modules/services/unix/database/mysql_stretch_compatible/mysql/secgen_metadata.xml index 089853950..3799299b2 100644 --- a/modules/services/unix/database/mysql_stretch_compatible/mysql/secgen_metadata.xml +++ b/modules/services/unix/database/mysql_stretch_compatible/mysql/secgen_metadata.xml @@ -19,14 +19,9 @@ mysql GPL v2 + - .*debian_stretch.* - - - .*kali_light.* - - - .*debian_wheezy.* + .*bases/(?!.*debian_(bookworm|buster|stretch).*) @@ -34,6 +29,9 @@ mysql + + .*/puppet_module/cron.* + update diff --git a/modules/services/unix/database/mysql_wheezy_compatible/mysql/secgen_metadata.xml b/modules/services/unix/database/mysql_wheezy_compatible/mysql/secgen_metadata.xml index dd796136a..bdbe98c3e 100644 --- a/modules/services/unix/database/mysql_wheezy_compatible/mysql/secgen_metadata.xml +++ b/modules/services/unix/database/mysql_wheezy_compatible/mysql/secgen_metadata.xml @@ -19,14 +19,9 @@ mysql GPL v2 - - .*debian_stretch.* - + - .*debian_buster.* - - - .*kali_light.* + .*bases/(?!debian_wheezy).* diff --git a/modules/services/unix/http/apache_kali_compatible/apache/secgen_metadata.xml b/modules/services/unix/http/apache_kali_compatible/apache/secgen_metadata.xml index 0b4c1606f..9b0db4f60 100644 --- a/modules/services/unix/http/apache_kali_compatible/apache/secgen_metadata.xml +++ b/modules/services/unix/http/apache_kali_compatible/apache/secgen_metadata.xml @@ -32,6 +32,10 @@ .*debian_wheezy.* + + + .*bases/(?!kali).* + update diff --git a/modules/services/unix/http/apache_stretch_compatible/apache/secgen_metadata.xml b/modules/services/unix/http/apache_stretch_compatible/apache/secgen_metadata.xml index b63e58c3d..6ac4aa344 100644 --- a/modules/services/unix/http/apache_stretch_compatible/apache/secgen_metadata.xml +++ b/modules/services/unix/http/apache_stretch_compatible/apache/secgen_metadata.xml @@ -25,11 +25,9 @@ apache + - .*Wheezy.* - - - bases/.*kali.* + .*bases/(?!debian_(bookworm|buster|stretch)).* update diff --git a/modules/services/unix/http/apache_wheezy_compatible/apache/secgen_metadata.xml b/modules/services/unix/http/apache_wheezy_compatible/apache/secgen_metadata.xml index f112311d4..f5bc21fd9 100644 --- a/modules/services/unix/http/apache_wheezy_compatible/apache/secgen_metadata.xml +++ b/modules/services/unix/http/apache_wheezy_compatible/apache/secgen_metadata.xml @@ -23,14 +23,9 @@ apache + - Kali - - - Stretch - - - Buster + .*bases/(?!debian_wheezy).* update diff --git a/modules/services/unix/http/php_5_stretch_compatible/php/manifests/install.pp b/modules/services/unix/http/php_5_stretch_compatible/php/manifests/install.pp index 398066431..494423027 100644 --- a/modules/services/unix/http/php_5_stretch_compatible/php/manifests/install.pp +++ b/modules/services/unix/http/php_5_stretch_compatible/php/manifests/install.pp @@ -9,7 +9,7 @@ class php::install { exec { 'add repo to sources': command => - '/bin/echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list', + '/bin/echo "deb http://172.33.0.44/packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list', } -> exec { 'apt update': diff --git a/modules/services/unix/http/php_5_stretch_compatible/php/secgen_metadata.xml b/modules/services/unix/http/php_5_stretch_compatible/php/secgen_metadata.xml index e61a69fe2..420574776 100644 --- a/modules/services/unix/http/php_5_stretch_compatible/php/secgen_metadata.xml +++ b/modules/services/unix/http/php_5_stretch_compatible/php/secgen_metadata.xml @@ -18,8 +18,9 @@ php PHP License v3.01 + - .*Wheezy.* + .*bases/debian_wheezy.* diff --git a/modules/services/unix/http/php_5_wheezy_compatible/php/secgen_metadata.xml b/modules/services/unix/http/php_5_wheezy_compatible/php/secgen_metadata.xml index a55327855..2dccedd94 100644 --- a/modules/services/unix/http/php_5_wheezy_compatible/php/secgen_metadata.xml +++ b/modules/services/unix/http/php_5_wheezy_compatible/php/secgen_metadata.xml @@ -16,14 +16,9 @@ php PHP License v3.01 + - .*Kali.* - - - .*Stretch.* - - - .*Buster.* + .*bases/(?!debian_wheezy).* update diff --git a/modules/services/unix/irc/unrealirc/manifests/install.pp b/modules/services/unix/irc/unrealirc/manifests/install.pp index b52fe7047..11f56bcea 100644 --- a/modules/services/unix/irc/unrealirc/manifests/install.pp +++ b/modules/services/unix/irc/unrealirc/manifests/install.pp @@ -42,19 +42,31 @@ class unrealirc::install { require => Exec['extract-unrealirc'], } - ensure_packages('build-essential') - ensure_packages('gcc-multilib') + ensure_packages([ + 'build-essential', + 'pkg-config', + 'gdb', + 'gcc-multilib', + 'zlib1g-dev', + 'libssl-dev', + 'libpcre2-dev', + 'libargon2-0-dev', + 'libsodium-dev', + 'libc-ares-dev', + 'libcurl4-openssl-dev' + ]) # Configure and make unrealircd, with or without ssl enabled if $unrealirc::use_ssl { - package { 'libssl-dev': - ensure => present, - } + exec { 'make-unrealirc': command => "${configure} --enable-ssl && make", timeout => 0, cwd => "${unrealirc::install_path}", creates => "${unrealirc::install_path}/unreal", + environment => [ + 'CFLAGS=-fno-strict-aliasing -fno-strict-overflow -std=gnu89 -Wno-pointer-sign -fcommon' + ], require => [ Package['build-essential','gcc-multilib','libssl-dev'], Exec['unrealirc-dir'] ], } } else { @@ -63,7 +75,12 @@ class unrealirc::install { timeout => 0, cwd => "${unrealirc::install_path}", creates => "${unrealirc::install_path}/unreal", + environment => [ + # these flags are required to get it compiled on newer systems (after Debian Buster) + 'CFLAGS=-fno-strict-aliasing -fno-strict-overflow -std=gnu89 -Wno-pointer-sign -fcommon' + ], require => [Package['build-essential', 'gcc-multilib'],Exec['unrealirc-dir']], + logoutput => true, } } diff --git a/modules/utilities/unix/audit_tools/ghidra/manifests/install.pp b/modules/utilities/unix/audit_tools/ghidra/manifests/install.pp index 5fcbecc89..b2e5d50a0 100644 --- a/modules/utilities/unix/audit_tools/ghidra/manifests/install.pp +++ b/modules/utilities/unix/audit_tools/ghidra/manifests/install.pp @@ -1,6 +1,26 @@ class ghidra::install{ - ensure_packages(['openjdk-11-jre', 'openjdk-11-jdk', 'zip' ]) + ensure_packages('zip') + + if ($operatingsystem == 'Debian') { + case $operatingsystemrelease { + /^(12).*/: { # do 12.x bookworm stuff + ensure_packages(['openjdk-17-jre', 'openjdk-17-jdk']) + } + /^(9|10).*/: { # do 9.x stretch stuff + ensure_packages(['openjdk-11-jre', 'openjdk-11-jdk']) + } + /^7.*/: { # do 7.x wheezy stuff + # Will error -- TODO needs repo + ensure_packages(['openjdk-11-jre', 'openjdk-11-jdk']) + } + 'kali-rolling': { # do kali + ensure_packages(['openjdk-11-jre', 'openjdk-11-jdk']) + } + default: { + } + } + } file { '/opt/ghidra': ensure => directory, diff --git a/modules/utilities/unix/audit_tools/reversing_tools/manifests/install.pp b/modules/utilities/unix/audit_tools/reversing_tools/manifests/install.pp index 000cc9065..b065f66ac 100644 --- a/modules/utilities/unix/audit_tools/reversing_tools/manifests/install.pp +++ b/modules/utilities/unix/audit_tools/reversing_tools/manifests/install.pp @@ -1,7 +1,7 @@ class reversing_tools::install { Exec { path => ['/bin', '/usr/bin', '/usr/local/bin', '/sbin', '/usr/sbin'] } - ensure_packages(['gdb', 'git', 'ltrace', 'strace', 'valgrind', 'pax-utils', 'binwalk', 'vbindiff', 'ssdeep', 'pyew', 'gcc-multilib','yara']) + ensure_packages(['gdb', 'git', 'ltrace', 'strace', 'valgrind', 'pax-utils', 'binwalk', 'vbindiff', 'ssdeep', 'gcc-multilib','yara']) # java ensure_packages(['procyon-decompiler']) @@ -9,7 +9,7 @@ class reversing_tools::install { # ensure ncat is installed for testing purposes ensure_packages("nmap") case $operatingsystemrelease { - /^(10).*/: { # do buster stuff + /^(1[0-9]).*/: { # do buster stuff ensure_packages("ncat") } } diff --git a/modules/utilities/unix/desktop/kde_minimal/manifests/config.pp b/modules/utilities/unix/desktop/kde_minimal/manifests/config.pp index 64f0538c3..c650d033b 100644 --- a/modules/utilities/unix/desktop/kde_minimal/manifests/config.pp +++ b/modules/utilities/unix/desktop/kde_minimal/manifests/config.pp @@ -5,7 +5,7 @@ class kde_minimal::config { $autostart_konsole = str2bool($secgen_params['autostart_konsole'][0]) case $operatingsystemrelease { - /^10.*/: { # do 10.x buster stuff + /^1[0-9].*/: { # do 10.x buster|bookworm stuff if $autologin_user != "false" { file { "/etc/sddm.conf": ensure => file, @@ -65,7 +65,7 @@ class kde_minimal::config { } } - if $operatingsystemrelease =~ /^(9|10).*/ { # Disable stretch auto screen lock + if $operatingsystemrelease =~ /^(9|10).*/ { # Disable stretch auto screen lock (not needed for our new templates) file { "/home/$username/.config/kscreenlockerrc": ensure => file, source => 'puppet:///modules/kde_minimal/kscreenlockerrc', diff --git a/modules/utilities/unix/desktop/kde_minimal/manifests/install.pp b/modules/utilities/unix/desktop/kde_minimal/manifests/install.pp index 73496806c..1bff99493 100644 --- a/modules/utilities/unix/desktop/kde_minimal/manifests/install.pp +++ b/modules/utilities/unix/desktop/kde_minimal/manifests/install.pp @@ -1,7 +1,7 @@ class kde_minimal::install{ case $operatingsystem { 'Debian': { - package { ['kde-plasma-desktop', 'kate', 'ksnapshot', 'qtcurve', 'kdesudo']: + package { ['kde-plasma-desktop', 'kate', 'ksnapshot', 'qtcurve']: ensure => 'installed', } } diff --git a/modules/utilities/unix/malware/coconut/secgen_metadata.xml b/modules/utilities/unix/malware/coconut/secgen_metadata.xml index 96a059cfd..e10894d2a 100644 --- a/modules/utilities/unix/malware/coconut/secgen_metadata.xml +++ b/modules/utilities/unix/malware/coconut/secgen_metadata.xml @@ -35,6 +35,9 @@ + + .*/puppet_module/cron.* + update diff --git a/modules/utilities/unix/nc_message/manifests/install.pp b/modules/utilities/unix/nc_message/manifests/install.pp index 8877fa043..400185b8c 100644 --- a/modules/utilities/unix/nc_message/manifests/install.pp +++ b/modules/utilities/unix/nc_message/manifests/install.pp @@ -4,7 +4,7 @@ class nc_message::install { ensure_packages("nmap") case $operatingsystemrelease { - /^(10).*/: { # do buster stuff + /^(1[0-9]).*/: { # do buster stuff ensure_packages("ncat") } } diff --git a/modules/utilities/unix/nc_message/secgen_metadata.xml b/modules/utilities/unix/nc_message/secgen_metadata.xml index f2b1d0232..4286b7c14 100644 --- a/modules/utilities/unix/nc_message/secgen_metadata.xml +++ b/modules/utilities/unix/nc_message/secgen_metadata.xml @@ -33,6 +33,9 @@ + + .*/puppet_module/cron.* + update diff --git a/modules/utilities/unix/puppet_module/cron/.github/CONTRIBUTING.md b/modules/utilities/unix/puppet_module/cron_legacy/.github/CONTRIBUTING.md similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.github/CONTRIBUTING.md rename to modules/utilities/unix/puppet_module/cron_legacy/.github/CONTRIBUTING.md diff --git a/modules/utilities/unix/puppet_module/cron/.github/ISSUE_TEMPLATE.md b/modules/utilities/unix/puppet_module/cron_legacy/.github/ISSUE_TEMPLATE.md similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.github/ISSUE_TEMPLATE.md rename to modules/utilities/unix/puppet_module/cron_legacy/.github/ISSUE_TEMPLATE.md diff --git a/modules/utilities/unix/puppet_module/cron/.github/PULL_REQUEST_TEMPLATE.md b/modules/utilities/unix/puppet_module/cron_legacy/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.github/PULL_REQUEST_TEMPLATE.md rename to modules/utilities/unix/puppet_module/cron_legacy/.github/PULL_REQUEST_TEMPLATE.md diff --git a/modules/utilities/unix/puppet_module/cron/.gitignore b/modules/utilities/unix/puppet_module/cron_legacy/.gitignore similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.gitignore rename to modules/utilities/unix/puppet_module/cron_legacy/.gitignore diff --git a/modules/utilities/unix/puppet_module/cron/.msync.yml b/modules/utilities/unix/puppet_module/cron_legacy/.msync.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.msync.yml rename to modules/utilities/unix/puppet_module/cron_legacy/.msync.yml diff --git a/modules/utilities/unix/puppet_module/cron/.overcommit.yml b/modules/utilities/unix/puppet_module/cron_legacy/.overcommit.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.overcommit.yml rename to modules/utilities/unix/puppet_module/cron_legacy/.overcommit.yml diff --git a/modules/utilities/unix/puppet_module/cron/.pmtignore b/modules/utilities/unix/puppet_module/cron_legacy/.pmtignore similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.pmtignore rename to modules/utilities/unix/puppet_module/cron_legacy/.pmtignore diff --git a/modules/utilities/unix/puppet_module/cron/.rspec b/modules/utilities/unix/puppet_module/cron_legacy/.rspec similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.rspec rename to modules/utilities/unix/puppet_module/cron_legacy/.rspec diff --git a/modules/utilities/unix/puppet_module/cron/.rspec_parallel b/modules/utilities/unix/puppet_module/cron_legacy/.rspec_parallel similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.rspec_parallel rename to modules/utilities/unix/puppet_module/cron_legacy/.rspec_parallel diff --git a/modules/utilities/unix/puppet_module/cron/.rubocop.yml b/modules/utilities/unix/puppet_module/cron_legacy/.rubocop.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.rubocop.yml rename to modules/utilities/unix/puppet_module/cron_legacy/.rubocop.yml diff --git a/modules/utilities/unix/puppet_module/cron/.sync.yml b/modules/utilities/unix/puppet_module/cron_legacy/.sync.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.sync.yml rename to modules/utilities/unix/puppet_module/cron_legacy/.sync.yml diff --git a/modules/utilities/unix/puppet_module/cron/.travis.yml b/modules/utilities/unix/puppet_module/cron_legacy/.travis.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.travis.yml rename to modules/utilities/unix/puppet_module/cron_legacy/.travis.yml diff --git a/modules/utilities/unix/puppet_module/cron/.yardopts b/modules/utilities/unix/puppet_module/cron_legacy/.yardopts similarity index 100% rename from modules/utilities/unix/puppet_module/cron/.yardopts rename to modules/utilities/unix/puppet_module/cron_legacy/.yardopts diff --git a/modules/utilities/unix/puppet_module/cron/CHANGELOG.md b/modules/utilities/unix/puppet_module/cron_legacy/CHANGELOG.md similarity index 100% rename from modules/utilities/unix/puppet_module/cron/CHANGELOG.md rename to modules/utilities/unix/puppet_module/cron_legacy/CHANGELOG.md diff --git a/modules/utilities/unix/puppet_module/cron/Gemfile b/modules/utilities/unix/puppet_module/cron_legacy/Gemfile similarity index 100% rename from modules/utilities/unix/puppet_module/cron/Gemfile rename to modules/utilities/unix/puppet_module/cron_legacy/Gemfile diff --git a/modules/utilities/unix/puppet_module/cron/HISTORY.md b/modules/utilities/unix/puppet_module/cron_legacy/HISTORY.md similarity index 100% rename from modules/utilities/unix/puppet_module/cron/HISTORY.md rename to modules/utilities/unix/puppet_module/cron_legacy/HISTORY.md diff --git a/modules/utilities/unix/puppet_module/cron/LICENSE b/modules/utilities/unix/puppet_module/cron_legacy/LICENSE similarity index 100% rename from modules/utilities/unix/puppet_module/cron/LICENSE rename to modules/utilities/unix/puppet_module/cron_legacy/LICENSE diff --git a/modules/utilities/unix/puppet_module/cron/README.md b/modules/utilities/unix/puppet_module/cron_legacy/README.md similarity index 100% rename from modules/utilities/unix/puppet_module/cron/README.md rename to modules/utilities/unix/puppet_module/cron_legacy/README.md diff --git a/modules/utilities/unix/puppet_module/cron/Rakefile b/modules/utilities/unix/puppet_module/cron_legacy/Rakefile similarity index 100% rename from modules/utilities/unix/puppet_module/cron/Rakefile rename to modules/utilities/unix/puppet_module/cron_legacy/Rakefile diff --git a/modules/utilities/unix/puppet_module/cron/cron.pp b/modules/utilities/unix/puppet_module/cron_legacy/cron_legacy.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/cron.pp rename to modules/utilities/unix/puppet_module/cron_legacy/cron_legacy.pp diff --git a/modules/utilities/unix/puppet_module/cron/data/common.yaml b/modules/utilities/unix/puppet_module/cron_legacy/data/common.yaml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/data/common.yaml rename to modules/utilities/unix/puppet_module/cron_legacy/data/common.yaml diff --git a/modules/utilities/unix/puppet_module/cron/data/os/Gentoo.yaml b/modules/utilities/unix/puppet_module/cron_legacy/data/os/Gentoo.yaml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/data/os/Gentoo.yaml rename to modules/utilities/unix/puppet_module/cron_legacy/data/os/Gentoo.yaml diff --git a/modules/utilities/unix/puppet_module/cron/data/os/RedHat.yaml b/modules/utilities/unix/puppet_module/cron_legacy/data/os/RedHat.yaml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/data/os/RedHat.yaml rename to modules/utilities/unix/puppet_module/cron_legacy/data/os/RedHat.yaml diff --git a/modules/utilities/unix/puppet_module/cron/data/os/RedHat/5.yaml b/modules/utilities/unix/puppet_module/cron_legacy/data/os/RedHat/5.yaml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/data/os/RedHat/5.yaml rename to modules/utilities/unix/puppet_module/cron_legacy/data/os/RedHat/5.yaml diff --git a/modules/utilities/unix/puppet_module/cron/hiera.yaml b/modules/utilities/unix/puppet_module/cron_legacy/hiera.yaml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/hiera.yaml rename to modules/utilities/unix/puppet_module/cron_legacy/hiera.yaml diff --git a/modules/utilities/unix/puppet_module/cron/manifests/.gitkeep b/modules/utilities/unix/puppet_module/cron_legacy/manifests/.gitkeep similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/.gitkeep rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/.gitkeep diff --git a/modules/utilities/unix/puppet_module/cron/manifests/daily.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/daily.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/daily.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/daily.pp diff --git a/modules/utilities/unix/puppet_module/cron/manifests/hourly.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/hourly.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/hourly.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/hourly.pp diff --git a/modules/utilities/unix/puppet_module/cron/manifests/init.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/init.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/init.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/init.pp diff --git a/modules/utilities/unix/puppet_module/cron/manifests/install.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/install.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/install.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/install.pp diff --git a/modules/utilities/unix/puppet_module/cron/manifests/job.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/job.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/job.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/job.pp diff --git a/modules/utilities/unix/puppet_module/cron/manifests/job/multiple.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/job/multiple.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/job/multiple.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/job/multiple.pp diff --git a/modules/utilities/unix/puppet_module/cron/manifests/monthly.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/monthly.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/monthly.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/monthly.pp diff --git a/modules/utilities/unix/puppet_module/cron/manifests/service.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/service.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/service.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/service.pp diff --git a/modules/utilities/unix/puppet_module/cron/manifests/weekly.pp b/modules/utilities/unix/puppet_module/cron_legacy/manifests/weekly.pp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/manifests/weekly.pp rename to modules/utilities/unix/puppet_module/cron_legacy/manifests/weekly.pp diff --git a/modules/utilities/unix/puppet_module/cron/metadata.json b/modules/utilities/unix/puppet_module/cron_legacy/metadata.json similarity index 100% rename from modules/utilities/unix/puppet_module/cron/metadata.json rename to modules/utilities/unix/puppet_module/cron_legacy/metadata.json diff --git a/modules/utilities/unix/puppet_module/cron/secgen_metadata.xml b/modules/utilities/unix/puppet_module/cron_legacy/secgen_metadata.xml similarity index 72% rename from modules/utilities/unix/puppet_module/cron/secgen_metadata.xml rename to modules/utilities/unix/puppet_module/cron_legacy/secgen_metadata.xml index a38523f25..2b05e37fb 100644 --- a/modules/utilities/unix/puppet_module/cron/secgen_metadata.xml +++ b/modules/utilities/unix/puppet_module/cron_legacy/secgen_metadata.xml @@ -11,4 +11,9 @@ puppet_module linux + + + .*bases/(?!debian_(stretch|buster|wheezy)).*$ + + diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/archlinux-2-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/archlinux-2-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/archlinux-2-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/archlinux-2-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/centos-511-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/centos-511-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/centos-511-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/centos-511-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/centos-6-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/centos-6-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/centos-6-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/centos-6-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/centos-66-x64-pe.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/centos-66-x64-pe.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/centos-66-x64-pe.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/centos-66-x64-pe.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/centos-7-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/centos-7-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/centos-7-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/centos-7-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/debian-78-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/debian-78-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/debian-78-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/debian-78-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/debian-82-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/debian-82-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/debian-82-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/debian-82-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/centos-5.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/centos-5.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/centos-5.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/centos-5.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/centos-6.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/centos-6.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/centos-6.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/centos-6.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/centos-7.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/centos-7.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/centos-7.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/centos-7.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/debian-7.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/debian-7.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/debian-7.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/debian-7.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/debian-8.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/debian-8.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/debian-8.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/debian-8.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/debian-9.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/debian-9.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/debian-9.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/debian-9.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/ubuntu-12.04.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/ubuntu-12.04.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/ubuntu-12.04.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/ubuntu-12.04.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/ubuntu-14.04.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/ubuntu-14.04.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/ubuntu-14.04.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/ubuntu-14.04.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/ubuntu-16.04.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/ubuntu-16.04.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/docker/ubuntu-16.04.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/docker/ubuntu-16.04.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/image_templates.yaml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/image_templates.yaml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/image_templates.yaml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/image_templates.yaml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/rhel-73-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/rhel-73-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/rhel-73-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/rhel-73-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/fedora-25-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/fedora-25-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/fedora-25-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/fedora-25-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/classes/coverage_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/classes/coverage_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/classes/coverage_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/classes/coverage_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/classes/cron_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/classes/cron_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/classes/cron_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/classes/cron_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/classes/install_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/classes/install_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/classes/install_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/classes/install_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/classes/service_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/classes/service_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/classes/service_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/classes/service_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/default_facts.yml b/modules/utilities/unix/puppet_module/cron_legacy/spec/default_facts.yml similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/default_facts.yml rename to modules/utilities/unix/puppet_module/cron_legacy/spec/default_facts.yml diff --git a/modules/utilities/unix/puppet_module/cron/spec/defines/daily_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/defines/daily_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/defines/daily_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/defines/daily_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/defines/hourly_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/defines/hourly_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/defines/hourly_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/defines/hourly_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/defines/job_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/defines/job_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/defines/job_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/defines/job_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/defines/monthly_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/defines/monthly_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/defines/monthly_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/defines/monthly_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/defines/multiple_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/defines/multiple_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/defines/multiple_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/defines/multiple_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/defines/weekly_spec.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/defines/weekly_spec.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/defines/weekly_spec.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/defines/weekly_spec.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/hosts/.gitkeep b/modules/utilities/unix/puppet_module/cron_legacy/spec/hosts/.gitkeep similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/hosts/.gitkeep rename to modules/utilities/unix/puppet_module/cron_legacy/spec/hosts/.gitkeep diff --git a/modules/utilities/unix/puppet_module/cron/spec/spec_helper.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/spec_helper.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/spec_helper.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/spec_helper.rb diff --git a/modules/utilities/unix/puppet_module/cron/spec/spec_helper_methods.rb b/modules/utilities/unix/puppet_module/cron_legacy/spec/spec_helper_methods.rb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/spec/spec_helper_methods.rb rename to modules/utilities/unix/puppet_module/cron_legacy/spec/spec_helper_methods.rb diff --git a/modules/utilities/unix/puppet_module/cron/templates/.gitkeep b/modules/utilities/unix/puppet_module/cron_legacy/templates/.gitkeep similarity index 100% rename from modules/utilities/unix/puppet_module/cron/templates/.gitkeep rename to modules/utilities/unix/puppet_module/cron_legacy/templates/.gitkeep diff --git a/modules/utilities/unix/puppet_module/cron/templates/job.erb b/modules/utilities/unix/puppet_module/cron_legacy/templates/job.erb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/templates/job.erb rename to modules/utilities/unix/puppet_module/cron_legacy/templates/job.erb diff --git a/modules/utilities/unix/puppet_module/cron/templates/multiple.erb b/modules/utilities/unix/puppet_module/cron_legacy/templates/multiple.erb similarity index 100% rename from modules/utilities/unix/puppet_module/cron/templates/multiple.erb rename to modules/utilities/unix/puppet_module/cron_legacy/templates/multiple.erb diff --git a/modules/utilities/unix/puppet_module/cron/templates/users.epp b/modules/utilities/unix/puppet_module/cron_legacy/templates/users.epp similarity index 100% rename from modules/utilities/unix/puppet_module/cron/templates/users.epp rename to modules/utilities/unix/puppet_module/cron_legacy/templates/users.epp diff --git a/modules/utilities/unix/puppet_module/cron_new/.rubocop.yml b/modules/utilities/unix/puppet_module/cron_new/.rubocop.yml new file mode 100644 index 000000000..7ca378611 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/.rubocop.yml @@ -0,0 +1,727 @@ +--- +require: +- rubocop-performance +- rubocop-rspec +AllCops: + DisplayCopNames: true + TargetRubyVersion: '2.6' + Include: + - "**/*.rb" + Exclude: + - bin/* + - ".vendor/**/*" + - "**/Gemfile" + - "**/Rakefile" + - pkg/**/* + - spec/fixtures/**/* + - vendor/**/* + - "**/Puppetfile" + - "**/Vagrantfile" + - "**/Guardfile" +Layout/LineLength: + Description: People have wide screens, use them. + Max: 260 +RSpec/BeforeAfterAll: + Description: Beware of using after(:all) as it may cause state to leak between tests. + A necessary evil in acceptance testing. + Exclude: + - spec/acceptance/**/*.rb +RSpec/HookArgument: + Description: Prefer explicit :each argument, matching existing module's style + EnforcedStyle: each +RSpec/DescribeSymbol: + Exclude: + - spec/unit/facter/**/*.rb +Style/BlockDelimiters: + Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to + be consistent then. + EnforcedStyle: braces_for_chaining +Style/ClassAndModuleChildren: + Description: Compact style reduces the required amount of indentation. + EnforcedStyle: compact +Style/EmptyElse: + Description: Enforce against empty else clauses, but allow `nil` for clarity. + EnforcedStyle: empty +Style/FormatString: + Description: Following the main puppet project's style, prefer the % format format. + EnforcedStyle: percent +Style/FormatStringToken: + Description: Following the main puppet project's style, prefer the simpler template + tokens over annotated ones. + EnforcedStyle: template +Style/Lambda: + Description: Prefer the keyword for easier discoverability. + EnforcedStyle: literal +Style/RegexpLiteral: + Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 + EnforcedStyle: percent_r +Style/TernaryParentheses: + Description: Checks for use of parentheses around ternary conditions. Enforce parentheses + on complex expressions for better readability, but seriously consider breaking + it up. + EnforcedStyle: require_parentheses_when_complex +Style/TrailingCommaInArguments: + Description: Prefer always trailing comma on multiline argument lists. This makes + diffs, and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/TrailingCommaInArrayLiteral: + Description: Prefer always trailing comma on multiline literals. This makes diffs, + and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/SymbolArray: + Description: Using percent style obscures symbolic intent of array's contents. + EnforcedStyle: brackets +RSpec/NamedSubject: + Enabled: false +RSpec/SubjectStub: + Enabled: false +RSpec/MessageSpies: + EnforcedStyle: receive +Style/Documentation: + Exclude: + - lib/puppet/parser/functions/**/* + - spec/**/* +Style/WordArray: + EnforcedStyle: brackets +Performance/AncestorsInclude: + Enabled: true +Performance/BigDecimalWithNumericArgument: + Enabled: true +Performance/BlockGivenWithExplicitBlock: + Enabled: true +Performance/CaseWhenSplat: + Enabled: true +Performance/ConstantRegexp: + Enabled: true +Performance/MethodObjectAsBlock: + Enabled: true +Performance/RedundantSortBlock: + Enabled: true +Performance/RedundantStringChars: + Enabled: true +Performance/ReverseFirst: + Enabled: true +Performance/SortReverse: + Enabled: true +Performance/Squeeze: + Enabled: true +Performance/StringInclude: + Enabled: true +Performance/Sum: + Enabled: true +Style/CollectionMethods: + Enabled: true +Style/MethodCalledOnDoEndBlock: + Enabled: true +Style/StringMethods: + Enabled: true +Bundler/GemFilename: + Enabled: false +Bundler/InsecureProtocolSource: + Enabled: false +Capybara/CurrentPathExpectation: + Enabled: false +Capybara/VisibilityMatcher: + Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: + Enabled: false +Gemspec/RequiredRubyVersion: + Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +Layout/BeginEndAlignment: + Enabled: false +Layout/ClosingHeredocIndentation: + Enabled: false +Layout/EmptyComment: + Enabled: false +Layout/EmptyLineAfterGuardClause: + Enabled: false +Layout/EmptyLinesAroundArguments: + Enabled: false +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false +Layout/EndOfLine: + Enabled: false +Layout/FirstArgumentIndentation: + Enabled: false +Layout/HashAlignment: + Enabled: false +Layout/HeredocIndentation: + Enabled: false +Layout/LeadingEmptyLines: + Enabled: false +Layout/SpaceAroundMethodCallOperator: + Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false +Layout/SpaceInsideReferenceBrackets: + Enabled: false +Lint/BigDecimalNew: + Enabled: false +Lint/BooleanSymbol: + Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false +Lint/DuplicateElsifCondition: + Enabled: false +Lint/DuplicateRequire: + Enabled: false +Lint/DuplicateRescueException: + Enabled: false +Lint/EmptyConditionalBody: + Enabled: false +Lint/EmptyFile: + Enabled: false +Lint/ErbNewArguments: + Enabled: false +Lint/FloatComparison: + Enabled: false +Lint/HashCompareByIdentity: + Enabled: false +Lint/IdentityComparison: + Enabled: false +Lint/InterpolationCheck: + Enabled: false +Lint/MissingCopEnableDirective: + Enabled: false +Lint/MixedRegexpCaptureTypes: + Enabled: false +Lint/NestedPercentLiteral: + Enabled: false +Lint/NonDeterministicRequireOrder: + Enabled: false +Lint/OrderedMagicComments: + Enabled: false +Lint/OutOfRangeRegexpRef: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/RedundantCopEnableDirective: + Enabled: false +Lint/RedundantRequireStatement: + Enabled: false +Lint/RedundantSafeNavigation: + Enabled: false +Lint/RedundantWithIndex: + Enabled: false +Lint/RedundantWithObject: + Enabled: false +Lint/RegexpAsCondition: + Enabled: false +Lint/ReturnInVoidContext: + Enabled: false +Lint/SafeNavigationConsistency: + Enabled: false +Lint/SafeNavigationWithEmpty: + Enabled: false +Lint/SelfAssignment: + Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/ShadowedArgument: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Lint/ToJSON: + Enabled: false +Lint/TopLevelReturnWithArgument: + Enabled: false +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false +Lint/UnreachableLoop: + Enabled: false +Lint/UriEscapeUnescape: + Enabled: false +Lint/UriRegexp: + Enabled: false +Lint/UselessMethodDefinition: + Enabled: false +Lint/UselessTimes: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/BlockNesting: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/ParameterLists: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Migration/DepartmentName: + Enabled: false +Naming/AccessorMethodName: + Enabled: false +Naming/BlockParameterName: + Enabled: false +Naming/HeredocDelimiterCase: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Naming/MemoizedInstanceVariableName: + Enabled: false +Naming/MethodParameterName: + Enabled: false +Naming/RescuedExceptionsVariableName: + Enabled: false +Naming/VariableNumber: + Enabled: false +Performance/BindCall: + Enabled: false +Performance/DeletePrefix: + Enabled: false +Performance/DeleteSuffix: + Enabled: false +Performance/InefficientHashSearch: + Enabled: false +Performance/UnfreezeString: + Enabled: false +Performance/UriDefaultParser: + Enabled: false +RSpec/Be: + Enabled: false +RSpec/Capybara/FeatureMethods: + Enabled: false +RSpec/ContainExactly: + Enabled: false +RSpec/ContextMethod: + Enabled: false +RSpec/ContextWording: + Enabled: false +RSpec/DescribeClass: + Enabled: false +RSpec/EmptyHook: + Enabled: false +RSpec/EmptyLineAfterExample: + Enabled: false +RSpec/EmptyLineAfterExampleGroup: + Enabled: false +RSpec/EmptyLineAfterHook: + Enabled: false +RSpec/ExampleLength: + Enabled: false +RSpec/ExampleWithoutDescription: + Enabled: false +RSpec/ExpectChange: + Enabled: false +RSpec/ExpectInHook: + Enabled: false +RSpec/FactoryBot/AttributeDefinedStatically: + Enabled: false +RSpec/FactoryBot/CreateList: + Enabled: false +RSpec/FactoryBot/FactoryClassName: + Enabled: false +RSpec/HooksBeforeExamples: + Enabled: false +RSpec/ImplicitBlockExpectation: + Enabled: false +RSpec/ImplicitSubject: + Enabled: false +RSpec/LeakyConstantDeclaration: + Enabled: false +RSpec/LetBeforeExamples: + Enabled: false +RSpec/MatchArray: + Enabled: false +RSpec/MissingExampleGroupArgument: + Enabled: false +RSpec/MultipleExpectations: + Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpec/MultipleSubjects: + Enabled: false +RSpec/NestedGroups: + Enabled: false +RSpec/PredicateMatcher: + Enabled: false +RSpec/ReceiveCounts: + Enabled: false +RSpec/ReceiveNever: + Enabled: false +RSpec/RepeatedExampleGroupBody: + Enabled: false +RSpec/RepeatedExampleGroupDescription: + Enabled: false +RSpec/RepeatedIncludeExample: + Enabled: false +RSpec/ReturnFromStub: + Enabled: false +RSpec/SharedExamples: + Enabled: false +RSpec/StubbedMock: + Enabled: false +RSpec/UnspecifiedException: + Enabled: false +RSpec/VariableDefinition: + Enabled: false +RSpec/VoidExpect: + Enabled: false +RSpec/Yield: + Enabled: false +Security/Open: + Enabled: false +Style/AccessModifierDeclarations: + Enabled: false +Style/AccessorGrouping: + Enabled: false +Style/BisectedAttrAccessor: + Enabled: false +Style/CaseLikeIf: + Enabled: false +Style/ClassEqualityComparison: + Enabled: false +Style/ColonMethodDefinition: + Enabled: false +Style/CombinableLoops: + Enabled: false +Style/CommentedKeyword: + Enabled: false +Style/Dir: + Enabled: false +Style/DoubleCopDisableDirective: + Enabled: false +Style/EmptyBlockParameter: + Enabled: false +Style/EmptyLambdaParameter: + Enabled: false +Style/Encoding: + Enabled: false +Style/EvalWithLocation: + Enabled: false +Style/ExpandPathArguments: + Enabled: false +Style/ExplicitBlockArgument: + Enabled: false +Style/ExponentialNotation: + Enabled: false +Style/FloatDivision: + Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false +Style/GlobalStdStream: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Style/HashLikeCase: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Style/KeywordParametersOrder: + Enabled: false +Style/MinMax: + Enabled: false +Style/MixinUsage: + Enabled: false +Style/MultilineWhenThen: + Enabled: false +Style/NegatedUnless: + Enabled: false +Style/NumericPredicate: + Enabled: false +Style/OptionalBooleanParameter: + Enabled: false +Style/OrAssignment: + Enabled: false +Style/RandomWithOffset: + Enabled: false +Style/RedundantAssignment: + Enabled: false +Style/RedundantCondition: + Enabled: false +Style/RedundantConditional: + Enabled: false +Style/RedundantFetchBlock: + Enabled: false +Style/RedundantFileExtensionInRequire: + Enabled: false +Style/RedundantRegexpCharacterClass: + Enabled: false +Style/RedundantRegexpEscape: + Enabled: false +Style/RedundantSelfAssignment: + Enabled: false +Style/RedundantSort: + Enabled: false +Style/RescueStandardError: + Enabled: false +Style/SingleArgumentDig: + Enabled: false +Style/SlicingWithRange: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/StderrPuts: + Enabled: false +Style/StringConcatenation: + Enabled: false +Style/Strip: + Enabled: false +Style/SymbolProc: + Enabled: false +Style/TrailingBodyOnClass: + Enabled: false +Style/TrailingBodyOnMethodDefinition: + Enabled: false +Style/TrailingBodyOnModule: + Enabled: false +Style/TrailingCommaInHashLiteral: + Enabled: false +Style/TrailingMethodEndStatement: + Enabled: false +Style/UnpackFirst: + Enabled: false +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateMagicComment: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/TripleQuotes: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/ArrayIntersect: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DirEmpty: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NestedFileDirname: + Enabled: false +Style/NilLambda: + Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false +Style/SwapValues: + Enabled: false diff --git a/modules/utilities/unix/puppet_module/cron_new/CHANGELOG.md b/modules/utilities/unix/puppet_module/cron_new/CHANGELOG.md new file mode 100644 index 000000000..66e362436 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/CHANGELOG.md @@ -0,0 +1,92 @@ + +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). + +## [v1.3.0](https://github.com/puppetlabs/puppetlabs-cron_core/tree/v1.3.0) - 2024-03-06 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/v1.2.1...v1.3.0) + +### Added + +- (PA-5575) Add Amazon to display support in Puppet forge [#67](https://github.com/puppetlabs/puppetlabs-cron_core/pull/67) ([shubhamshinde360](https://github.com/shubhamshinde360)) + +## [v1.2.1](https://github.com/puppetlabs/puppetlabs-cron_core/tree/v1.2.1) - 2023-11-27 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/v1.2.0...v1.2.1) + +### Fixed + +- Convert ProcessOutput to String explicitly [#62](https://github.com/puppetlabs/puppetlabs-cron_core/pull/62) ([joshcooper](https://github.com/joshcooper)) + +## [v1.2.0](https://github.com/puppetlabs/puppetlabs-cron_core/tree/v1.2.0) - 2023-02-14 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/v1.1.0...v1.2.0) + +### Added + +- (MODULES-11371) Updates PDK template [#55](https://github.com/puppetlabs/puppetlabs-cron_core/pull/55) ([mhashizume](https://github.com/mhashizume)) + +## [v1.1.0](https://github.com/puppetlabs/puppetlabs-cron_core/tree/v1.1.0) - 2021-10-04 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/1.0.5...v1.1.0) + +### Added + +- (MODULES-11167)(MODULES-11191) Add RockyLinux && AlmaLinux to cron-core metadata [#45](https://github.com/puppetlabs/puppetlabs-cron_core/pull/45) ([BobosilaVictor](https://github.com/BobosilaVictor)) + +## [1.0.5](https://github.com/puppetlabs/puppetlabs-cron_core/tree/1.0.5) - 2020-10-30 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/1.0.4...1.0.5) + +### Fixed + +- (MODULES-10852) Fix warnings introduced by Ruby 2.7 [#39](https://github.com/puppetlabs/puppetlabs-cron_core/pull/39) ([luchihoratiu](https://github.com/luchihoratiu)) +- (MODULES-7786) Allow leading zeroes for cron params [#35](https://github.com/puppetlabs/puppetlabs-cron_core/pull/35) ([Dorin-Pleava](https://github.com/Dorin-Pleava)) + +## [1.0.4](https://github.com/puppetlabs/puppetlabs-cron_core/tree/1.0.4) - 2020-05-06 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/1.0.3...1.0.4) + +### Added + +- (maint) bump to beaker 4 [#29](https://github.com/puppetlabs/puppetlabs-cron_core/pull/29) ([ciprianbadescu](https://github.com/ciprianbadescu)) +- (MODULES-8603) Ignore .keep_* files [#12](https://github.com/puppetlabs/puppetlabs-cron_core/pull/12) ([ekohl](https://github.com/ekohl)) + +## [1.0.3](https://github.com/puppetlabs/puppetlabs-cron_core/tree/1.0.3) - 2019-11-01 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/1.0.2...1.0.3) + +### Added + +- pdksync - (maint) Update module using PDK 1.14.0 [#27](https://github.com/puppetlabs/puppetlabs-cron_core/pull/27) ([mihaibuzgau](https://github.com/mihaibuzgau)) + +## [1.0.2](https://github.com/puppetlabs/puppetlabs-cron_core/tree/1.0.2) - 2019-08-01 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/1.0.1...1.0.2) + +### Fixed + +- (PUP-9697) Updated crontab read path for Solaris [#23](https://github.com/puppetlabs/puppetlabs-cron_core/pull/23) ([sebastian-miclea](https://github.com/sebastian-miclea)) + +## [1.0.1](https://github.com/puppetlabs/puppetlabs-cron_core/tree/1.0.1) - 2019-02-12 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/1.0.0...1.0.1) + +### Added + +- (MODULES-7789) Port over the PUP-9217 changes [#13](https://github.com/puppetlabs/puppetlabs-cron_core/pull/13) ([ekinanp](https://github.com/ekinanp)) +- (MODULES-8306) Port over the crontab filetypes from Puppet [#11](https://github.com/puppetlabs/puppetlabs-cron_core/pull/11) ([ekinanp](https://github.com/ekinanp)) +- Add anchors for l10n [#10](https://github.com/puppetlabs/puppetlabs-cron_core/pull/10) ([joshcooper](https://github.com/joshcooper)) +- (MODULES-8301) Update the unit tests with the crontab filetype fix [#7](https://github.com/puppetlabs/puppetlabs-cron_core/pull/7) ([ekinanp](https://github.com/ekinanp)) +- Expand test coverage [#6](https://github.com/puppetlabs/puppetlabs-cron_core/pull/6) ([joshcooper](https://github.com/joshcooper)) + +### Fixed + +- (L10n) Updating translations for readmes/README_ja_JP.md [#14](https://github.com/puppetlabs/puppetlabs-cron_core/pull/14) ([ehom](https://github.com/ehom)) + +## [1.0.0](https://github.com/puppetlabs/puppetlabs-cron_core/tree/1.0.0) - 2018-08-30 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-cron_core/compare/2142feac49c20972e39ed0e11a017fbbf15cc51f...1.0.0) diff --git a/modules/utilities/unix/puppet_module/cron_new/CODEOWNERS b/modules/utilities/unix/puppet_module/cron_new/CODEOWNERS new file mode 100644 index 000000000..03deaa383 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/CODEOWNERS @@ -0,0 +1 @@ +* @puppetlabs/phoenix diff --git a/modules/utilities/unix/puppet_module/cron_new/LICENSE b/modules/utilities/unix/puppet_module/cron_new/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/utilities/unix/puppet_module/cron_new/README.md b/modules/utilities/unix/puppet_module/cron_new/README.md new file mode 100644 index 000000000..95af7c65a --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/README.md @@ -0,0 +1,52 @@ + +# cron_core + +[![Modules Status](https://github.com/puppetlabs/puppetlabs-cron_core/workflows/%5BDaily%5D%20Unit%20Tests%20with%20nightly%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-cron_core/actions) +[![Modules Status](https://github.com/puppetlabs/puppetlabs-cron_core/workflows/Static%20Code%20Analysis/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-cron_core/actions) +[![Modules Status](https://github.com/puppetlabs/puppetlabs-cron_core/workflows/Unit%20Tests%20with%20nightly%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-cron_core/actions) +[![Modules Status](https://github.com/puppetlabs/puppetlabs-cron_core/workflows/Unit%20Tests%20with%20released%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-cron_core/actions) + + +#### Table of Contents + +1. [Description](#description) +2. [Reference](#reference) +3. [Limitations - OS compatibility, etc.](#limitations) +4. [Development - Guide for contributing to the module](#development) + + +## Description + +Install and manage `cron` resources. + + +## Reference + +Please see REFERENCE.md for the reference documentation. + +This module is documented using Puppet Strings. + +For a quick primer on how Strings works, please see [this blog post](https://puppet.com/blog/using-puppet-strings-generate-great-documentation-puppet-modules) or the [README.md](https://github.com/puppetlabs/puppet-strings/blob/master/README.md) for Puppet Strings. + +To generate documentation locally, run the following command: + +``` +bundle install +bundle exec puppet strings generate --format markdown --out REFERENCE.md +``` + +This command will create a browsable \_index.html file in the doc directory. The references available here are all generated from YARD-style comments embedded in the code base. When any development happens on this module, the impacted documentation should also be updated. + + +## Limitations + +`cron` is not compatible with Windows or Fedora 28. + + +## Development + +Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve. + +We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. + +For more information, see our [module contribution guide](https://puppet.com/docs/puppet/latest/contributing.html). diff --git a/modules/utilities/unix/puppet_module/cron_new/README_ja_JP.md b/modules/utilities/unix/puppet_module/cron_new/README_ja_JP.md new file mode 100644 index 000000000..5bba875a2 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/README_ja_JP.md @@ -0,0 +1,46 @@ + +# cron_core + +#### 目次 + +1. [説明](#description) +2. [リファレンス](#reference) +3. [制約 - OS互換性など](#limitations) +4. [開発 - モジュール貢献についてのガイド](#development) + + +## 説明 + +`cron`リソースをインストールして管理します。 + + +## リファレンス + +リファレンス文書については、REFERENCE.mdを参照してください。 + +このモジュールは、Puppet Stringsを用いて文書化されています。 + +Stringsの仕組みの簡単な概要については、Puppet Stringsに関する[こちらのブログ記事](https://puppet.com/blog/using-puppet-strings-generate-great-documentation-puppet-modules)または[README.md](https://github.com/puppetlabs/puppet-strings/blob/master/README.md)を参照してください。 + +文書をローカルで作成するには、以下のコマンドを実行します。 + +``` +bundle install +bundle exec puppet strings generate ./lib/**/*.rb +``` + +このコマンドにより、閲覧可能な \_index.htmlファイルがdocディレクトリに作成されます。ここで利用可能なリファレンスはすべて、コードベースに埋め込まれたYARD形式のコメントから生成されます。このモジュールに関して何らかの開発をする場合は、影響を受ける文書も更新する必要があります。 + + +## 制約 + +`cron`はWindowsまたはFedora 28には対応していません。 + + +## 開発 + +Puppet ForgeのPuppet Labsモジュールは、オープンプロジェクトです。プロジェクトをさらに発展させるには、コミュニティへの貢献が不可欠です。Puppetが役立つ可能性のある膨大な数のプラットフォーム、無数のハードウェア、ソフトウェア、デプロイメント構成に我々がアクセスすることはできません。 + +弊社は、できるだけ変更に貢献しやすくして、弊社のモジュールがユーザの環境で機能する状態を維持したいと考えています。弊社では、状況を把握できるよう、貢献者に従っていただくべきいくつかのガイドラインを設けています。 + +詳細については、[モジュール貢献ガイド](https://docs.puppetlabs.com/forge/contributing.html)を参照してください。 diff --git a/modules/utilities/unix/puppet_module/cron_new/REFERENCE.md b/modules/utilities/unix/puppet_module/cron_new/REFERENCE.md new file mode 100644 index 000000000..4c3f4463a --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/REFERENCE.md @@ -0,0 +1,200 @@ +# Reference + + + +## Table of Contents + +### Resource types + +* [`cron`](#cron): Installs and manages cron jobs. + +## Resource types + +### `cron` + +Every cron resource created by Puppet requires a command and at least one +periodic attribute (hour, minute, month, monthday, weekday, or special). While +the name of the cron job is not part of the actual job, the name is stored in a +comment beginning with `# Puppet Name: `. These comments are used to match +crontab entries created by Puppet with cron resources. + +If an existing crontab entry happens to match the scheduling and command of a +cron resource that has never been synced, Puppet defers to the existing +crontab entry and does not create a new entry tagged with the `# Puppet Name: ` +comment. + +**Important:** _The Cron type will not reset parameters that are +removed from a manifest_. For example, removing a `minute => 10` parameter +will not reset the minute component of the associated cronjob to `*`. +These changes must be expressed by setting the parameter to +`minute => absent` because Puppet only manages parameters that are out of +sync with manifest entries. + +**Autorequires:** If Puppet is managing the user account specified by the +`user` property of a cron resource, then the cron resource will autorequire +that user. + +#### Examples + +##### + +```puppet + +cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => 2, + minute => 0, +} +``` + +##### Note that all periodic attributes can be specified as an array of values: + +```puppet + +cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => [2, 4], +} +``` + +##### ...or using ranges or the step syntax `*/2` (although there's no guarantee that your `cron` daemon supports these): + +```puppet + +cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => ['2-4'], + minute => '*/10', +} +``` + +#### Properties + +The following properties are available in the `cron` type. + +##### `command` + +The command to execute in the cron job. The environment +provided to the command varies by local system rules, and it is +best to always provide a fully qualified command. The user's +profile is not sourced when the command is run, so if the +user's environment is desired it should be sourced manually. + +All cron parameters support `absent` as a value; this will +remove any existing values for that field. + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `environment` + +Any environment settings associated with this cron job. They +will be stored between the header and the job in the crontab. There +can be no guarantees that other, earlier settings will not also +affect a given cron job. + + +Also, Puppet cannot automatically determine whether an existing, +unmanaged environment setting is associated with a given cron +job. If you already have cron jobs with environment settings, +then Puppet will keep those settings in the same place in the file, +but will not associate them with a specific job. + +Settings should be specified exactly as they should appear in +the crontab, like `PATH=/bin:/usr/bin:/usr/sbin`. + +##### `hour` + +The hour at which to run the cron job. Optional; +if specified, must be between 0 and 23, inclusive. + +##### `minute` + +The minute at which to run the cron job. +Optional; if specified, must be between 0 and 59, inclusive. + +##### `month` + +The month of the year. Optional; if specified, +must be either: + +- A number between 1 and 12, inclusive, with 1 being January +- The name of the month, such as 'December'. + +##### `monthday` + +The day of the month on which to run the +command. Optional; if specified, must be between 1 and 31. + +##### `special` + +A special value such as 'reboot' or 'annually'. +Only available on supported systems such as Vixie Cron. +Overrides more specific time of day/week settings. +Set to 'absent' to make puppet revert to a plain numeric schedule. + +##### `target` + +The name of the crontab file in which the cron job should be stored. + +This property defaults to the value of the `user` property if set, the +user running Puppet or `root`. + +For the default crontab provider, this property is functionally +equivalent to the `user` property and should be avoided. In particular, +setting both `user` and `target` to different values will result in +undefined behavior. + +##### `user` + +The user who owns the cron job. This user must +be allowed to run cron jobs, which is not currently checked by +Puppet. + +This property defaults to the user running Puppet or `root`. + +The default crontab provider executes the system `crontab` using +the user account specified by this property. + +##### `weekday` + +The weekday on which to run the command. Optional; if specified, +must be either: + +- A number between 0 and 7, inclusive, with 0 or 7 being Sunday +- The name of the day, such as 'Tuesday'. + +Day ranges can only be numeric; e.g. '1-5' for weekdays, but not 'Mon-Fri'. + +#### Parameters + +The following parameters are available in the `cron` type. + +* [`name`](#-cron--name) +* [`provider`](#-cron--provider) + +##### `name` + +namevar + +The symbolic name of the cron job. This name +is used for human reference only and is generated automatically +for cron jobs found on the system. This generally won't +matter, as Puppet will do its best to match existing cron jobs +against specified jobs (and Puppet adds a comment to cron jobs it adds), +but it is at least possible that converting from unmanaged jobs to +managed jobs might require manual intervention. + +##### `provider` + +The specific backend to use for this `cron` resource. You will seldom need to specify this --- Puppet will usually +discover the appropriate provider for your platform. + diff --git a/modules/utilities/unix/puppet_module/cron_new/cron_new.pp b/modules/utilities/unix/puppet_module/cron_new/cron_new.pp new file mode 100644 index 000000000..e69de29bb diff --git a/modules/utilities/unix/puppet_module/cron_new/data/common.yaml b/modules/utilities/unix/puppet_module/cron_new/data/common.yaml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/data/common.yaml @@ -0,0 +1 @@ +--- diff --git a/modules/utilities/unix/puppet_module/cron_new/hiera.yaml b/modules/utilities/unix/puppet_module/cron_new/hiera.yaml new file mode 100644 index 000000000..2251c236a --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/hiera.yaml @@ -0,0 +1,21 @@ +--- +version: 5 + +defaults: # Used for any hierarchy level that omits these keys. + datadir: data # This path is relative to hiera.yaml's directory. + data_hash: yaml_data # Use the built-in YAML backend. + +hierarchy: + - name: "osfamily/major release" + paths: + - "os/%{facts.os.family}/%{facts.os.release.major}.yaml" + # Used for Solaris + - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml" + # Used to distinguish between Debian and Ubuntu + - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" + - name: "osfamily" + paths: + - "os/%{facts.os.family}.yaml" + - "os/%{facts.os.name}.yaml" + - name: 'common' + path: 'common.yaml' diff --git a/modules/utilities/unix/puppet_module/cron_new/lib/puppet/provider/cron/crontab.rb b/modules/utilities/unix/puppet_module/cron_new/lib/puppet/provider/cron/crontab.rb new file mode 100644 index 000000000..33cd2b446 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/lib/puppet/provider/cron/crontab.rb @@ -0,0 +1,310 @@ +require_relative 'filetype' +require 'puppet/provider/parsedfile' + +Puppet::Type.type(:cron).provide(:crontab, parent: Puppet::Provider::ParsedFile, default_target: ENV['USER'] || 'root', raise_prefetch_errors: true) do + desc 'The crontab provider' + + commands crontab: 'crontab' + + text_line :comment, match: %r{^\s*#}, post_parse: proc { |record| + record[:name] = Regexp.last_match(1) if record[:line] =~ %r{Puppet Name: (.+)\s*$} + } + + text_line :blank, match: %r{^\s*$} + + text_line :environment, match: %r{^\s*\w+\s*=} + + def self.filetype + tabname = case Facter.value('os.family') + when 'Solaris' + :suntab + when 'AIX' + :aixtab + else + :crontab + end + + Puppet::Provider::Cron::FileType.filetype(tabname) + end + + self::TIME_FIELDS = [:minute, :hour, :monthday, :month, :weekday].freeze + + record_line :crontab, + fields: ['time', 'command'], + match: %r{^\s*(@\w+|\S+\s+\S+\s+\S+\s+\S+\s+\S+)\s+(.+)$}, + absent: '*', + block_eval: :instance do + def post_parse(record) + time = record.delete(:time) + match = %r{@(\S+)}.match(time) + if match + # is there another way to access the constant? + Puppet::Type::Cron::ProviderCrontab::TIME_FIELDS.each { |f| record[f] = :absent } + record[:special] = match.captures[0] + return record + end + + match = %r{(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)}.match(time) + if match + record[:special] = :absent + Puppet::Type::Cron::ProviderCrontab::TIME_FIELDS.zip(match.captures).each do |field, value| + record[field] = if value == absent + :absent + else + value.split(',') + end + end + + return record + end + + raise Puppet::Error, _('Line got parsed as a crontab entry but cannot be handled. Please file a bug with the contents of your crontab') + end + + def pre_gen(record) + if record[:special] && record[:special] != :absent + record[:special] = "@#{record[:special]}" + end + + Puppet::Type::Cron::ProviderCrontab::TIME_FIELDS.each do |field| + if (vals = record[field]) && vals.is_a?(Array) + record[field] = vals.join(',') + end + end + record + end + + def to_line(record) + str = '' + record[:name] = nil if record[:unmanaged] + str = "# Puppet Name: #{record[:name]}\n" if record[:name] + if record[:environment] && record[:environment] != :absent + str += record[:environment].map { |line| "#{line}\n" }.join('') + end + fields = if record[:special] && record[:special] != :absent + [:special, :command] + else + Puppet::Type::Cron::ProviderCrontab::TIME_FIELDS + [:command] + end + str += record.values_at(*fields).map { |field| + if field.nil? || field == :absent + absent + else + field + end + }.join(joiner) + str + end + end + + def create + if resource.should(:command) + super + else + resource.err _('no command specified, cannot create') + end + end + + # Look up a resource with a given name whose user matches a record target + # + # @api private + # + # @note This overrides the ParsedFile method for finding resources by name, + # so that only records for a given user are matched to resources of the + # same user so that orphaned records in other crontabs don't get falsely + # matched (#2251) + # + # @param [Hash] record + # @param [Array] resources + # + # @return [Puppet::Resource, nil] The resource if found, else nil + def self.resource_for_record(record, resources) + resource = super + + target = resource[:target] || resource[:user] if resource + return resource if record[:target] == target + end + + # Return the header placed at the top of each generated file, warning + # users that modifying this file manually is probably a bad idea. + def self.header + %(# HEADER: This file was autogenerated at #{Time.now} by puppet. +# HEADER: While it can still be managed manually, it is definitely not recommended. +# HEADER: Note particularly that the comments starting with 'Puppet Name' should +# HEADER: not be deleted, as doing so could cause duplicate cron jobs.\n) + end + + # Regex for finding one vixie cron header. + def self.native_header_regex + %r{# DO NOT EDIT THIS FILE.*?Cron version.*?vixie.*?\n}m + end + + # If a vixie cron header is found, it should be dropped, cron will insert + # a new one in any case, so we need to avoid duplicates. + def self.drop_native_header + true + end + + # See if we can match the record against an existing cron job. + def self.match(record, resources) + # if the record is named, do not even bother (#19876) + # except the resource name was implicitly generated (#3220) + return false if record[:name] && !record[:unmanaged] + resources.each do |_name, resource| + # Match the command first, since it's the most important one. + next unless record[:target] == resource[:target] + next unless record[:command] == resource.value(:command) + + # Now check the time fields + compare_fields = self::TIME_FIELDS + [:special] + + matched = true + compare_fields.each do |field| + # If the resource does not manage a property (say monthday) it should + # always match. If it is the other way around (e.g. resource defines + # a should value for :special but the record does not have it, we do + # not match + next unless resource[field] + unless record.include?(field) + matched = false + break + end + + if (record_value = record[field]) && (resource_value = resource.value(field)) + # The record translates '*' into absent in the post_parse hook and + # the resource type does exactly the opposite (alias :absent to *) + next if resource_value == '*' && record_value == :absent + next if resource_value == record_value + end + matched = false + break + end + return resource if matched + end + false + end + + @name_index = 0 + + # Collapse name and env records. + def self.prefetch_hook(records) + name = nil + envs = nil + result = [] + records.each do |record| + case record[:record_type] + when :comment + if record[:name] + name = record[:name] + record[:skip] = true + + # Start collecting env values + envs = [] + end + when :environment + # If we're collecting env values (meaning we're in a named cronjob), + # store the line and skip the record. + if envs + envs << record[:line] + record[:skip] = true + end + when :blank + # nothing + else + if name + record[:name] = name + name = nil + else + cmd_string = record[:command].gsub(%r{\s+}, '_') + index = (@name_index += 1) + record[:name] = "unmanaged:#{cmd_string}-#{index}" + record[:unmanaged] = true + end + if envs.nil? || envs.empty? + record[:environment] = :absent + else + # Collect all of the environment lines, and mark the records to be skipped, + # since their data is included in our crontab record. + record[:environment] = envs + + # And turn off env collection again + envs = nil + end + end + result << record unless record[:skip] + end + result + end + + def self.to_file(records) + text = super + # Apparently Freebsd will "helpfully" add a new TZ line to every + # single cron line, but not in all cases (e.g., it doesn't do it + # on my machine). This is my attempt to fix it so the TZ lines don't + # multiply. + if text =~ %r{(^TZ=.+\n)} + tz = Regexp.last_match(1) + text.sub!(tz, '') + text = tz + text + end + text + end + + def user=(user) + # we have to mark the target as modified first, to make sure that if + # we move a cronjob from userA to userB, userA's crontab will also + # be rewritten + mark_target_modified + @property_hash[:user] = user + @property_hash[:target] = user + end + + def user + @property_hash[:user] || @property_hash[:target] + end + + CRONTAB_DIR = case Facter.value('os.family') + when 'Debian', 'HP-UX', 'Solaris' + '/var/spool/cron/crontabs' + when %r{BSD} + '/var/cron/tabs' + when 'Darwin' + '/usr/lib/cron/tabs/' + else + '/var/spool/cron' + end + + # Return the directory holding crontab files stored on the local system. + # + # @api private + def self.crontab_dir + CRONTAB_DIR + end + + # Yield the names of all crontab files stored on the local system. + # + # @note Ignores files that are not writable for the puppet process and hidden + # files that start with .keep + # + # @api private + def self.enumerate_crontabs + Puppet.debug "looking for crontabs in #{CRONTAB_DIR}" + return unless File.readable?(CRONTAB_DIR) + Dir.foreach(CRONTAB_DIR) do |file| + path = File.join(CRONTAB_DIR, file) + # Gentoo creates .keep_PACKAGE-SLOT files to make sure the directory is not + # removed + yield(file) if File.file?(path) && File.writable?(path) && !file.start_with?('.keep_') + end + end + + # Include all plausible crontab files on the system + # in the list of targets (#11383 / PUP-1381) + def self.targets(resources = nil) + targets = super(resources) + enumerate_crontabs do |target| + targets << target + end + targets.uniq + end +end diff --git a/modules/utilities/unix/puppet_module/cron_new/lib/puppet/provider/cron/filetype.rb b/modules/utilities/unix/puppet_module/cron_new/lib/puppet/provider/cron/filetype.rb new file mode 100644 index 000000000..5b2df7e10 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/lib/puppet/provider/cron/filetype.rb @@ -0,0 +1,209 @@ +require 'puppet/util/filetype' + +class Puppet::Provider::Cron # rubocop:disable Style/ClassAndModuleChildren + # This class defines the crontab filetypes + class FileType < Puppet::Util::FileType + class << self + define_method(:base_newfiletype, instance_method(:newfiletype)) + + # Puppet::Util::FileType.newfiletype will raise an exception if + # an already-defined filetype is re-defined. Unfortunately, there's + # a chance that this file could be loaded multiple times by Puppet's + # autoloader meaning that, without this wrapper, the crontab filetypes + # would be re-defined, causing Puppet to raise an exception. + def newfiletype(name, &block) + return if @filetypes&.key?(name) + + base_newfiletype(name, &block) + end + end + + # Handle Linux-style cron tabs. + # + # TODO: We can possibly eliminate the "-u " option in cmdbase + # by just running crontab under 's uid (like we do for suntab + # and aixtab). It may be worth investigating this alternative + # implementation in the future. This way, we can refactor all three of + # our cron file types into a common crontab file type. + newfiletype(:crontab) do + def initialize(user) + self.path = user + end + + def path=(user) + begin + @uid = Puppet::Util.uid(user) + rescue Puppet::Error => detail + raise FileReadError, _('Could not retrieve user %{user}: %{detail}') % { user: user, detail: detail }, detail.backtrace + end + + # XXX We have to have the user name, not the uid, because some + # systems *cough*linux*cough* require it that way + @path = user + end + + # Read a specific @path's cron tab. + def read + unless Puppet::Util.uid(@path) + Puppet.debug _('The %{path} user does not exist. Treating their crontab file as empty in case Puppet creates them in the middle of the run.') % { path: @path } + + return '' + end + + Puppet::Util::Execution.execute("#{cmdbase} -l", failonfail: true, combine: true).to_s + rescue => detail + case detail.to_s + when %r{no crontab for} + '' + when %r{are not allowed to} + Puppet.debug _('The %{path} user is not authorized to use cron. Their crontab file is treated as empty in case Puppet authorizes them in the middle of the run (by, for example, modifying the cron.deny or cron.allow files).') % { path: @path } + + '' + else + raise FileReadError, _('Could not read crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace + end + end + + # Remove a specific @path's cron tab. + def remove + cmd = "#{cmdbase} -r" + if ['Darwin', 'FreeBSD', 'DragonFly'].include?(Facter.value('os.name')) + cmd = "/bin/echo yes | #{cmd}" + end + + Puppet::Util::Execution.execute(cmd, failonfail: true, combine: true).to_s + end + + # Overwrite a specific @path's cron tab; must be passed the @path name + # and the text with which to create the cron tab. + # + # TODO: We should refactor this at some point to make it identical to the + # :aixtab and :suntab's write methods so that, at the very least, the pipe + # is not created and the crontab command's errors are not swallowed. + def write(text) + unless Puppet::Util.uid(@path) + raise Puppet::Error, _("Cannot write the %{path} user's crontab: The user does not exist") % { path: @path } + end + + # this file is managed by the OS and should be using system encoding + IO.popen("#{cmdbase} -", 'w', encoding: Encoding.default_external) do |p| + p.print text + end + end + + private + + # Only add the -u flag when the @path is different. Fedora apparently + # does not think I should be allowed to set the @path to my own user name + def cmdbase + return 'crontab' if @uid == Puppet::Util::SUIDManager.uid || Facter.value('os.name') == 'HP-UX' + + "crontab -u #{@path}" + end + end + + # SunOS has completely different cron commands; this class implements + # its versions. + newfiletype(:suntab) do + # Read a specific @path's cron tab. + def read + unless Puppet::Util.uid(@path) + Puppet.debug _('The %{path} user does not exist. Treating their crontab file as empty in case Puppet creates them in the middle of the run.') % { path: @path } + + return '' + end + + Puppet::Util::Execution.execute(['crontab', '-l'], cronargs).to_s + rescue => detail + case detail.to_s + when %r{can't open your crontab} + '' + when %r{you are not authorized to use cron} + Puppet.debug _('The %{path} user is not authorized to use cron. Their crontab file is treated as empty in case Puppet authorizes them in the middle of the run (by, for example, modifying the cron.deny or cron.allow files).') % { path: @path } + + '' + else + raise FileReadError, _('Could not read crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace + end + end + + # Remove a specific @path's cron tab. + def remove + Puppet::Util::Execution.execute(['crontab', '-r'], cronargs).to_s + rescue => detail + raise FileReadError, _('Could not remove crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace + end + + # Overwrite a specific @path's cron tab; must be passed the @path name + # and the text with which to create the cron tab. + def write(text) + # this file is managed by the OS and should be using system encoding + output_file = Tempfile.new('puppet_suntab', encoding: Encoding.default_external) + begin + output_file.print text + output_file.close + # We have to chown the stupid file to the user. + File.chown(Puppet::Util.uid(@path), nil, output_file.path) + Puppet::Util::Execution.execute(['crontab', output_file.path], cronargs).to_s + rescue => detail + raise FileReadError, _('Could not write crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace + ensure + output_file.close + output_file.unlink + end + end + end + + # Support for AIX crontab with output different than suntab's crontab command. + newfiletype(:aixtab) do + # Read a specific @path's cron tab. + def read + unless Puppet::Util.uid(@path) + Puppet.debug _('The %{path} user does not exist. Treating their crontab file as empty in case Puppet creates them in the middle of the run.') % { path: @path } + + return '' + end + + Puppet::Util::Execution.execute(['crontab', '-l'], cronargs).to_s + rescue => detail + case detail.to_s + when %r{open.*in.*directory} + '' + when %r{not.*authorized.*cron} + Puppet.debug _('The %{path} user is not authorized to use cron. Their crontab file is treated as empty in case Puppet authorizes them in the middle of the run (by, for example, modifying the cron.deny or cron.allow files).') % { path: @path } + + '' + else + raise FileReadError, _('Could not read crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace + end + end + + # Remove a specific @path's cron tab. + def remove + Puppet::Util::Execution.execute(['crontab', '-r'], cronargs).to_s + rescue => detail + raise FileReadError, _('Could not remove crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace + end + + # Overwrite a specific @path's cron tab; must be passed the @path name + # and the text with which to create the cron tab. + def write(text) + # this file is managed by the OS and should be using system encoding + output_file = Tempfile.new('puppet_aixtab', encoding: Encoding.default_external) + + begin + output_file.print text + output_file.close + # We have to chown the stupid file to the user. + File.chown(Puppet::Util.uid(@path), nil, output_file.path) + Puppet::Util::Execution.execute(['crontab', output_file.path], cronargs).to_s + rescue => detail + raise FileReadError, _('Could not write crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace + ensure + output_file.close + output_file.unlink + end + end + end + end +end diff --git a/modules/utilities/unix/puppet_module/cron_new/lib/puppet/type/cron.rb b/modules/utilities/unix/puppet_module/cron_new/lib/puppet/type/cron.rb new file mode 100644 index 000000000..53bb6fd2c --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/lib/puppet/type/cron.rb @@ -0,0 +1,469 @@ +require 'etc' +require 'facter' +require 'puppet/util/filetype' + +Puppet::Type.newtype(:cron) do + @doc = <<-'EOT' + @summary Installs and manages cron jobs. + + Every cron resource created by Puppet requires a command and at least one + periodic attribute (hour, minute, month, monthday, weekday, or special). While + the name of the cron job is not part of the actual job, the name is stored in a + comment beginning with `# Puppet Name: `. These comments are used to match + crontab entries created by Puppet with cron resources. + + If an existing crontab entry happens to match the scheduling and command of a + cron resource that has never been synced, Puppet defers to the existing + crontab entry and does not create a new entry tagged with the `# Puppet Name: ` + comment. + + @example + + cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => 2, + minute => 0, + } + + @example Note that all periodic attributes can be specified as an array of values: + + cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => [2, 4], + } + + @example ...or using ranges or the step syntax `*/2` (although there's no guarantee that your `cron` daemon supports these): + + cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => ['2-4'], + minute => '*/10', + } + + **Important:** _The Cron type will not reset parameters that are + removed from a manifest_. For example, removing a `minute => 10` parameter + will not reset the minute component of the associated cronjob to `*`. + These changes must be expressed by setting the parameter to + `minute => absent` because Puppet only manages parameters that are out of + sync with manifest entries. + + **Autorequires:** If Puppet is managing the user account specified by the + `user` property of a cron resource, then the cron resource will autorequire + that user. + EOT + ensurable + + # A base class for all of the Cron parameters, since they all have + # similar argument checking going on. + class CronParam < Puppet::Property + class << self + attr_accessor :boundaries, :default + end + + # We have to override the parent method, because we consume the entire + # "should" array + def insync?(is) + is_to_s(is) == should_to_s + end + + # A method used to do parameter input handling. Converts integers + # in string form to actual integers, and returns the value if it's + # an integer or false if it's just a normal string. + def numfix(num) + if num.is_a?(Integer) || num =~ %r{^\d+$} + num + else + false + end + end + + # Verify that a number is within the specified limits. Return the + # number if it is, or false if it is not. + def limitcheck(num, lower, upper) + (num.to_i >= lower && num.to_i <= upper) && num + end + + # Verify that a value falls within the specified array. Does case + # insensitive matching, and supports matching either the entire word + # or the first three letters of the word. + def alphacheck(value, ary) + tmp = value.downcase + + # If they specified a shortened version of the name, then see + # if we can lengthen it (e.g., mon => monday). + if tmp.length == 3 + ary.each_with_index do |name, index| + if tmp.casecmp(name[0..2]).zero? + return index + end + end + elsif ary.include?(tmp) + return ary.index(tmp) + end + + false + end + + def should_to_s(value = @should) + if value + if value.is_a?(Array) && (name == :command || value[0].is_a?(Symbol)) + value = value[0] + end + super(value) + else + nil + end + end + + def is_to_s(value = @is) # rubocop: disable Naming/PredicateName + if value + if value.is_a?(Array) && (name == :command || value[0].is_a?(Symbol)) + value = value[0] + end + super(value) + else + nil + end + end + + def should + if @should && @should[0] == :absent + :absent + else + @should + end + end + + def should=(ary) + super + @should.flatten! + end + + # The method that does all of the actual parameter value + # checking; called by all of the +param=+ methods. + # Requires the value, type, and bounds, and optionally supports + # a boolean of whether to do alpha checking, and if so requires + # the ary against which to do the checking. + munge do |value| + # Support 'absent' as a value, so that they can remove + # a value + if ['absent', :absent].include? value + return :absent + end + + # Allow step syntax + if %r{^\*/[0-9]+$}.match?(value.to_s) + return value + end + + # Allow ranges + if %r{^[0-9]+-[0-9]+$}.match?(value.to_s) + return value + end + + # Allow ranges with step + if %r{^[0-9]+-[0-9]+/[0-9]+$}.match?(value.to_s) + return value + end + + if value == '*' + return :absent + end + + return value unless self.class.boundaries + lower, upper = self.class.boundaries + retval = nil + num = numfix(value) + if num + retval = limitcheck(num, lower, upper) + elsif respond_to?(:alpha) + # If it has an alpha method defined, then we check + # to see if our value is in that list and if so we turn + # it into a number + retval = alphacheck(value, alpha) + end + + raise _('%{value} is not a valid %{name}') % { value: value, name: self.class.name } unless retval + return retval.to_s if retval + end + end + + # Somewhat uniquely, this property does not actually change anything -- it + # just calls +@resource.sync+, which writes out the whole cron tab for + # the user in question. There is no real way to change individual cron + # jobs without rewriting the entire cron file. + # + # Note that this means that managing many cron jobs for a given user + # could currently result in multiple write sessions for that user. + newproperty(:command, parent: CronParam) do + desc "The command to execute in the cron job. The environment + provided to the command varies by local system rules, and it is + best to always provide a fully qualified command. The user's + profile is not sourced when the command is run, so if the + user's environment is desired it should be sourced manually. + + All cron parameters support `absent` as a value; this will + remove any existing values for that field." + + def retrieve + return_value = super + return_value = return_value[0] if return_value&.is_a?(Array) + + return_value + end + + def should + if @should + if @should.is_a? Array + @should[0] + else + devfail 'command is not an array' + end + else + nil + end + end + + def munge(value) + value.strip + end + end + + newproperty(:special) do + desc "A special value such as 'reboot' or 'annually'. + Only available on supported systems such as Vixie Cron. + Overrides more specific time of day/week settings. + Set to 'absent' to make puppet revert to a plain numeric schedule." + + def specials + ['reboot', 'yearly', 'annually', 'monthly', 'weekly', 'daily', 'midnight', 'hourly', 'absent'] + + [:absent] + end + + validate do |value| + raise ArgumentError, _('Invalid special schedule %{value}') % { value: value.inspect } unless specials.include?(value) + end + + def munge(value) + # Support value absent so that a schedule can be + # forced to change to numeric. + if ['absent', :absent].include? value + return :absent + end + value + end + end + + newproperty(:minute, parent: CronParam) do + self.boundaries = [0, 59] + desc "The minute at which to run the cron job. + Optional; if specified, must be between 0 and 59, inclusive." + end + + newproperty(:hour, parent: CronParam) do + self.boundaries = [0, 23] + desc "The hour at which to run the cron job. Optional; + if specified, must be between 0 and 23, inclusive." + end + + newproperty(:weekday, parent: CronParam) do + def alpha + ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] + end + self.boundaries = [0, 7] + desc "The weekday on which to run the command. Optional; if specified, + must be either: + + - A number between 0 and 7, inclusive, with 0 or 7 being Sunday + - The name of the day, such as 'Tuesday'. + + Day ranges can only be numeric; e.g. '1-5' for weekdays, but not 'Mon-Fri'." + end + + newproperty(:month, parent: CronParam) do + def alpha + # The ___placeholder accounts for the fact that month is unique among + # "nameable" crontab entries in that it does not use 0-based indexing. + # Padding the array with a placeholder introduces the appropriate shift + # in indices. + ['___placeholder', 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'] + end + self.boundaries = [1, 12] + desc "The month of the year. Optional; if specified, + must be either: + + - A number between 1 and 12, inclusive, with 1 being January + - The name of the month, such as 'December'." + end + + newproperty(:monthday, parent: CronParam) do + self.boundaries = [1, 31] + desc "The day of the month on which to run the + command. Optional; if specified, must be between 1 and 31." + end + + newproperty(:environment) do + desc "Any environment settings associated with this cron job. They + will be stored between the header and the job in the crontab. There + can be no guarantees that other, earlier settings will not also + affect a given cron job. + + + Also, Puppet cannot automatically determine whether an existing, + unmanaged environment setting is associated with a given cron + job. If you already have cron jobs with environment settings, + then Puppet will keep those settings in the same place in the file, + but will not associate them with a specific job. + + Settings should be specified exactly as they should appear in + the crontab, like `PATH=/bin:/usr/bin:/usr/sbin`." + + validate do |value| + unless value =~ %r{^\s*(\w+)\s*=\s*(.*)\s*$} || value == :absent || value == 'absent' + raise ArgumentError, _('Invalid environment setting %{value}') % { value: value.inspect } + end + end + + def insync?(is) + if is.is_a? Array + is.sort == @should.sort + else + is == @should + end + end + + attr_reader :should + + def should_to_s(newvalue = @should) + if newvalue + newvalue.join(',') + else + nil + end + end + end + + newparam(:name) do + desc "The symbolic name of the cron job. This name + is used for human reference only and is generated automatically + for cron jobs found on the system. This generally won't + matter, as Puppet will do its best to match existing cron jobs + against specified jobs (and Puppet adds a comment to cron jobs it adds), + but it is at least possible that converting from unmanaged jobs to + managed jobs might require manual intervention." + + isnamevar + end + + newproperty(:user) do + desc "The user who owns the cron job. This user must + be allowed to run cron jobs, which is not currently checked by + Puppet. + + This property defaults to the user running Puppet or `root`. + + The default crontab provider executes the system `crontab` using + the user account specified by this property." + + defaultto do + unless provider.is_a?(@resource.class.provider(:crontab)) + struct = Etc.getpwuid(Process.uid) + struct.respond_to?(:name) && struct.name || 'root' + end + end + end + + # Autorequire the owner of the crontab entry. + autorequire(:user) do + self[:user] + end + + newproperty(:target) do + desc "The name of the crontab file in which the cron job should be stored. + + This property defaults to the value of the `user` property if set, the + user running Puppet or `root`. + + For the default crontab provider, this property is functionally + equivalent to the `user` property and should be avoided. In particular, + setting both `user` and `target` to different values will result in + undefined behavior." + + defaultto do + if provider.is_a?(@resource.class.provider(:crontab)) + val = @resource.should(:user) + if val + val + else + struct = Etc.getpwuid(Process.uid) + struct.respond_to?(:name) && struct.name || 'root' + end + elsif provider.class.ancestors.include?(Puppet::Provider::ParsedFile) + provider.class.default_target + else + nil + end + end + end + + validate do + return true unless self[:special] + return true if self[:special] == :absent + # there is a special schedule in @should, so we don't want to see + # any numeric should values + [:minute, :hour, :weekday, :monthday, :month].each do |field| + next unless self[field] + next if self[field] == :absent + raise ArgumentError, _('%{cron} cannot specify both a special schedule and a value for %{field}') % { cron: ref, field: field } + end + end + + # We have to reorder things so that :provide is before :target + + attr_accessor :uid + + # Marks the resource as "being purged". + # + # @api public + # + # @note This overrides the Puppet::Type method in order to handle + # an edge case that has so far been observed during testing only. + # Without forcing the should-value for the user property to be + # identical to the original cron file, purging from a fixture + # will not work, because the user property defaults to the user + # running the test. It is not clear whether this scenario can apply + # during normal operation. + # + # @note Also, when not forcing the should-value for the target + # property, unpurged file content (such as comments) can end up + # being written to the default target (i.e. the current login name). + def purging + self[:target] = provider.target + self[:user] = provider.target + super + end + + def value(name) + name = name.to_sym + ret = nil + obj = @parameters[name] + if obj + ret = obj.should || obj.retrieve + + if ret == :absent + ret = nil + end + end + + unless ret + unless [:command, :special].include? name + ret = '*' + end + end + + ret + end +end diff --git a/modules/utilities/unix/puppet_module/cron_new/locales/config.yaml b/modules/utilities/unix/puppet_module/cron_new/locales/config.yaml new file mode 100644 index 000000000..73037b733 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/locales/config.yaml @@ -0,0 +1,24 @@ +# This is the project-specific configuration file for setting up +# fast_gettext for your project. +gettext: + # This is used for the name of the .pot and .po files; they will be + # called .pot? + project_name: puppetlabs-cron_core + # This is used in comments in the .pot and .po files to indicate what + # project the files belong to and should bea little more desctiptive than + # + package_name: puppetlabs-cron_core + # The locale that the default messages in the .pot file are in + default_locale: en + # The email used for sending bug reports. + bugs_address: docs@puppet.com + # The holder of the copyright. + copyright_holder: Puppet, Inc. + # This determines which comments in code should be eligible for translation. + # Any comments that start with this string will be externalized. (Leave + # empty to include all.) + comments_tag: TRANSLATOR + # Patterns for +Dir.glob+ used to find all files that might contain + # translatable content, relative to the project root directory + source_files: + - './lib/**/*.rb' \ No newline at end of file diff --git a/modules/utilities/unix/puppet_module/cron_new/locales/ja/puppetlabs-cron_core.po b/modules/utilities/unix/puppet_module/cron_new/locales/ja/puppetlabs-cron_core.po new file mode 100644 index 000000000..b48f8112c --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/locales/ja/puppetlabs-cron_core.po @@ -0,0 +1,93 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2018 Puppet, Inc. +# This file is distributed under the same license as the puppetlabs-cron_core package. +# FIRST AUTHOR , 2018. +# +# Translators: +# Erwin Hom , 2018 +# 梅田智世 , 2018 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: puppetlabs-cron_core\n" +"Report-Msgid-Bugs-To: docs@puppet.com\n" +"POT-Creation-Date: 2018-12-11 19:36+0000\n" +"PO-Revision-Date: 2018-10-23 21:15+0000\n" +"Last-Translator: 梅田智世 , 2018\n" +"Language-Team: Japanese (Japan) (https://www.transifex.com/puppet/teams/41915/ja_JP/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ja_JP\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../lib/puppet/provider/cron/crontab.rb:60 +msgid "" +"Line got parsed as a crontab entry but cannot be handled. Please file a bug " +"with the contents of your crontab" +msgstr "行をcrontabエントリとして解析しましたが、処理できません。crontabのコンテンツとともにバグを報告してください。" + +#: ../lib/puppet/provider/cron/crontab.rb:103 +msgid "no command specified, cannot create" +msgstr "コマンドが指定されていません。作成できません。" + +#: ../lib/puppet/provider/cron/filetype.rb:37 +msgid "Could not retrieve user %{user}: %{detail}" +msgstr "ユーザ%{user}を検索できませんでした: %{detail}" + +#: ../lib/puppet/provider/cron/filetype.rb:48 +#: ../lib/puppet/provider/cron/filetype.rb:111 +#: ../lib/puppet/provider/cron/filetype.rb:162 +msgid "" +"The %{path} user does not exist. Treating their crontab file as empty in " +"case Puppet creates them in the middle of the run." +msgstr "" +"%{path}ユーザは存在しません。Puppetが実行中にこれらのユーザを作成した場合は、ユーザのcrontabファイルは空として処理されます。" + +#: ../lib/puppet/provider/cron/filetype.rb:59 +#: ../lib/puppet/provider/cron/filetype.rb:122 +#: ../lib/puppet/provider/cron/filetype.rb:173 +msgid "" +"The %{path} user is not authorized to use cron. Their crontab file is " +"treated as empty in case Puppet authorizes them in the middle of the run " +"(by, for example, modifying the cron.deny or cron.allow files)." +msgstr "" +"%{path}ユーザのcron使用は認められていません。Puppetが実行中にこれらのユーザを認証した場合は(たとえば、cron.denyまたはcron.allowファイルの修正などにより)、ユーザのcrontabファイルは空として処理されます。" + +#: ../lib/puppet/provider/cron/filetype.rb:63 +#: ../lib/puppet/provider/cron/filetype.rb:126 +#: ../lib/puppet/provider/cron/filetype.rb:177 +msgid "Could not read crontab for %{path}: %{detail}" +msgstr "%{path}のcrontabを読み込めませんでした: %{detail}" + +#: ../lib/puppet/provider/cron/filetype.rb:85 +msgid "Cannot write the %{path} user's crontab: The user does not exist" +msgstr "%{path}ユーザのcrontabを記述できません: このユーザは存在しません。" + +#: ../lib/puppet/provider/cron/filetype.rb:134 +#: ../lib/puppet/provider/cron/filetype.rb:185 +msgid "Could not remove crontab for %{path}: %{detail}" +msgstr "%{path}のcrontabを削除できませんでした: %{detail}" + +#: ../lib/puppet/provider/cron/filetype.rb:149 +#: ../lib/puppet/provider/cron/filetype.rb:201 +msgid "Could not write crontab for %{path}: %{detail}" +msgstr "%{path}のcrontabを書き込めませんでした: %{detail}" + +#: ../lib/puppet/type/cron.rb:191 +msgid "%{value} is not a valid %{name}" +msgstr "%{value}は有効な%{name}ではありません。" + +#: ../lib/puppet/type/cron.rb:249 +msgid "Invalid special schedule %{value}" +msgstr "無効な特別スケジュール%{value}" + +#: ../lib/puppet/type/cron.rb:326 +msgid "Invalid environment setting %{value}" +msgstr "無効な環境設定%{value}" + +#: ../lib/puppet/type/cron.rb:420 +msgid "" +"%{cron} cannot specify both a special schedule and a value for %{field}" +msgstr "%{cron}では、特別スケジュールと%{field}の値の両方を指定することはできません。" diff --git a/modules/utilities/unix/puppet_module/cron_new/locales/puppetlabs-cron_core.pot b/modules/utilities/unix/puppet_module/cron_new/locales/puppetlabs-cron_core.pot new file mode 100644 index 000000000..e3f4cac1c --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/locales/puppetlabs-cron_core.pot @@ -0,0 +1,71 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2018 Puppet, Inc. +# This file is distributed under the same license as the puppetlabs-cron_core package. +# FIRST AUTHOR , 2018. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: puppetlabs-cron_core \n" +"Report-Msgid-Bugs-To: docs@puppet.com\n" +"POT-Creation-Date: 2018-12-11 19:36+0000\n" +"PO-Revision-Date: 2018-12-11 19:36+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: ../lib/puppet/provider/cron/crontab.rb:60 +msgid "Line got parsed as a crontab entry but cannot be handled. Please file a bug with the contents of your crontab" +msgstr "" + +#: ../lib/puppet/provider/cron/crontab.rb:103 +msgid "no command specified, cannot create" +msgstr "" + +#: ../lib/puppet/provider/cron/filetype.rb:37 +msgid "Could not retrieve user %{user}: %{detail}" +msgstr "" + +#: ../lib/puppet/provider/cron/filetype.rb:48 ../lib/puppet/provider/cron/filetype.rb:111 ../lib/puppet/provider/cron/filetype.rb:162 +msgid "The %{path} user does not exist. Treating their crontab file as empty in case Puppet creates them in the middle of the run." +msgstr "" + +#: ../lib/puppet/provider/cron/filetype.rb:59 ../lib/puppet/provider/cron/filetype.rb:122 ../lib/puppet/provider/cron/filetype.rb:173 +msgid "The %{path} user is not authorized to use cron. Their crontab file is treated as empty in case Puppet authorizes them in the middle of the run (by, for example, modifying the cron.deny or cron.allow files)." +msgstr "" + +#: ../lib/puppet/provider/cron/filetype.rb:63 ../lib/puppet/provider/cron/filetype.rb:126 ../lib/puppet/provider/cron/filetype.rb:177 +msgid "Could not read crontab for %{path}: %{detail}" +msgstr "" + +#: ../lib/puppet/provider/cron/filetype.rb:85 +msgid "Cannot write the %{path} user's crontab: The user does not exist" +msgstr "" + +#: ../lib/puppet/provider/cron/filetype.rb:134 ../lib/puppet/provider/cron/filetype.rb:185 +msgid "Could not remove crontab for %{path}: %{detail}" +msgstr "" + +#: ../lib/puppet/provider/cron/filetype.rb:149 ../lib/puppet/provider/cron/filetype.rb:201 +msgid "Could not write crontab for %{path}: %{detail}" +msgstr "" + +#: ../lib/puppet/type/cron.rb:191 +msgid "%{value} is not a valid %{name}" +msgstr "" + +#: ../lib/puppet/type/cron.rb:249 +msgid "Invalid special schedule %{value}" +msgstr "" + +#: ../lib/puppet/type/cron.rb:326 +msgid "Invalid environment setting %{value}" +msgstr "" + +#: ../lib/puppet/type/cron.rb:420 +msgid "%{cron} cannot specify both a special schedule and a value for %{field}" +msgstr "" diff --git a/modules/utilities/unix/puppet_module/cron_new/manifests/.keep b/modules/utilities/unix/puppet_module/cron_new/manifests/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/modules/utilities/unix/puppet_module/cron_new/metadata.json b/modules/utilities/unix/puppet_module/cron_new/metadata.json new file mode 100644 index 000000000..238347b61 --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/metadata.json @@ -0,0 +1,63 @@ +{ + "name": "puppetlabs-cron_core", + "version": "1.3.0", + "author": "puppetlabs", + "summary": "Install and manage cron resources.", + "license": "Apache-2.0", + "source": "https://github.com/puppetlabs/puppetlabs-cron_core", + "project_page": "https://github.com/puppetlabs/puppetlabs-cron_core", + "issues_url": "https://github.com/puppetlabs/puppetlabs-cron_core/issues", + "dependencies": [ + + ], + "operatingsystem_support": [ + { + "operatingsystem": "CentOS" + }, + { + "operatingsystem": "OracleLinux" + }, + { + "operatingsystem": "RedHat" + }, + { + "operatingsystem": "Scientific" + }, + { + "operatingsystem": "Debian" + }, + { + "operatingsystem": "Ubuntu" + }, + { + "operatingsystem": "Fedora" + }, + { + "operatingsystem": "macOS" + }, + { + "operatingsystem": "SLES" + }, + { + "operatingsystem": "Solaris" + }, + { + "operatingsystem": "Rocky" + }, + { + "operatingsystem": "AlmaLinux" + }, + { + "operatingsystem": "Amazon" + } + ], + "requirements": [ + { + "name": "puppet", + "version_requirement": ">= 6.0.0 < 9.0.0" + } + ], + "pdk-version": "3.0.1", + "template-url": "https://github.com/puppetlabs/pdk-templates#3.0.1", + "template-ref": "tags/3.0.1-0-gd13288a" +} diff --git a/modules/utilities/unix/puppet_module/cron_new/pdk.yaml b/modules/utilities/unix/puppet_module/cron_new/pdk.yaml new file mode 100644 index 000000000..4bef4bd0f --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/pdk.yaml @@ -0,0 +1,2 @@ +--- +ignore: [] diff --git a/modules/utilities/unix/puppet_module/cron_new/secgen_metadata.xml b/modules/utilities/unix/puppet_module/cron_new/secgen_metadata.xml new file mode 100644 index 000000000..26d28232a --- /dev/null +++ b/modules/utilities/unix/puppet_module/cron_new/secgen_metadata.xml @@ -0,0 +1,19 @@ + + + + cron new + Z. Cliffe Schreuders + MIT + cron + + puppet_module + linux + + + + .*bases/debian_(stretch|buster|wheezy) + + + diff --git a/modules/utilities/unix/puppet_module/host/.rubocop.yml b/modules/utilities/unix/puppet_module/host/.rubocop.yml new file mode 100644 index 000000000..7d258ef2f --- /dev/null +++ b/modules/utilities/unix/puppet_module/host/.rubocop.yml @@ -0,0 +1,724 @@ +--- +require: +- rubocop-performance +- rubocop-rspec +AllCops: + DisplayCopNames: true + TargetRubyVersion: '2.6' + Include: + - "**/*.rb" + Exclude: + - bin/* + - ".vendor/**/*" + - "**/Gemfile" + - "**/Rakefile" + - pkg/**/* + - spec/fixtures/**/* + - vendor/**/* + - "**/Puppetfile" + - "**/Vagrantfile" + - "**/Guardfile" +Layout/LineLength: + Description: People have wide screens, use them. + Max: 200 + Enabled: false +RSpec/BeforeAfterAll: + Description: Beware of using after(:all) as it may cause state to leak between tests. + A necessary evil in acceptance testing. + Exclude: + - spec/acceptance/**/*.rb +RSpec/HookArgument: + Description: Prefer explicit :each argument, matching existing module's style + EnforcedStyle: each +RSpec/DescribeSymbol: + Exclude: + - spec/unit/facter/**/*.rb +Style/BlockDelimiters: + Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to + be consistent then. + EnforcedStyle: braces_for_chaining +Style/ClassAndModuleChildren: + Description: Compact style reduces the required amount of indentation. + EnforcedStyle: compact +Style/EmptyElse: + Description: Enforce against empty else clauses, but allow `nil` for clarity. + EnforcedStyle: empty +Style/FormatString: + Description: Following the main puppet project's style, prefer the % format format. + EnforcedStyle: percent +Style/FormatStringToken: + Description: Following the main puppet project's style, prefer the simpler template + tokens over annotated ones. + EnforcedStyle: template +Style/Lambda: + Description: Prefer the keyword for easier discoverability. + EnforcedStyle: literal +Style/RegexpLiteral: + Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 + EnforcedStyle: percent_r +Style/TernaryParentheses: + Description: Checks for use of parentheses around ternary conditions. Enforce parentheses + on complex expressions for better readability, but seriously consider breaking + it up. + EnforcedStyle: require_parentheses_when_complex +Style/TrailingCommaInArguments: + Description: Prefer always trailing comma on multiline argument lists. This makes + diffs, and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/TrailingCommaInArrayLiteral: + Description: Prefer always trailing comma on multiline literals. This makes diffs, + and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/SymbolArray: + Description: Using percent style obscures symbolic intent of array's contents. + EnforcedStyle: brackets +Layout/HeredocIndentation: + Enabled: false +RSpec/MessageSpies: + EnforcedStyle: receive +Style/Documentation: + Exclude: + - lib/puppet/parser/functions/**/* + - spec/**/* +Style/WordArray: + EnforcedStyle: brackets +Performance/AncestorsInclude: + Enabled: true +Performance/BigDecimalWithNumericArgument: + Enabled: true +Performance/BlockGivenWithExplicitBlock: + Enabled: true +Performance/CaseWhenSplat: + Enabled: true +Performance/ConstantRegexp: + Enabled: true +Performance/MethodObjectAsBlock: + Enabled: true +Performance/RedundantSortBlock: + Enabled: true +Performance/RedundantStringChars: + Enabled: true +Performance/ReverseFirst: + Enabled: true +Performance/SortReverse: + Enabled: true +Performance/Squeeze: + Enabled: true +Performance/StringInclude: + Enabled: true +Performance/Sum: + Enabled: true +Style/CollectionMethods: + Enabled: true +Style/MethodCalledOnDoEndBlock: + Enabled: true +Style/StringMethods: + Enabled: true +Bundler/GemFilename: + Enabled: false +Bundler/InsecureProtocolSource: + Enabled: false +Capybara/CurrentPathExpectation: + Enabled: false +Capybara/VisibilityMatcher: + Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: + Enabled: false +Gemspec/RequiredRubyVersion: + Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +Layout/BeginEndAlignment: + Enabled: false +Layout/ClosingHeredocIndentation: + Enabled: false +Layout/EmptyComment: + Enabled: false +Layout/EmptyLineAfterGuardClause: + Enabled: false +Layout/EmptyLinesAroundArguments: + Enabled: false +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false +Layout/EndOfLine: + Enabled: false +Layout/FirstArgumentIndentation: + Enabled: false +Layout/HashAlignment: + Enabled: false +Layout/LeadingEmptyLines: + Enabled: false +Layout/SpaceAroundMethodCallOperator: + Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false +Layout/SpaceInsideReferenceBrackets: + Enabled: false +Lint/BigDecimalNew: + Enabled: false +Lint/BooleanSymbol: + Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false +Lint/DuplicateElsifCondition: + Enabled: false +Lint/DuplicateRequire: + Enabled: false +Lint/DuplicateRescueException: + Enabled: false +Lint/EmptyConditionalBody: + Enabled: false +Lint/EmptyFile: + Enabled: false +Lint/ErbNewArguments: + Enabled: false +Lint/FloatComparison: + Enabled: false +Lint/HashCompareByIdentity: + Enabled: false +Lint/IdentityComparison: + Enabled: false +Lint/InterpolationCheck: + Enabled: false +Lint/MissingCopEnableDirective: + Enabled: false +Lint/MixedRegexpCaptureTypes: + Enabled: false +Lint/NestedPercentLiteral: + Enabled: false +Lint/NonDeterministicRequireOrder: + Enabled: false +Lint/OrderedMagicComments: + Enabled: false +Lint/OutOfRangeRegexpRef: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/RedundantCopEnableDirective: + Enabled: false +Lint/RedundantRequireStatement: + Enabled: false +Lint/RedundantSafeNavigation: + Enabled: false +Lint/RedundantWithIndex: + Enabled: false +Lint/RedundantWithObject: + Enabled: false +Lint/RegexpAsCondition: + Enabled: false +Lint/ReturnInVoidContext: + Enabled: false +Lint/SafeNavigationConsistency: + Enabled: false +Lint/SafeNavigationWithEmpty: + Enabled: false +Lint/SelfAssignment: + Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/ShadowedArgument: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Lint/ToJSON: + Enabled: false +Lint/TopLevelReturnWithArgument: + Enabled: false +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false +Lint/UnreachableLoop: + Enabled: false +Lint/UriEscapeUnescape: + Enabled: false +Lint/UriRegexp: + Enabled: false +Lint/UselessMethodDefinition: + Enabled: false +Lint/UselessTimes: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/BlockNesting: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/ParameterLists: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Migration/DepartmentName: + Enabled: false +Naming/AccessorMethodName: + Enabled: false +Naming/BlockParameterName: + Enabled: false +Naming/HeredocDelimiterCase: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Naming/MemoizedInstanceVariableName: + Enabled: false +Naming/MethodParameterName: + Enabled: false +Naming/RescuedExceptionsVariableName: + Enabled: false +Naming/VariableNumber: + Enabled: false +Performance/BindCall: + Enabled: false +Performance/DeletePrefix: + Enabled: false +Performance/DeleteSuffix: + Enabled: false +Performance/InefficientHashSearch: + Enabled: false +Performance/UnfreezeString: + Enabled: false +Performance/UriDefaultParser: + Enabled: false +RSpec/Be: + Enabled: false +RSpec/Capybara/FeatureMethods: + Enabled: false +RSpec/ContainExactly: + Enabled: false +RSpec/ContextMethod: + Enabled: false +RSpec/ContextWording: + Enabled: false +RSpec/DescribeClass: + Enabled: false +RSpec/EmptyHook: + Enabled: false +RSpec/EmptyLineAfterExample: + Enabled: false +RSpec/EmptyLineAfterExampleGroup: + Enabled: false +RSpec/EmptyLineAfterHook: + Enabled: false +RSpec/ExampleLength: + Enabled: false +RSpec/ExampleWithoutDescription: + Enabled: false +RSpec/ExpectChange: + Enabled: false +RSpec/ExpectInHook: + Enabled: false +RSpec/FactoryBot/AttributeDefinedStatically: + Enabled: false +RSpec/FactoryBot/CreateList: + Enabled: false +RSpec/FactoryBot/FactoryClassName: + Enabled: false +RSpec/HooksBeforeExamples: + Enabled: false +RSpec/ImplicitBlockExpectation: + Enabled: false +RSpec/ImplicitSubject: + Enabled: false +RSpec/LeakyConstantDeclaration: + Enabled: false +RSpec/LetBeforeExamples: + Enabled: false +RSpec/MatchArray: + Enabled: false +RSpec/MissingExampleGroupArgument: + Enabled: false +RSpec/MultipleExpectations: + Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpec/MultipleSubjects: + Enabled: false +RSpec/NestedGroups: + Enabled: false +RSpec/PredicateMatcher: + Enabled: false +RSpec/ReceiveCounts: + Enabled: false +RSpec/ReceiveNever: + Enabled: false +RSpec/RepeatedExampleGroupBody: + Enabled: false +RSpec/RepeatedExampleGroupDescription: + Enabled: false +RSpec/RepeatedIncludeExample: + Enabled: false +RSpec/ReturnFromStub: + Enabled: false +RSpec/SharedExamples: + Enabled: false +RSpec/StubbedMock: + Enabled: false +RSpec/UnspecifiedException: + Enabled: false +RSpec/VariableDefinition: + Enabled: false +RSpec/VoidExpect: + Enabled: false +RSpec/Yield: + Enabled: false +Security/Open: + Enabled: false +Style/AccessModifierDeclarations: + Enabled: false +Style/AccessorGrouping: + Enabled: false +Style/BisectedAttrAccessor: + Enabled: false +Style/CaseLikeIf: + Enabled: false +Style/ClassEqualityComparison: + Enabled: false +Style/ColonMethodDefinition: + Enabled: false +Style/CombinableLoops: + Enabled: false +Style/CommentedKeyword: + Enabled: false +Style/Dir: + Enabled: false +Style/DoubleCopDisableDirective: + Enabled: false +Style/EmptyBlockParameter: + Enabled: false +Style/EmptyLambdaParameter: + Enabled: false +Style/Encoding: + Enabled: false +Style/EvalWithLocation: + Enabled: false +Style/ExpandPathArguments: + Enabled: false +Style/ExplicitBlockArgument: + Enabled: false +Style/ExponentialNotation: + Enabled: false +Style/FloatDivision: + Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false +Style/GlobalStdStream: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Style/HashLikeCase: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Style/KeywordParametersOrder: + Enabled: false +Style/MinMax: + Enabled: false +Style/MixinUsage: + Enabled: false +Style/MultilineWhenThen: + Enabled: false +Style/NegatedUnless: + Enabled: false +Style/NumericPredicate: + Enabled: false +Style/OptionalBooleanParameter: + Enabled: false +Style/OrAssignment: + Enabled: false +Style/RandomWithOffset: + Enabled: false +Style/RedundantAssignment: + Enabled: false +Style/RedundantCondition: + Enabled: false +Style/RedundantConditional: + Enabled: false +Style/RedundantFetchBlock: + Enabled: false +Style/RedundantFileExtensionInRequire: + Enabled: false +Style/RedundantRegexpCharacterClass: + Enabled: false +Style/RedundantRegexpEscape: + Enabled: false +Style/RedundantSelfAssignment: + Enabled: false +Style/RedundantSort: + Enabled: false +Style/RescueStandardError: + Enabled: false +Style/SingleArgumentDig: + Enabled: false +Style/SlicingWithRange: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/StderrPuts: + Enabled: false +Style/StringConcatenation: + Enabled: false +Style/Strip: + Enabled: false +Style/SymbolProc: + Enabled: false +Style/TrailingBodyOnClass: + Enabled: false +Style/TrailingBodyOnMethodDefinition: + Enabled: false +Style/TrailingBodyOnModule: + Enabled: false +Style/TrailingCommaInHashLiteral: + Enabled: false +Style/TrailingMethodEndStatement: + Enabled: false +Style/UnpackFirst: + Enabled: false +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateMagicComment: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/TripleQuotes: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/ArrayIntersect: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DirEmpty: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NestedFileDirname: + Enabled: false +Style/NilLambda: + Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false +Style/SwapValues: + Enabled: false diff --git a/modules/utilities/unix/puppet_module/wordpress/templates/wordpress_conf.sh.erb b/modules/utilities/unix/puppet_module/wordpress/templates/wordpress_conf.sh.erb index 73a080b46..2ceda2482 100644 --- a/modules/utilities/unix/puppet_module/wordpress/templates/wordpress_conf.sh.erb +++ b/modules/utilities/unix/puppet_module/wordpress/templates/wordpress_conf.sh.erb @@ -1,16 +1,16 @@ #!/bin/bash -<% require 'uri' +<% require 'cgi' $url_base = "#{@https ? 'https' : 'http'}://#{@ip_address}:#{@https ? '443' : @port}" $params = '' - $params += 'weblog_title=' + URI::encode(@blog_title) - $params += '&admin_email=' + URI::encode(@admin_email) + $params += 'weblog_title=' + CGI.escape(@blog_title) + $params += '&admin_email=' + CGI.escape(@admin_email) if @version[0].to_i >= 3 - $params += '&user_name=' + @username - $params += '&admin_password=' + @admin_password - $params += '&admin_password2=' + @admin_password + $params += '&user_name=' + CGI.escape(@username) + $params += '&admin_password=' + CGI.escape(@admin_password) + $params += '&admin_password2=' + CGI.escape(@admin_password) elsif (@version[0].to_i == 4) and (@version[2].to_i >= 3) $params += '&pw_weak=on' - $params += '&pass1-text=' + @admin_password + $params += '&pass1-text=' + CGI.escape(@admin_password) end if @version[0].to_i == 1 and @version[2].to_i == 5 $params += '&Submit=Continue+to+Second+Step+%C2%BB' diff --git a/modules/utilities/unix/system/hosts/CHANGELOG.md b/modules/utilities/unix/system/hosts/CHANGELOG.md new file mode 100644 index 000000000..8d053ec0b --- /dev/null +++ b/modules/utilities/unix/system/hosts/CHANGELOG.md @@ -0,0 +1,59 @@ + +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). + +## [v1.3.0](https://github.com/puppetlabs/puppetlabs-host_core/tree/v1.3.0) - 2024-03-06 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-host_core/compare/v1.2.0...v1.3.0) + +### Added + +- (PA-5575) Add Amazon to display support in Puppet forge [#44](https://github.com/puppetlabs/puppetlabs-host_core/pull/44) ([shubhamshinde360](https://github.com/shubhamshinde360)) + +## [v1.2.0](https://github.com/puppetlabs/puppetlabs-host_core/tree/v1.2.0) - 2023-02-14 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-host_core/compare/v1.1.0...v1.2.0) + +### Added + +- (MODULES-11371) Updates PDK template [#39](https://github.com/puppetlabs/puppetlabs-host_core/pull/39) ([mhashizume](https://github.com/mhashizume)) + +## [v1.1.0](https://github.com/puppetlabs/puppetlabs-host_core/tree/v1.1.0) - 2021-10-04 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-host_core/compare/1.0.3...v1.1.0) + +### Added + +- (MODULES-11167)(MODULES-11191) Add RockyLinux && AlmaLinux to host-core metadata [#29](https://github.com/puppetlabs/puppetlabs-host_core/pull/29) ([BobosilaVictor](https://github.com/BobosilaVictor)) + +## [1.0.3](https://github.com/puppetlabs/puppetlabs-host_core/tree/1.0.3) - 2019-11-01 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-host_core/compare/1.0.2...1.0.3) + +### Added + +- pdksync - (maint) Update module using PDK 1.14.0 [#15](https://github.com/puppetlabs/puppetlabs-host_core/pull/15) ([mihaibuzgau](https://github.com/mihaibuzgau)) + +## [1.0.2](https://github.com/puppetlabs/puppetlabs-host_core/tree/1.0.2) - 2019-01-11 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-host_core/compare/1.0.1...1.0.2) + +### Added + +- (maint) update PDK to 1.8.0; update all templates [#11](https://github.com/puppetlabs/puppetlabs-host_core/pull/11) ([melissa](https://github.com/melissa)) +- (L10n) Updating translations for readmes/README_ja_JP.md [#9](https://github.com/puppetlabs/puppetlabs-host_core/pull/9) ([ehom](https://github.com/ehom)) + +## [1.0.1](https://github.com/puppetlabs/puppetlabs-host_core/tree/1.0.1) - 2018-08-20 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-host_core/compare/1.0.0...1.0.1) + +### Added + +- Include puppet 6 and remove default role [#2](https://github.com/puppetlabs/puppetlabs-host_core/pull/2) ([joshcooper](https://github.com/joshcooper)) + +## [1.0.0](https://github.com/puppetlabs/puppetlabs-host_core/tree/1.0.0) - 2018-07-13 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-host_core/compare/9d96ddecea6367abee1aa77859848b0c158fca80...1.0.0) diff --git a/modules/utilities/unix/system/hosts/CODEOWNERS b/modules/utilities/unix/system/hosts/CODEOWNERS new file mode 100644 index 000000000..03deaa383 --- /dev/null +++ b/modules/utilities/unix/system/hosts/CODEOWNERS @@ -0,0 +1 @@ +* @puppetlabs/phoenix diff --git a/modules/utilities/unix/system/hosts/LICENSE b/modules/utilities/unix/system/hosts/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/modules/utilities/unix/system/hosts/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/utilities/unix/system/hosts/README.md b/modules/utilities/unix/system/hosts/README.md new file mode 100644 index 000000000..02273adb5 --- /dev/null +++ b/modules/utilities/unix/system/hosts/README.md @@ -0,0 +1,59 @@ + +# host_core + +[![Modules Status](https://github.com/puppetlabs/puppetlabs-host_core/workflows/%5BDaily%5D%20Unit%20Tests%20with%20nightly%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-host_core/actions) +[![Modules Status](https://github.com/puppetlabs/puppetlabs-host_core/workflows/Static%20Code%20Analysis/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-host_core/actions) +[![Modules Status](https://github.com/puppetlabs/puppetlabs-host_core/workflows/Unit%20Tests%20with%20nightly%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-host_core/actions) +[![Modules Status](https://github.com/puppetlabs/puppetlabs-host_core/workflows/Unit%20Tests%20with%20released%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-host_core/actions) + + +#### Table of Contents + +1. [Description](#description) +2. [Usage](#usage) +3. [Reference](#reference) +4. [Development - Guide for contributing to the module](#development) + + +## Description + +The host_core module is used to manage host entries in a hosts file. For most systems, the hosts file is located in `/etc/hosts`. + + +## Usage + +To configure a `localhost` host entry to resolve to an `ip` with a list of `host_aliases`, use the following code: + +``` +host { 'localhost': + ensure => 'present', + host_aliases => ['localhost.localdomain', 'localhost4', 'localhost4.localdomain4'], + ip => '127.0.0.1', + target => '/etc/hosts', +} +``` + + +## Reference + +Please see REFERENCE.md for the reference documentation. + +This module is documented using Puppet Strings. + +For a quick primer on how Strings works, please see [this blog post](https://puppet.com/blog/using-puppet-strings-generate-great-documentation-puppet-modules) or the [README.md](https://github.com/puppetlabs/puppet-strings/blob/master/README.md) for Puppet Strings. + +To generate documentation locally, run the following command: +``` +bundle install +bundle exec puppet strings generate ./lib/**/*.rb +``` +This command will create a browsable `_index.html` file in the `doc` directory. The references available here are all generated from YARD-style comments embedded in the code base. When any development happens on this module, the impacted documentation should also be updated. + + +## Development + +Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve. + +We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. + +For more information, see our [module contribution guide.](https://puppet.com/docs/puppet/latest/contributing.html) diff --git a/modules/utilities/unix/system/hosts/README_ja_JP.md b/modules/utilities/unix/system/hosts/README_ja_JP.md new file mode 100644 index 000000000..d96ad7f16 --- /dev/null +++ b/modules/utilities/unix/system/hosts/README_ja_JP.md @@ -0,0 +1,53 @@ + +# host_core + +#### 目次 + +1. [Description](#description) +2. [使用](#usage) +3. [リファレンス](#reference) +4. [開発 - モジュール貢献についてのガイド](#development) + + +## 説明 + +host_coreモジュールは、ホストファイル内のホストエントリの管理に用いられます。ほとんどのシステムでは、ホストファイルは`/etc/hosts`にあります。 + + +## 使用 + +`host_aliases`のリストを用いて`ip`を解決するための`localhost`ホストエントリを設定するには、以下のコードを使用します。 + +``` +host { 'localhost': + ensure => 'present', + host_aliases => ['localhost.localdomain', 'localhost4', 'localhost4.localdomain4'], + ip => '127.0.0.1', + target => '/etc/hosts', +} +``` + + +## リファレンス + +リファレンス文書については、REFERENCE.mdを参照してください。 + +このモジュールは、Puppet Stringsを用いて文書化されています。 + +Stringsの仕組みの簡単な概要については、Puppet Stringsに関する[こちらのブログ記事](https://puppet.com/blog/using-puppet-strings-generate-great-documentation-puppet-modules)または[README.md](https://github.com/puppetlabs/puppet-strings/blob/master/README.md)を参照してください。 + +文書をローカルで作成するには、以下のコマンドを実行します。 +``` +bundle install +bundle exec puppet strings generate ./lib/**/*.rb +``` +このコマンドにより、閲覧可能な`_index.html`ファイルが`doc`ディレクトリに作成されます。ここで利用可能なリファレンスはすべて、コードベースに埋め込まれたYARD形式のコメントから生成されます。このモジュールに関して何らかの開発をする場合は、影響を受ける文書も更新する必要があります。 + + +## 開発 + +Puppet ForgeのPuppet Labsモジュールは、オープンプロジェクトです。プロジェクトをさらに発展させるには、コミュニティへの貢献が不可欠です。Puppetが役立つ可能性のある膨大な数のプラットフォーム、無数のハードウェア、ソフトウェア、デプロイメント構成に我々がアクセスすることはできません。 + +弊社は、できるだけ変更に貢献しやすくして、弊社のモジュールがユーザの環境で機能する状態を維持したいと考えています。弊社では、状況を把握できるよう、貢献者に従っていただくべきいくつかのガイドラインを設けています。 + +詳細については、[モジュール貢献ガイド](https://docs.puppetlabs.com/forge/contributing.html)を参照してください。 diff --git a/modules/utilities/unix/system/hosts/REFERENCE.md b/modules/utilities/unix/system/hosts/REFERENCE.md new file mode 100644 index 000000000..494a9e4ca --- /dev/null +++ b/modules/utilities/unix/system/hosts/REFERENCE.md @@ -0,0 +1,65 @@ +# Reference + + + +## Table of Contents + +### Resource types + +* [`host`](#host): Installs and manages host entries. + +## Resource types + +### `host` + +For most systems, these entries will just be in `/etc/hosts`, but some +systems (notably OS X) will have different solutions. + +#### Properties + +The following properties are available in the `host` type. + +##### `comment` + +A comment that will be attached to the line with a # character. + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `host_aliases` + +Any aliases the host might have. Multiple values must be +specified as an array. + +##### `ip` + +The host's IP address, IPv4 or IPv6. + +##### `target` + +The file in which to store service information. Only used by +those providers that write to disk. On most systems this defaults to `/etc/hosts`. + +#### Parameters + +The following parameters are available in the `host` type. + +* [`name`](#-host--name) +* [`provider`](#-host--provider) + +##### `name` + +namevar + +The host name. + +##### `provider` + +The specific backend to use for this `host` resource. You will seldom need to specify this --- Puppet will usually +discover the appropriate provider for your platform. + diff --git a/modules/utilities/unix/system/hosts/data/common.yaml b/modules/utilities/unix/system/hosts/data/common.yaml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/modules/utilities/unix/system/hosts/data/common.yaml @@ -0,0 +1 @@ +--- diff --git a/modules/utilities/unix/system/hosts/hiera.yaml b/modules/utilities/unix/system/hosts/hiera.yaml new file mode 100644 index 000000000..2251c236a --- /dev/null +++ b/modules/utilities/unix/system/hosts/hiera.yaml @@ -0,0 +1,21 @@ +--- +version: 5 + +defaults: # Used for any hierarchy level that omits these keys. + datadir: data # This path is relative to hiera.yaml's directory. + data_hash: yaml_data # Use the built-in YAML backend. + +hierarchy: + - name: "osfamily/major release" + paths: + - "os/%{facts.os.family}/%{facts.os.release.major}.yaml" + # Used for Solaris + - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml" + # Used to distinguish between Debian and Ubuntu + - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" + - name: "osfamily" + paths: + - "os/%{facts.os.family}.yaml" + - "os/%{facts.os.name}.yaml" + - name: 'common' + path: 'common.yaml' diff --git a/modules/utilities/unix/system/hosts/lib/puppet/provider/host/parsed.rb b/modules/utilities/unix/system/hosts/lib/puppet/provider/host/parsed.rb new file mode 100644 index 000000000..57396465c --- /dev/null +++ b/modules/utilities/unix/system/hosts/lib/puppet/provider/host/parsed.rb @@ -0,0 +1,49 @@ +require 'puppet/provider/parsedfile' + +case Facter.value('os.family') +when 'Solaris' + hosts = '/etc/inet/hosts' +when 'windows' + require 'win32/resolv' + hosts = Win32::Resolv.get_hosts_path +else + hosts = '/etc/hosts' +end + +Puppet::Type.type(:host).provide(:parsed, parent: Puppet::Provider::ParsedFile, + default_target: hosts, filetype: :flat) do + @doc = "Installs and manages host entries. For most systems, these + entries will just be in `/etc/hosts`, but some systems (notably OS X) + will have different solutions." + + confine exists: hosts + + text_line :comment, match: %r{^#} + text_line :blank, match: %r{^\s*$} + hosts_pattern = '^([0-9a-f:]\S+)\s+([^#\s+]\S+)\s*(.*?)?(?:\s*#\s*(.*))?$' + record_line :parsed, fields: ['ip', 'name', 'host_aliases', 'comment'], + optional: ['host_aliases', 'comment'], + match: %r{#{hosts_pattern}}, + post_parse: proc { |hash| + # An absent comment should match "comment => ''" + hash[:comment] = '' if hash[:comment].nil? || hash[:comment] == :absent + unless hash[:host_aliases].nil? || hash[:host_aliases] == :absent + hash[:host_aliases].gsub!(%r{\s+}, ' ') # Change delimiter + end + }, + to_line: proc { |hash| + [:ip, :name].each do |n| + raise ArgumentError, _('%{attr} is a required attribute for hosts') % { attr: n } unless hash[n] && hash[n] != :absent + end + str = "#{hash[:ip]}\t#{hash[:name]}" + if hash.include?(:host_aliases) && !hash[:host_aliases].nil? && hash[:host_aliases] != :absent + str += "\t#{hash[:host_aliases]}" + end + if hash.include?(:comment) && !hash[:comment].empty? + str += "\t# #{hash[:comment]}" + end + str + } + + text_line :incomplete, match: %r{(?! (#{hosts_pattern}))} +end diff --git a/modules/utilities/unix/system/hosts/lib/puppet/type/host.rb b/modules/utilities/unix/system/hosts/lib/puppet/type/host.rb new file mode 100644 index 000000000..30c509a34 --- /dev/null +++ b/modules/utilities/unix/system/hosts/lib/puppet/type/host.rb @@ -0,0 +1,93 @@ +require 'puppet/property/ordered_list' + +Puppet::Type.newtype(:host) do + @doc = "@summary Installs and manages host entries. + + For most systems, these entries will just be in `/etc/hosts`, but some + systems (notably OS X) will have different solutions." + + ensurable + + newproperty(:ip) do + desc "The host's IP address, IPv4 or IPv6." + + def valid_v4?(addr) + data = addr.match(%r{^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$}) + data && data.captures.map(&:to_i).all? { |i| i >= 0 && i <= 255 } + end + + def valid_v6?(addr) + # http://forums.dartware.com/viewtopic.php?t=452 + # ...and, yes, it is this hard. Doing it programmatically is harder. + addr =~ %r{^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$} + end + + def valid_newline?(addr) + !addr.include?("\n") && !addr.include?("\r") + end + + validate do |value| + return true if (valid_v4?(value) || valid_v6?(value)) && valid_newline?(value) + raise Puppet::Error, _('Invalid IP address %{value}') % { value: value.inspect } + end + end + + # for now we use OrderedList to indicate that the order does matter. + newproperty(:host_aliases, parent: Puppet::Property::OrderedList) do + desc "Any aliases the host might have. Multiple values must be + specified as an array." + + def delimiter + ' ' + end + + def inclusive? + true + end + + validate do |value| + # This regex already includes newline check. + raise Puppet::Error, _('Host aliases cannot include whitespace') if %r{\s}.match?(value) + raise Puppet::Error, _('Host aliases cannot be an empty string. Use an empty array to delete all host_aliases ') if %r{^\s*$}.match?(value) + end + end + + newproperty(:comment) do + desc 'A comment that will be attached to the line with a # character.' + validate do |value| + if value.include?("\n") || value.include?("\r") + raise Puppet::Error, _('Comment cannot include newline') + end + end + end + + newproperty(:target) do + desc "The file in which to store service information. Only used by + those providers that write to disk. On most systems this defaults to `/etc/hosts`." + + defaultto do + if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile) + @resource.class.defaultprovider.default_target + else + nil + end + end + end + + newparam(:name) do + desc 'The host name.' + + isnamevar + + validate do |value| + value.split('.').each do |hostpart| + unless %r{^([\w]+|[\w][\w\-]+[\w])$}.match?(hostpart) + raise Puppet::Error, _('Invalid host name') + end + end + if value.include?("\n") || value.include?("\r") + raise Puppet::Error, _('Hostname cannot include newline') + end + end + end +end diff --git a/modules/utilities/unix/system/hosts/locales/config.yaml b/modules/utilities/unix/system/hosts/locales/config.yaml new file mode 100644 index 000000000..1db99f5bd --- /dev/null +++ b/modules/utilities/unix/system/hosts/locales/config.yaml @@ -0,0 +1,24 @@ +# This is the project-specific configuration file for setting up +# fast_gettext for your project. +gettext: + # This is used for the name of the .pot and .po files; they will be + # called .pot? + project_name: puppetlabs-host_core + # This is used in comments in the .pot and .po files to indicate what + # project the files belong to and should bea little more desctiptive than + # + package_name: puppetlabs-host_core + # The locale that the default messages in the .pot file are in + default_locale: en + # The email used for sending bug reports. + bugs_address: docs@puppet.com + # The holder of the copyright. + copyright_holder: Puppet, Inc. + # This determines which comments in code should be eligible for translation. + # Any comments that start with this string will be externalized. (Leave + # empty to include all.) + comments_tag: TRANSLATOR + # Patterns for +Dir.glob+ used to find all files that might contain + # translatable content, relative to the project root directory + source_files: + - './lib/**/*.rb' diff --git a/modules/utilities/unix/system/hosts/locales/ja/puppetlabs-host_core.po b/modules/utilities/unix/system/hosts/locales/ja/puppetlabs-host_core.po new file mode 100644 index 000000000..0e32c37e4 --- /dev/null +++ b/modules/utilities/unix/system/hosts/locales/ja/puppetlabs-host_core.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2018 Puppet, Inc. +# This file is distributed under the same license as the puppetlabs-host_core package. +# FIRST AUTHOR , 2018. +# +# Translators: +# Erwin Hom , 2018 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: puppetlabs-host_core 1.0.0-2-g10dd80a\n" +"\n" +"Report-Msgid-Bugs-To: docs@puppet.com\n" +"POT-Creation-Date: 2018-08-20 11:22-0700\n" +"PO-Revision-Date: 2018-10-23 22:50+0000\n" +"Last-Translator: Erwin Hom , 2018\n" +"Language-Team: Japanese (Japan) (https://www.transifex.com/puppet/teams/41915/ja_JP/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ja_JP\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../lib/puppet/provider/host/parsed.rb:36 +msgid "%{attr} is a required attribute for hosts" +msgstr "%{attr}はホストの必須属性です。" + +#: ../lib/puppet/type/host.rb:30 +msgid "Invalid IP address %{value}" +msgstr "無効なIPアドレス%{value}" + +#: ../lib/puppet/type/host.rb:49 +msgid "Host aliases cannot include whitespace" +msgstr "ホストの別名に空白を含めることはできません。" + +#: ../lib/puppet/type/host.rb:50 +msgid "" +"Host aliases cannot be an empty string. Use an empty array to delete all " +"host_aliases " +msgstr "ホストの別名を空文字列にすることはできません。空配列を使ってすべてのhost_aliasesを削除してください。" + +#: ../lib/puppet/type/host.rb:58 +msgid "Comment cannot include newline" +msgstr "コメントに新しい行を含めることはできません。" + +#: ../lib/puppet/type/host.rb:84 +msgid "Invalid host name" +msgstr "無効なホスト名" + +#: ../lib/puppet/type/host.rb:88 +msgid "Hostname cannot include newline" +msgstr "ホスト名に新しい行を含めることはできません。" diff --git a/modules/utilities/unix/system/hosts/locales/puppetlabs-host_core.pot b/modules/utilities/unix/system/hosts/locales/puppetlabs-host_core.pot new file mode 100644 index 000000000..079f3947d --- /dev/null +++ b/modules/utilities/unix/system/hosts/locales/puppetlabs-host_core.pot @@ -0,0 +1,48 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2018 Puppet, Inc. +# This file is distributed under the same license as the puppetlabs-host_core package. +# FIRST AUTHOR , 2018. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: puppetlabs-host_core 1.0.0-2-g10dd80a\n" +"\n" +"Report-Msgid-Bugs-To: docs@puppet.com\n" +"POT-Creation-Date: 2018-08-20 11:22-0700\n" +"PO-Revision-Date: 2018-08-20 11:22-0700\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: ../lib/puppet/provider/host/parsed.rb:36 +msgid "%{attr} is a required attribute for hosts" +msgstr "" + +#: ../lib/puppet/type/host.rb:30 +msgid "Invalid IP address %{value}" +msgstr "" + +#: ../lib/puppet/type/host.rb:49 +msgid "Host aliases cannot include whitespace" +msgstr "" + +#: ../lib/puppet/type/host.rb:50 +msgid "Host aliases cannot be an empty string. Use an empty array to delete all host_aliases " +msgstr "" + +#: ../lib/puppet/type/host.rb:58 +msgid "Comment cannot include newline" +msgstr "" + +#: ../lib/puppet/type/host.rb:84 +msgid "Invalid host name" +msgstr "" + +#: ../lib/puppet/type/host.rb:88 +msgid "Hostname cannot include newline" +msgstr "" diff --git a/modules/utilities/unix/system/hosts/metadata.json b/modules/utilities/unix/system/hosts/metadata.json new file mode 100644 index 000000000..14f17e30e --- /dev/null +++ b/modules/utilities/unix/system/hosts/metadata.json @@ -0,0 +1,66 @@ +{ + "name": "puppetlabs-host_core", + "version": "1.3.0", + "author": "puppetlabs", + "summary": "Installs and manages host entries", + "license": "Apache-2.0", + "source": "https://github.com/puppetlabs/puppetlabs-host_core", + "project_page": "https://github.com/puppetlabs/puppetlabs-host_core", + "issues_url": "https://github.com/puppetlabss/puppetlabs-host_core/issues", + "dependencies": [ + + ], + "operatingsystem_support": [ + { + "operatingsystem": "CentOS" + }, + { + "operatingsystem": "OracleLinux" + }, + { + "operatingsystem": "RedHat" + }, + { + "operatingsystem": "Scientific" + }, + { + "operatingsystem": "Debian" + }, + { + "operatingsystem": "Ubuntu" + }, + { + "operatingsystem": "windows" + }, + { + "operatingsystem": "Fedora" + }, + { + "operatingsystem": "Darwin" + }, + { + "operatingsystem": "SLES" + }, + { + "operatingsystem": "Solaris" + }, + { + "operatingsystem": "Rocky" + }, + { + "operatingsystem": "AlmaLinux" + }, + { + "operatingsystem": "Amazon" + } + ], + "requirements": [ + { + "name": "puppet", + "version_requirement": ">= 6.0.0 < 9.0.0" + } + ], + "pdk-version": "3.0.1", + "template-url": "https://github.com/puppetlabs/pdk-templates#3.0.1", + "template-ref": "tags/3.0.1-0-gd13288a" +} diff --git a/modules/utilities/unix/system/hosts/pdk.yaml b/modules/utilities/unix/system/hosts/pdk.yaml new file mode 100644 index 000000000..4bef4bd0f --- /dev/null +++ b/modules/utilities/unix/system/hosts/pdk.yaml @@ -0,0 +1,2 @@ +--- +ignore: [] diff --git a/modules/utilities/unix/web_browsers/iceweasel/templates/user.js.erb b/modules/utilities/unix/web_browsers/iceweasel/templates/user.js.erb index 2eccc7dba..8be875dc8 100644 --- a/modules/utilities/unix/web_browsers/iceweasel/templates/user.js.erb +++ b/modules/utilities/unix/web_browsers/iceweasel/templates/user.js.erb @@ -1,7 +1,29 @@ user_pref("browser.startup.homepage", "<%=@start_pages.map { |k| k.start_with?("http") ? k : "http://#{k}" }.join('|')-%>"); user_pref("browser.startup.homepage_override.buildID", "20170816210634"); user_pref("browser.startup.homepage_override.mstone", "55.0.2"); + +// Disable hardware acceleration user_pref("layers.acceleration.disabled", true); +user_pref("gfx.direct2d.disabled", true); +user_pref("layers.acceleration.force-enabled", false); +user_pref("gfx.webrender.all", false); +user_pref("gfx.webrender.enabled", false); + +// Disable the Privacy Notice page +user_pref("browser.privacy.notificationOnLaunch", false); +// Disable the What's New page +user_pref("browser.startup.homepage_override.mstone", "ignore"); +// Disable the default browser check +user_pref("browser.shell.checkDefaultBrowser", false); +// Disable the Welcome to Firefox page +user_pref("browser.aboutwelcome.enabled", false); +// Disable the Startup Home page +user_pref("browser.startup.homepage", "about:blank"); +// Disable the First Run page +user_pref("startup.homepage_welcome_url", ""); +user_pref("startup.homepage_welcome_url.additional", ""); +user_pref("startup.homepage_override_url", ""); + <% if @disable_proxy -%> user_pref("network.proxy.type",0); <% end-%> diff --git a/modules/vulnerabilities/unix/email_phishing/phish_victim_bot/manifests/install.pp b/modules/vulnerabilities/unix/email_phishing/phish_victim_bot/manifests/install.pp index 63c2a5f1e..42f4a8f06 100644 --- a/modules/vulnerabilities/unix/email_phishing/phish_victim_bot/manifests/install.pp +++ b/modules/vulnerabilities/unix/email_phishing/phish_victim_bot/manifests/install.pp @@ -8,7 +8,27 @@ class phish_victim_bot::install { $passwords = $secgen_parameters['passwords'] $phish_victim_bot_configs = $secgen_parameters['phish_victim_bot_configs'] - ensure_packages(['openjdk-11-jre', 'openjdk-11-jdk', 'zip','libreoffice-writer','libreoffice-calc','xvfb']) + ensure_packages(['zip','libreoffice-writer','libreoffice-calc','xvfb']) + + if ($operatingsystem == 'Debian') { + case $operatingsystemrelease { + /^(12).*/: { # do 12.x bookworm stuff + ensure_packages(['openjdk-17-jre', 'openjdk-17-jdk']) + } + /^(9|10).*/: { # do 9.x stretch stuff + ensure_packages(['openjdk-11-jre', 'openjdk-11-jdk']) + } + /^7.*/: { # do 7.x wheezy stuff + # Will error -- TODO needs repo + ensure_packages(['openjdk-11-jre', 'openjdk-11-jdk']) + } + 'kali-rolling': { # do kali + ensure_packages(['openjdk-11-jre', 'openjdk-11-jdk']) + } + default: { + } + } + } user { 'guest': diff --git a/modules/vulnerabilities/unix/email_phishing/phish_victim_bot/secgen_metadata.xml b/modules/vulnerabilities/unix/email_phishing/phish_victim_bot/secgen_metadata.xml index 6421856f5..29fb9c78b 100644 --- a/modules/vulnerabilities/unix/email_phishing/phish_victim_bot/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/email_phishing/phish_victim_bot/secgen_metadata.xml @@ -49,6 +49,9 @@ + + .*/puppet_module/cron.* + update diff --git a/modules/vulnerabilities/unix/ftp/vsftpd_234_backdoor/manifests/install.pp b/modules/vulnerabilities/unix/ftp/vsftpd_234_backdoor/manifests/install.pp index 311b707ab..e60a42f73 100644 --- a/modules/vulnerabilities/unix/ftp/vsftpd_234_backdoor/manifests/install.pp +++ b/modules/vulnerabilities/unix/ftp/vsftpd_234_backdoor/manifests/install.pp @@ -2,7 +2,7 @@ class vsftpd_234_backdoor::install { # Add 32bit libs for stretch case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch stuff exec { 'add_32bit_libs': command => '/usr/bin/dpkg --add-architecture i386 && /usr/bin/apt-get update' } diff --git a/modules/vulnerabilities/unix/irc/unrealirc_3281_backdoor/manifests/configure.pp b/modules/vulnerabilities/unix/irc/unrealirc_3281_backdoor/manifests/configure.pp index 803215f2e..5e768696c 100644 --- a/modules/vulnerabilities/unix/irc/unrealirc_3281_backdoor/manifests/configure.pp +++ b/modules/vulnerabilities/unix/irc/unrealirc_3281_backdoor/manifests/configure.pp @@ -36,7 +36,7 @@ class unrealirc_3281_backdoor::configure { } case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch stuff exec { 'restart_unreal_3281_service': command => 'systemctl daemon-reload; systemctl restart unreal', require => Exec['update_unreal_3281_port'], diff --git a/modules/vulnerabilities/unix/local/chkrootkit/secgen_metadata.xml b/modules/vulnerabilities/unix/local/chkrootkit/secgen_metadata.xml index 333108c82..28e7f2a8c 100644 --- a/modules/vulnerabilities/unix/local/chkrootkit/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/local/chkrootkit/secgen_metadata.xml @@ -45,6 +45,9 @@ exploit/unix/local/chkrootkit + + .*/puppet_module/cron.* + update diff --git a/modules/vulnerabilities/unix/misc/nc_backdoor/manifests/install.pp b/modules/vulnerabilities/unix/misc/nc_backdoor/manifests/install.pp index 2045aa590..81e0d7bcc 100644 --- a/modules/vulnerabilities/unix/misc/nc_backdoor/manifests/install.pp +++ b/modules/vulnerabilities/unix/misc/nc_backdoor/manifests/install.pp @@ -7,7 +7,7 @@ class nc_backdoor::install { ensure_packages("nmap") case $operatingsystemrelease { - /^(10).*/: { # do buster stuff + /^(1[0-9]).*/: { # do buster stuff ensure_packages("ncat") } } diff --git a/modules/vulnerabilities/unix/misc/nc_backdoor/secgen_metadata.xml b/modules/vulnerabilities/unix/misc/nc_backdoor/secgen_metadata.xml index fea2b0535..6e7863e6e 100644 --- a/modules/vulnerabilities/unix/misc/nc_backdoor/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/misc/nc_backdoor/secgen_metadata.xml @@ -42,6 +42,9 @@ Connect to a port Simply connecting to the right port will give you a root shell. + + .*/puppet_module/cron.* + update diff --git a/modules/vulnerabilities/unix/misc/nc_backdoor_chroot_esc/manifests/install.pp b/modules/vulnerabilities/unix/misc/nc_backdoor_chroot_esc/manifests/install.pp index 19064913e..0bbbd3cf7 100644 --- a/modules/vulnerabilities/unix/misc/nc_backdoor_chroot_esc/manifests/install.pp +++ b/modules/vulnerabilities/unix/misc/nc_backdoor_chroot_esc/manifests/install.pp @@ -7,7 +7,7 @@ class nc_backdoor_chroot_esc::install { ensure_packages("nmap") case $operatingsystemrelease { - /^(10).*/: { # do buster stuff + /^(1[0-9]).*/: { # do buster stuff ensure_packages("ncat") } } diff --git a/modules/vulnerabilities/unix/misc/nc_backdoor_chroot_esc/secgen_metadata.xml b/modules/vulnerabilities/unix/misc/nc_backdoor_chroot_esc/secgen_metadata.xml index bef3f40a3..6e7ccf5ed 100644 --- a/modules/vulnerabilities/unix/misc/nc_backdoor_chroot_esc/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/misc/nc_backdoor_chroot_esc/secgen_metadata.xml @@ -47,6 +47,9 @@ .*chroot_debootstrap + + .*/puppet_module/cron.* + update diff --git a/modules/vulnerabilities/unix/misc/nc_backdoor_docker_esc/manifests/install.pp b/modules/vulnerabilities/unix/misc/nc_backdoor_docker_esc/manifests/install.pp index d984dd185..f7d07b068 100644 --- a/modules/vulnerabilities/unix/misc/nc_backdoor_docker_esc/manifests/install.pp +++ b/modules/vulnerabilities/unix/misc/nc_backdoor_docker_esc/manifests/install.pp @@ -7,7 +7,7 @@ class nc_backdoor_docker_esc::install { ensure_packages("nmap") case $operatingsystemrelease { - /^(10).*/: { # do buster stuff + /^(1[0-9]).*/: { # do buster stuff ensure_packages("ncat") } } diff --git a/modules/vulnerabilities/unix/system/ssh_root_login/manifests/init.pp b/modules/vulnerabilities/unix/system/ssh_root_login/manifests/init.pp index cd383b8aa..53d27bdb2 100644 --- a/modules/vulnerabilities/unix/system/ssh_root_login/manifests/init.pp +++ b/modules/vulnerabilities/unix/system/ssh_root_login/manifests/init.pp @@ -18,11 +18,12 @@ class ssh_root_login::init { require => Package["openssh-server"], } - augeas { "sshd_config": - context => "/files/etc/ssh/sshd_config", - changes => [ - "set PermitRootLogin yes", - ], + file_line { 'sshd_config_permitrootlogin': + path => '/etc/ssh/sshd_config', + line => 'PermitRootLogin yes', + match => '^PermitRootLogin', + replace => true, + append_on_no_match => true, } user { 'root': diff --git a/modules/vulnerabilities/unix/web_training/dvwa/manifests/apache.pp b/modules/vulnerabilities/unix/web_training/dvwa/manifests/apache.pp index 6781811b6..38f704621 100644 --- a/modules/vulnerabilities/unix/web_training/dvwa/manifests/apache.pp +++ b/modules/vulnerabilities/unix/web_training/dvwa/manifests/apache.pp @@ -9,6 +9,10 @@ class dvwa::apache { if ($operatingsystem == 'Debian' or $operatingsystem == 'Kali') { case $operatingsystemrelease { + /^(12).*/: { # do 12.x bookworm stuff + $php_version = "php8.2" + ensure_packages(["default-mysql-server", 'php-mysqli']) + } /^(10).*/: { # do 10.x buster stuff $php_version = "php7.3" ensure_packages(["mysql-server", 'php-mysqli']) diff --git a/modules/vulnerabilities/unix/web_training/webgoat/manifests/install.pp b/modules/vulnerabilities/unix/web_training/webgoat/manifests/install.pp index 3501e1c44..bb218a830 100644 --- a/modules/vulnerabilities/unix/web_training/webgoat/manifests/install.pp +++ b/modules/vulnerabilities/unix/web_training/webgoat/manifests/install.pp @@ -42,22 +42,18 @@ class webgoat::install { # Consider using the java class if ($operatingsystem == 'Debian') { case $operatingsystemrelease { + /^(12).*/: { # do 12.x bookworm stuff + ensure_packages(['openjdk-17-jre']) + } /^(9|10).*/: { # do 9.x stretch stuff - # Will error -- TODO needs repo - package { 'openjdk-11-jre': - ensure => installed, - } + ensure_packages(['openjdk-11-jre']) } /^7.*/: { # do 7.x wheezy stuff # Will error -- TODO needs repo - package { 'openjdk-11-jre': - ensure => installed, - } + ensure_packages(['openjdk-11-jre']) } 'kali-rolling': { # do kali - package { 'openjdk-11-jre': - ensure => installed, - } + ensure_packages(['openjdk-11-jre']) } default: { } diff --git a/modules/vulnerabilities/unix/web_training/webwolf/manifests/install.pp b/modules/vulnerabilities/unix/web_training/webwolf/manifests/install.pp index 48fe16fb7..eb7d56c7c 100644 --- a/modules/vulnerabilities/unix/web_training/webwolf/manifests/install.pp +++ b/modules/vulnerabilities/unix/web_training/webwolf/manifests/install.pp @@ -42,22 +42,18 @@ class webwolf::install { # Consider using the java class if ($operatingsystem == 'Debian') { case $operatingsystemrelease { + /^(12).*/: { # do 12.x bookworm stuff + ensure_packages(['openjdk-17-jre']) + } /^(9|10).*/: { # do 9.x stretch stuff - # Will error -- TODO needs repo - package { 'openjdk-11-jre': - ensure => installed, - } + ensure_packages(['openjdk-11-jre']) } /^7.*/: { # do 7.x wheezy stuff # Will error -- TODO needs repo - package { 'openjdk-11-jre': - ensure => installed, - } + ensure_packages(['openjdk-11-jre']) } 'kali-rolling': { # do kali - package { 'openjdk-11-jre': - ensure => installed, - } + ensure_packages(['openjdk-11-jre']) } default: { } diff --git a/modules/vulnerabilities/unix/webapp/bludit_upload_images_exec/manifests/install.pp b/modules/vulnerabilities/unix/webapp/bludit_upload_images_exec/manifests/install.pp index 306ca2974..710b31b88 100644 --- a/modules/vulnerabilities/unix/webapp/bludit_upload_images_exec/manifests/install.pp +++ b/modules/vulnerabilities/unix/webapp/bludit_upload_images_exec/manifests/install.pp @@ -4,7 +4,7 @@ class bludit_upload_images_exec::install { ensure_packages(['php-xml','php-gd','php.mbstring','php-json']) case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch stuff ensure_packages('php5.6-gd') } } diff --git a/modules/vulnerabilities/unix/webapp/gitlist_040/manifests/install.pp b/modules/vulnerabilities/unix/webapp/gitlist_040/manifests/install.pp index 8aff1c47f..d5eedb053 100644 --- a/modules/vulnerabilities/unix/webapp/gitlist_040/manifests/install.pp +++ b/modules/vulnerabilities/unix/webapp/gitlist_040/manifests/install.pp @@ -28,7 +28,7 @@ class gitlist_040::install { } case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch stuff file { '/var/www/gitlist/.htaccess': require => Exec['unpack-gitlist'], @@ -37,4 +37,4 @@ class gitlist_040::install { } } } -} \ No newline at end of file +} diff --git a/modules/vulnerabilities/unix/webapp/onlinestore/manifests/apache.pp b/modules/vulnerabilities/unix/webapp/onlinestore/manifests/apache.pp index 308cb2a55..8bb118793 100644 --- a/modules/vulnerabilities/unix/webapp/onlinestore/manifests/apache.pp +++ b/modules/vulnerabilities/unix/webapp/onlinestore/manifests/apache.pp @@ -18,7 +18,7 @@ class onlinestore::apache { ensure_resource('tidy','os remove default site', {'path'=>'/etc/apache2/sites-enabled/000-default.conf'}) case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch stuff exec { 'a2enmod php5.6': command => '/usr/sbin/a2enmod php5.6', require => Class['::apache'] @@ -31,4 +31,4 @@ class onlinestore::apache { } } } -} \ No newline at end of file +} diff --git a/modules/vulnerabilities/unix/webapp/wordpress_1x/secgen_metadata.xml b/modules/vulnerabilities/unix/webapp/wordpress_1x/secgen_metadata.xml index 1df3816bc..6c45a152e 100644 --- a/modules/vulnerabilities/unix/webapp/wordpress_1x/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/webapp/wordpress_1x/secgen_metadata.xml @@ -50,11 +50,14 @@ - + + - Stretch + .* + + .*/puppet_module/wordpress @@ -70,6 +73,10 @@ .*mysql.*compatible.* + + + .*/puppet_module/cron.* + .*php_5.*compatible.* diff --git a/modules/vulnerabilities/unix/webapp/wordpress_2x/manifests/init.pp b/modules/vulnerabilities/unix/webapp/wordpress_2x/manifests/init.pp index d8dbf80b6..1b7091cc6 100644 --- a/modules/vulnerabilities/unix/webapp/wordpress_2x/manifests/init.pp +++ b/modules/vulnerabilities/unix/webapp/wordpress_2x/manifests/init.pp @@ -39,7 +39,7 @@ class wordpress_2x { } case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch stuff exec { 'a2enmod php5.6': command => '/usr/sbin/a2enmod php5.6', require => Class['::apache'] diff --git a/modules/vulnerabilities/unix/webapp/wordpress_2x/secgen_metadata.xml b/modules/vulnerabilities/unix/webapp/wordpress_2x/secgen_metadata.xml index da67b82b3..0b88b52e2 100644 --- a/modules/vulnerabilities/unix/webapp/wordpress_2x/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/webapp/wordpress_2x/secgen_metadata.xml @@ -57,10 +57,16 @@ - - - + + + .* + + + + .*/puppet_module/cron.* + + .*/puppet_module/wordpress diff --git a/modules/vulnerabilities/unix/webapp/wordpress_3x/manifests/init.pp b/modules/vulnerabilities/unix/webapp/wordpress_3x/manifests/init.pp index 2622eef94..c74c280d1 100644 --- a/modules/vulnerabilities/unix/webapp/wordpress_3x/manifests/init.pp +++ b/modules/vulnerabilities/unix/webapp/wordpress_3x/manifests/init.pp @@ -40,7 +40,7 @@ class wordpress_3x { } case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch stuff exec { 'a2enmod php5.6': command => '/usr/sbin/a2enmod php5.6', require => Class['::apache'] @@ -77,4 +77,4 @@ class wordpress_3x { } ensure_resource('tidy','wp remove default site', {'path'=>'/etc/apache2/sites-enabled/000-default.conf'}) -} \ No newline at end of file +} diff --git a/modules/vulnerabilities/unix/webapp/wordpress_3x/secgen_metadata.xml b/modules/vulnerabilities/unix/webapp/wordpress_3x/secgen_metadata.xml index 3265b1c98..105d7fb27 100644 --- a/modules/vulnerabilities/unix/webapp/wordpress_3x/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/webapp/wordpress_3x/secgen_metadata.xml @@ -56,12 +56,13 @@ - - - + + + .* + - .*/cron + .*/puppet_module/cron.* diff --git a/modules/vulnerabilities/unix/webapp/wordpress_4x/manifests/init.pp b/modules/vulnerabilities/unix/webapp/wordpress_4x/manifests/init.pp index d1779e26a..5cb77b135 100644 --- a/modules/vulnerabilities/unix/webapp/wordpress_4x/manifests/init.pp +++ b/modules/vulnerabilities/unix/webapp/wordpress_4x/manifests/init.pp @@ -15,6 +15,7 @@ class wordpress_4x { class { '::apache': default_vhost => false, overwrite_ports => false, + mpm_module => 'prefork', } class {'::apache::mod::rewrite': } @@ -39,7 +40,7 @@ class wordpress_4x { } case $operatingsystemrelease { - /^(9|10).*/: { # do 9.x stretch stuff + /^(9|1[0-9]).*/: { # do 9.x stretch stuff exec { 'a2enmod php5.6': command => '/usr/sbin/a2enmod php5.6', require => Class['::apache'] diff --git a/modules/vulnerabilities/unix/webapp/wordpress_4x/secgen_metadata.xml b/modules/vulnerabilities/unix/webapp/wordpress_4x/secgen_metadata.xml index 6263d0a2f..1da98ffce 100644 --- a/modules/vulnerabilities/unix/webapp/wordpress_4x/secgen_metadata.xml +++ b/modules/vulnerabilities/unix/webapp/wordpress_4x/secgen_metadata.xml @@ -56,6 +56,10 @@ + + .*/puppet_module/cron.* + + .*/puppet_module/wordpress diff --git a/scenarios/ctf/access_can_roll.xml b/scenarios/ctf/access_can_roll.xml index b1977ef0c..6a86587ed 100644 --- a/scenarios/ctf/access_can_roll.xml +++ b/scenarios/ctf/access_can_roll.xml @@ -41,7 +41,7 @@ Your password on both systems is: tiaspbiqe2r shared_desktop - + @@ -220,7 +220,7 @@ int main() server - + diff --git a/scenarios/ctf/agent001.xml b/scenarios/ctf/agent001.xml index 6b1cfe29c..8bdd7fdba 100644 --- a/scenarios/ctf/agent001.xml +++ b/scenarios/ctf/agent001.xml @@ -74,7 +74,7 @@ You will need to use a variety of tools and techniques to perform an attack: net evil_server - + diff --git a/scenarios/ctf/eyearesee.xml b/scenarios/ctf/eyearesee.xml index 6d1ef6753..11389949f 100644 --- a/scenarios/ctf/eyearesee.xml +++ b/scenarios/ctf/eyearesee.xml @@ -95,7 +95,7 @@ server - + diff --git a/scenarios/labs/cyber_security_landscape/3_phishing.xml b/scenarios/labs/cyber_security_landscape/3_phishing.xml index fe1ee9fc6..7ae626b56 100644 --- a/scenarios/labs/cyber_security_landscape/3_phishing.xml +++ b/scenarios/labs/cyber_security_landscape/3_phishing.xml @@ -39,7 +39,7 @@ victim_server - + diff --git a/scenarios/labs/cyber_security_landscape/4_encoding_encryption.xml b/scenarios/labs/cyber_security_landscape/4_encoding_encryption.xml index af3483a5a..086b90b0f 100644 --- a/scenarios/labs/cyber_security_landscape/4_encoding_encryption.xml +++ b/scenarios/labs/cyber_security_landscape/4_encoding_encryption.xml @@ -38,7 +38,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/cyber_security_landscape/6_symmetric_enc_aes.xml b/scenarios/labs/cyber_security_landscape/6_symmetric_enc_aes.xml index b164a0ce5..14b5964e0 100644 --- a/scenarios/labs/cyber_security_landscape/6_symmetric_enc_aes.xml +++ b/scenarios/labs/cyber_security_landscape/6_symmetric_enc_aes.xml @@ -35,7 +35,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/cyber_security_landscape/7_asymmetric_enc_rsa.xml b/scenarios/labs/cyber_security_landscape/7_asymmetric_enc_rsa.xml index 1b3b9892a..ee94bd09d 100644 --- a/scenarios/labs/cyber_security_landscape/7_asymmetric_enc_rsa.xml +++ b/scenarios/labs/cyber_security_landscape/7_asymmetric_enc_rsa.xml @@ -40,7 +40,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/forensics/trashed_evidence.xml b/scenarios/labs/forensics/trashed_evidence.xml index 868c3c93b..5a81198ff 100644 --- a/scenarios/labs/forensics/trashed_evidence.xml +++ b/scenarios/labs/forensics/trashed_evidence.xml @@ -54,7 +54,7 @@ seized_desktop - + 172.16.0.2 diff --git a/scenarios/labs/introducing_attacks/1_intro_linux.xml b/scenarios/labs/introducing_attacks/1_intro_linux.xml index 024f829b2..5f6eaeb50 100644 --- a/scenarios/labs/introducing_attacks/1_intro_linux.xml +++ b/scenarios/labs/introducing_attacks/1_intro_linux.xml @@ -36,7 +36,7 @@ Chapter 1 "An Overview of Computer Security": Bishop, M. (2005), Introduction to desktop - + diff --git a/scenarios/labs/introducing_attacks/3_vulnerabilities.xml b/scenarios/labs/introducing_attacks/3_vulnerabilities.xml index f7ee55a06..b80ba4ca0 100644 --- a/scenarios/labs/introducing_attacks/3_vulnerabilities.xml +++ b/scenarios/labs/introducing_attacks/3_vulnerabilities.xml @@ -100,7 +100,7 @@ Throughout this lab, you will gain a deeper understanding of software vulnerabil linux_victim_server - + diff --git a/scenarios/labs/introducing_attacks/5_scanning.xml b/scenarios/labs/introducing_attacks/5_scanning.xml index d5d4f0265..6eef9908d 100644 --- a/scenarios/labs/introducing_attacks/5_scanning.xml +++ b/scenarios/labs/introducing_attacks/5_scanning.xml @@ -39,7 +39,7 @@ This lab provides an in-depth exploration of scanning techniques. You will learn linux_victim_server - + diff --git a/scenarios/labs/introducing_attacks/6_exploitation.xml b/scenarios/labs/introducing_attacks/6_exploitation.xml index b4f17f26c..50b386d0c 100644 --- a/scenarios/labs/introducing_attacks/6_exploitation.xml +++ b/scenarios/labs/introducing_attacks/6_exploitation.xml @@ -100,7 +100,7 @@ In this lab, you will learn how to scan a network for vulnerable servers, use Me linux_server - + diff --git a/scenarios/labs/introducing_attacks/7_post-exploitation.xml b/scenarios/labs/introducing_attacks/7_post-exploitation.xml index 280200746..a86811f33 100644 --- a/scenarios/labs/introducing_attacks/7_post-exploitation.xml +++ b/scenarios/labs/introducing_attacks/7_post-exploitation.xml @@ -97,7 +97,7 @@ You will learn the skills used by an attacker or security tester, to take action linux_server - + diff --git a/scenarios/labs/introducing_attacks/8_vulnerability_analysis.xml b/scenarios/labs/introducing_attacks/8_vulnerability_analysis.xml index e62b52b3f..5d59a1202 100644 --- a/scenarios/labs/introducing_attacks/8_vulnerability_analysis.xml +++ b/scenarios/labs/introducing_attacks/8_vulnerability_analysis.xml @@ -32,7 +32,7 @@ Throughout this lab, you will learn how to use Nmap and its Nmap scripting engin linux_server - + @@ -51,7 +51,7 @@ Throughout this lab, you will learn how to use Nmap and its Nmap scripting engin - + IP_addresses diff --git a/scenarios/labs/response_and_investigation/1_integrity_protection.xml b/scenarios/labs/response_and_investigation/1_integrity_protection.xml index 92e020fed..10ffee403 100644 --- a/scenarios/labs/response_and_investigation/1_integrity_protection.xml +++ b/scenarios/labs/response_and_investigation/1_integrity_protection.xml @@ -53,7 +53,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/response_and_investigation/2_integrity_detection.xml b/scenarios/labs/response_and_investigation/2_integrity_detection.xml index e84631d47..1cbc78001 100644 --- a/scenarios/labs/response_and_investigation/2_integrity_detection.xml +++ b/scenarios/labs/response_and_investigation/2_integrity_detection.xml @@ -70,7 +70,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/response_and_investigation/3_backups_and_recovery.xml b/scenarios/labs/response_and_investigation/3_backups_and_recovery.xml index 1da529002..e06db6991 100644 --- a/scenarios/labs/response_and_investigation/3_backups_and_recovery.xml +++ b/scenarios/labs/response_and_investigation/3_backups_and_recovery.xml @@ -79,7 +79,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/response_and_investigation/4_ids.xml b/scenarios/labs/response_and_investigation/4_ids.xml index 3ce2b920b..36f04f189 100644 --- a/scenarios/labs/response_and_investigation/4_ids.xml +++ b/scenarios/labs/response_and_investigation/4_ids.xml @@ -97,7 +97,7 @@ desktop - + 172.16.0.2 @@ -297,7 +297,7 @@ web_server - + diff --git a/scenarios/labs/response_and_investigation/5_ids_rules.xml b/scenarios/labs/response_and_investigation/5_ids_rules.xml index ef193fdad..888169f33 100644 --- a/scenarios/labs/response_and_investigation/5_ids_rules.xml +++ b/scenarios/labs/response_and_investigation/5_ids_rules.xml @@ -82,7 +82,7 @@ desktop - + 172.16.0.2 @@ -283,7 +283,7 @@ web_server - + diff --git a/scenarios/labs/response_and_investigation/6_exfiltration_detection.xml b/scenarios/labs/response_and_investigation/6_exfiltration_detection.xml index 44caa3f53..09ac9c819 100644 --- a/scenarios/labs/response_and_investigation/6_exfiltration_detection.xml +++ b/scenarios/labs/response_and_investigation/6_exfiltration_detection.xml @@ -66,7 +66,7 @@ desktop - + 172.16.0.2 @@ -290,7 +290,7 @@ web_server - + diff --git a/scenarios/labs/response_and_investigation/7_live_analysis.xml b/scenarios/labs/response_and_investigation/7_live_analysis.xml index 9f92dd92d..1743db32a 100644 --- a/scenarios/labs/response_and_investigation/7_live_analysis.xml +++ b/scenarios/labs/response_and_investigation/7_live_analysis.xml @@ -95,7 +95,7 @@ desktop - + @@ -256,7 +256,7 @@ compromised_server - + diff --git a/scenarios/labs/response_and_investigation/9_siem.xml b/scenarios/labs/response_and_investigation/9_siem.xml index 0a94024ab..4b31820ba 100644 --- a/scenarios/labs/response_and_investigation/9_siem.xml +++ b/scenarios/labs/response_and_investigation/9_siem.xml @@ -292,7 +292,7 @@ desktop - + diff --git a/scenarios/labs/response_and_investigation/hacker_vs_hackerbot_1.xml b/scenarios/labs/response_and_investigation/hacker_vs_hackerbot_1.xml index ad8add97e..862e9989a 100644 --- a/scenarios/labs/response_and_investigation/hacker_vs_hackerbot_1.xml +++ b/scenarios/labs/response_and_investigation/hacker_vs_hackerbot_1.xml @@ -14,7 +14,7 @@ desktop - + 172.16.0.2 @@ -185,7 +185,7 @@ backup_server - + diff --git a/scenarios/labs/response_and_investigation/hacker_vs_hackerbot_2.xml b/scenarios/labs/response_and_investigation/hacker_vs_hackerbot_2.xml index 8ba7f2c2e..9d5d8d6ba 100644 --- a/scenarios/labs/response_and_investigation/hacker_vs_hackerbot_2.xml +++ b/scenarios/labs/response_and_investigation/hacker_vs_hackerbot_2.xml @@ -14,7 +14,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/software_and_malware_analysis/10_anti_sre.xml b/scenarios/labs/software_and_malware_analysis/10_anti_sre.xml index a41210840..07019873c 100644 --- a/scenarios/labs/software_and_malware_analysis/10_anti_sre.xml +++ b/scenarios/labs/software_and_malware_analysis/10_anti_sre.xml @@ -28,7 +28,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/11_coconut.xml b/scenarios/labs/software_and_malware_analysis/11_coconut.xml index 8ad73789e..f3241257f 100644 --- a/scenarios/labs/software_and_malware_analysis/11_coconut.xml +++ b/scenarios/labs/software_and_malware_analysis/11_coconut.xml @@ -25,7 +25,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/software_and_malware_analysis/1_dynamic_and_static_analysis.xml b/scenarios/labs/software_and_malware_analysis/1_dynamic_and_static_analysis.xml index 0433e828d..ab8a19306 100644 --- a/scenarios/labs/software_and_malware_analysis/1_dynamic_and_static_analysis.xml +++ b/scenarios/labs/software_and_malware_analysis/1_dynamic_and_static_analysis.xml @@ -92,7 +92,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/2_intro_to_c.xml b/scenarios/labs/software_and_malware_analysis/2_intro_to_c.xml index 0b1458be1..29341566c 100644 --- a/scenarios/labs/software_and_malware_analysis/2_intro_to_c.xml +++ b/scenarios/labs/software_and_malware_analysis/2_intro_to_c.xml @@ -45,7 +45,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/3_c_and_asm.xml b/scenarios/labs/software_and_malware_analysis/3_c_and_asm.xml index d4e18f603..d7e29f28b 100644 --- a/scenarios/labs/software_and_malware_analysis/3_c_and_asm.xml +++ b/scenarios/labs/software_and_malware_analysis/3_c_and_asm.xml @@ -43,7 +43,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/4_asm.xml b/scenarios/labs/software_and_malware_analysis/4_asm.xml index db83d625d..359a50dd4 100644 --- a/scenarios/labs/software_and_malware_analysis/4_asm.xml +++ b/scenarios/labs/software_and_malware_analysis/4_asm.xml @@ -38,7 +38,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/5_ghidra.xml b/scenarios/labs/software_and_malware_analysis/5_ghidra.xml index 5c4a252c6..e0bbbc342 100644 --- a/scenarios/labs/software_and_malware_analysis/5_ghidra.xml +++ b/scenarios/labs/software_and_malware_analysis/5_ghidra.xml @@ -51,7 +51,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/6_ghidra_analysis.xml b/scenarios/labs/software_and_malware_analysis/6_ghidra_analysis.xml index e5d937aaf..606b53a51 100644 --- a/scenarios/labs/software_and_malware_analysis/6_ghidra_analysis.xml +++ b/scenarios/labs/software_and_malware_analysis/6_ghidra_analysis.xml @@ -25,7 +25,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/6_ghidra_with_live_malware_samples.xml b/scenarios/labs/software_and_malware_analysis/6_ghidra_with_live_malware_samples.xml index e85a9e3ed..51226df12 100644 --- a/scenarios/labs/software_and_malware_analysis/6_ghidra_with_live_malware_samples.xml +++ b/scenarios/labs/software_and_malware_analysis/6_ghidra_with_live_malware_samples.xml @@ -19,7 +19,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/7_dynamic.xml b/scenarios/labs/software_and_malware_analysis/7_dynamic.xml index efc741ee5..70ea41140 100644 --- a/scenarios/labs/software_and_malware_analysis/7_dynamic.xml +++ b/scenarios/labs/software_and_malware_analysis/7_dynamic.xml @@ -40,7 +40,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/8_dynamic_continued.xml b/scenarios/labs/software_and_malware_analysis/8_dynamic_continued.xml index 3c992c8a3..7bbc8fce9 100644 --- a/scenarios/labs/software_and_malware_analysis/8_dynamic_continued.xml +++ b/scenarios/labs/software_and_malware_analysis/8_dynamic_continued.xml @@ -40,7 +40,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/9_malware_behaviour.xml b/scenarios/labs/software_and_malware_analysis/9_malware_behaviour.xml index 7efefe5a2..c2aa81a2e 100644 --- a/scenarios/labs/software_and_malware_analysis/9_malware_behaviour.xml +++ b/scenarios/labs/software_and_malware_analysis/9_malware_behaviour.xml @@ -60,7 +60,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/psu_metactf_angr_symbolic_execution.xml b/scenarios/labs/software_and_malware_analysis/psu_metactf_angr_symbolic_execution.xml index b0ebe0c8f..b21fe84b0 100644 --- a/scenarios/labs/software_and_malware_analysis/psu_metactf_angr_symbolic_execution.xml +++ b/scenarios/labs/software_and_malware_analysis/psu_metactf_angr_symbolic_execution.xml @@ -6,7 +6,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/psu_metactf_computer_systems_programming.xml b/scenarios/labs/software_and_malware_analysis/psu_metactf_computer_systems_programming.xml index bdfb3b32d..51a2b19ed 100644 --- a/scenarios/labs/software_and_malware_analysis/psu_metactf_computer_systems_programming.xml +++ b/scenarios/labs/software_and_malware_analysis/psu_metactf_computer_systems_programming.xml @@ -6,7 +6,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/psu_metactf_malware_analysis.xml b/scenarios/labs/software_and_malware_analysis/psu_metactf_malware_analysis.xml index 1afd95e69..c721a3da7 100644 --- a/scenarios/labs/software_and_malware_analysis/psu_metactf_malware_analysis.xml +++ b/scenarios/labs/software_and_malware_analysis/psu_metactf_malware_analysis.xml @@ -6,7 +6,7 @@ metactf - + diff --git a/scenarios/labs/software_and_malware_analysis/saa_with_ghidra.xml b/scenarios/labs/software_and_malware_analysis/saa_with_ghidra.xml index a0dcc76ba..1efb04e3c 100644 --- a/scenarios/labs/software_and_malware_analysis/saa_with_ghidra.xml +++ b/scenarios/labs/software_and_malware_analysis/saa_with_ghidra.xml @@ -6,7 +6,7 @@ metactf - + diff --git a/scenarios/labs/software_security_exploitation/1_c_asm_iof.xml b/scenarios/labs/software_security_exploitation/1_c_asm_iof.xml index 059ab258a..4224cd300 100644 --- a/scenarios/labs/software_security_exploitation/1_c_asm_iof.xml +++ b/scenarios/labs/software_security_exploitation/1_c_asm_iof.xml @@ -53,7 +53,7 @@ desktop - + diff --git a/scenarios/labs/software_security_exploitation/2_race_conditions_format_str.xml b/scenarios/labs/software_security_exploitation/2_race_conditions_format_str.xml index ef9c74aa4..86b00d028 100644 --- a/scenarios/labs/software_security_exploitation/2_race_conditions_format_str.xml +++ b/scenarios/labs/software_security_exploitation/2_race_conditions_format_str.xml @@ -68,7 +68,7 @@ desktop - + diff --git a/scenarios/labs/software_security_exploitation/3_bug_hunting_and_fuzzing.xml b/scenarios/labs/software_security_exploitation/3_bug_hunting_and_fuzzing.xml index 41e829b0b..67608827c 100644 --- a/scenarios/labs/software_security_exploitation/3_bug_hunting_and_fuzzing.xml +++ b/scenarios/labs/software_security_exploitation/3_bug_hunting_and_fuzzing.xml @@ -139,7 +139,7 @@ desktop - + diff --git a/scenarios/labs/software_security_exploitation/5_linux_stack_bof.xml b/scenarios/labs/software_security_exploitation/5_linux_stack_bof.xml index fafe4bb8f..2dbbdf1d6 100644 --- a/scenarios/labs/software_security_exploitation/5_linux_stack_bof.xml +++ b/scenarios/labs/software_security_exploitation/5_linux_stack_bof.xml @@ -58,7 +58,7 @@ metactf_desktop - + diff --git a/scenarios/labs/software_security_exploitation/6_linux_nx_bypass.xml b/scenarios/labs/software_security_exploitation/6_linux_nx_bypass.xml index 626c94a54..0b1c62cba 100644 --- a/scenarios/labs/software_security_exploitation/6_linux_nx_bypass.xml +++ b/scenarios/labs/software_security_exploitation/6_linux_nx_bypass.xml @@ -48,7 +48,7 @@ metactf_desktop - + diff --git a/scenarios/labs/software_security_exploitation/7_linux_aslr_bypass.xml b/scenarios/labs/software_security_exploitation/7_linux_aslr_bypass.xml index 7795daee4..9804404f9 100644 --- a/scenarios/labs/software_security_exploitation/7_linux_aslr_bypass.xml +++ b/scenarios/labs/software_security_exploitation/7_linux_aslr_bypass.xml @@ -59,7 +59,7 @@ metactf_desktop - + diff --git a/scenarios/labs/software_security_exploitation/8_linux_bof_format.xml b/scenarios/labs/software_security_exploitation/8_linux_bof_format.xml index baeba31f6..7409f8454 100644 --- a/scenarios/labs/software_security_exploitation/8_linux_bof_format.xml +++ b/scenarios/labs/software_security_exploitation/8_linux_bof_format.xml @@ -30,7 +30,7 @@ metactf_desktop - + diff --git a/scenarios/labs/systems_security/1_authentication.xml b/scenarios/labs/systems_security/1_authentication.xml index 437eeec5b..210b4b89d 100644 --- a/scenarios/labs/systems_security/1_authentication.xml +++ b/scenarios/labs/systems_security/1_authentication.xml @@ -100,7 +100,7 @@ desktop - + @@ -281,7 +281,7 @@ server - + diff --git a/scenarios/labs/systems_security/2_pam.xml b/scenarios/labs/systems_security/2_pam.xml index 55f1b7bf9..3784583d6 100644 --- a/scenarios/labs/systems_security/2_pam.xml +++ b/scenarios/labs/systems_security/2_pam.xml @@ -162,7 +162,7 @@ desktop - + @@ -330,7 +330,7 @@ server - + diff --git a/scenarios/labs/systems_security/3_ss_conf.xml b/scenarios/labs/systems_security/3_ss_conf.xml index 34d5eb9c4..818f1eaad 100644 --- a/scenarios/labs/systems_security/3_ss_conf.xml +++ b/scenarios/labs/systems_security/3_ss_conf.xml @@ -14,7 +14,7 @@ developer_desktop - + 172.16.0.2 @@ -104,7 +104,7 @@ server - + @@ -153,7 +153,7 @@ staff_desktop - + @@ -207,7 +207,7 @@ auth_server - + diff --git a/scenarios/labs/systems_security/4_access_controls.xml b/scenarios/labs/systems_security/4_access_controls.xml index ce80a365f..8d2573708 100644 --- a/scenarios/labs/systems_security/4_access_controls.xml +++ b/scenarios/labs/systems_security/4_access_controls.xml @@ -88,7 +88,7 @@ shared_desktop - + @@ -268,7 +268,7 @@ server - + diff --git a/scenarios/labs/systems_security/5_suid.xml b/scenarios/labs/systems_security/5_suid.xml index f0a1052cc..01abdc19f 100644 --- a/scenarios/labs/systems_security/5_suid.xml +++ b/scenarios/labs/systems_security/5_suid.xml @@ -81,7 +81,7 @@ shared_desktop - + @@ -258,7 +258,7 @@ int main() server - + diff --git a/scenarios/labs/systems_security/6_facls.xml b/scenarios/labs/systems_security/6_facls.xml index 087d01539..1d93c2595 100644 --- a/scenarios/labs/systems_security/6_facls.xml +++ b/scenarios/labs/systems_security/6_facls.xml @@ -75,7 +75,7 @@ shared_desktop - + @@ -267,7 +267,7 @@ server - + diff --git a/scenarios/labs/systems_security/7_containers.xml b/scenarios/labs/systems_security/7_containers.xml index 702cbf625..af3588b8c 100644 --- a/scenarios/labs/systems_security/7_containers.xml +++ b/scenarios/labs/systems_security/7_containers.xml @@ -77,7 +77,7 @@ desktop - + 172.16.0.2 @@ -294,7 +294,7 @@ chroot_esc_server - + @@ -335,7 +335,7 @@ docker_esc_server - + diff --git a/scenarios/labs/systems_security/8_apparmor.xml b/scenarios/labs/systems_security/8_apparmor.xml index 89ac7dccc..cea1ea695 100644 --- a/scenarios/labs/systems_security/8_apparmor.xml +++ b/scenarios/labs/systems_security/8_apparmor.xml @@ -69,7 +69,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/web_security/1_intro_web_security.xml b/scenarios/labs/web_security/1_intro_web_security.xml index 23e263c5c..36110216d 100644 --- a/scenarios/labs/web_security/1_intro_web_security.xml +++ b/scenarios/labs/web_security/1_intro_web_security.xml @@ -39,7 +39,7 @@ Throughout this lab, you will learn by doing, actively engaging in activities. A web_server - + diff --git a/scenarios/labs/web_security/2_sessions_and_cookies.xml b/scenarios/labs/web_security/2_sessions_and_cookies.xml index 6079ec21a..3bd7cd416 100644 --- a/scenarios/labs/web_security/2_sessions_and_cookies.xml +++ b/scenarios/labs/web_security/2_sessions_and_cookies.xml @@ -40,7 +40,7 @@ Throughout the lab, you will learn to self-host PHP pages, use OWASP Zap to anal web_server - + diff --git a/scenarios/labs/web_security/3_xss.xml b/scenarios/labs/web_security/3_xss.xml index b5e7b81db..e778441f5 100644 --- a/scenarios/labs/web_security/3_xss.xml +++ b/scenarios/labs/web_security/3_xss.xml @@ -48,7 +48,7 @@ Throughout this lab, you will engage with various learning resources, including web_server - + diff --git a/scenarios/labs/web_security/4_sqli.xml b/scenarios/labs/web_security/4_sqli.xml index f641c0d5f..64d16c2de 100644 --- a/scenarios/labs/web_security/4_sqli.xml +++ b/scenarios/labs/web_security/4_sqli.xml @@ -44,7 +44,7 @@ Throughout this lab, you will engage in a series of tasks across various platfor web_server - + diff --git a/scenarios/labs/web_security/5_sqli_advanced.xml b/scenarios/labs/web_security/5_sqli_advanced.xml index 989b2bba9..9d0eae436 100644 --- a/scenarios/labs/web_security/5_sqli_advanced.xml +++ b/scenarios/labs/web_security/5_sqli_advanced.xml @@ -45,7 +45,7 @@ Throughout the lab, you will engage with various vulnerable environments, includ web_server - + diff --git a/scenarios/labs/web_security/6_csrf.xml b/scenarios/labs/web_security/6_csrf.xml index a3dd994bc..c5ca8d8d6 100644 --- a/scenarios/labs/web_security/6_csrf.xml +++ b/scenarios/labs/web_security/6_csrf.xml @@ -52,7 +52,7 @@ Throughout the lab, you will engage in hands-on tasks that mirror real-world sce web_server - + diff --git a/scenarios/labs/web_security/7_additional_web.xml b/scenarios/labs/web_security/7_additional_web.xml index 848fe81c6..9aac87724 100644 --- a/scenarios/labs/web_security/7_additional_web.xml +++ b/scenarios/labs/web_security/7_additional_web.xml @@ -86,7 +86,7 @@ Web and Network Security additional CTF challenges. web_server - + diff --git a/scenarios/labs/workshops/induction.xml b/scenarios/labs/workshops/induction.xml index 97c134083..bd19e2bf2 100644 --- a/scenarios/labs/workshops/induction.xml +++ b/scenarios/labs/workshops/induction.xml @@ -13,7 +13,7 @@ desktop - + 172.16.0.2 diff --git a/scenarios/labs/workshops/lab_workshop.xml b/scenarios/labs/workshops/lab_workshop.xml index 1116e23d1..264886766 100644 --- a/scenarios/labs/workshops/lab_workshop.xml +++ b/scenarios/labs/workshops/lab_workshop.xml @@ -21,7 +21,7 @@ --> desktop - + 172.16.0.2 @@ -168,7 +168,7 @@ web_server - + diff --git a/scenarios/security_audit/team_project.xml b/scenarios/security_audit/team_project.xml index 32aacd1a4..7c449bcb9 100644 --- a/scenarios/security_audit/team_project.xml +++ b/scenarios/security_audit/team_project.xml @@ -19,7 +19,7 @@ web - + 172.10.0.2 @@ -78,7 +78,7 @@ intranet - + @@ -166,7 +166,7 @@ desktop - + diff --git a/scenarios/security_audit/wns_assessment_onlinestore.xml b/scenarios/security_audit/wns_assessment_onlinestore.xml index 4220077a4..0c57df8ff 100644 --- a/scenarios/security_audit/wns_assessment_onlinestore.xml +++ b/scenarios/security_audit/wns_assessment_onlinestore.xml @@ -7,7 +7,7 @@ web_server - + 172.16.0.2 diff --git a/scenarios/security_audit/wns_assignment.xml b/scenarios/security_audit/wns_assignment.xml index 0505ce04d..0f7c69efe 100644 --- a/scenarios/security_audit/wns_assignment.xml +++ b/scenarios/security_audit/wns_assignment.xml @@ -7,7 +7,7 @@ web_server - + 172.16.0.2