repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
c10l/vagrant-butcher
https://github.com/c10l/vagrant-butcher/blob/169cc1d9deeadae3ffc450d454aa065100617e5d/lib/vagrant-butcher/helpers/key_files.rb
lib/vagrant-butcher/helpers/key_files.rb
require 'fileutils' module Vagrant module Butcher module Helpers module KeyFiles include ::Vagrant::Butcher::Helpers::Guest def cache_dir(env) @cache_dir ||= File.expand_path(File.join(root_path(env), butcher_config(env).cache_dir)) end def guest_key_path(env) @guest_key_path ||= get_guest_key_path(env) end def key_filename(env) @key_filename ||= "#{env[:machine].name}-client.pem" end def client_key_path(env) @client_key_path ||= butcher_config(env).client_key || "#{cache_dir(env)}/#{key_filename(env)}" end def create_cache_dir(env) unless File.exists?(cache_dir(env)) env[:ui].info "Creating #{cache_dir(env)} ..." FileUtils.mkdir_p(cache_dir(env)) end end def grab_key_from_guest(env) create_cache_dir(env) unless windows?(env) machine(env).communicate.execute "chmod 0644 #{guest_key_path(env)}", :sudo => true end machine(env).communicate.download(guest_key_path(env), "#{cache_dir(env)}/#{key_filename(env)}") env[:ui].info "Saved client key to #{cache_dir(env)}/#{key_filename(env)}" end def cleanup_cache_dir(env) unless @failed_deletions key_file = "#{cache_dir(env)}/#{key_filename(env)}" File.delete(key_file) if File.exists?(key_file) Dir.delete(cache_dir(env)) if (Dir.entries(cache_dir(env)) - %w{ . .. }).empty? else env[:ui].warn "#{@failed_deletions} not butchered from the Chef Server. Client key was left at #{client_key_path(env)}" end end def copy_guest_key(env) begin grab_key_from_guest(env) rescue ::Vagrant::Errors::VagrantError => e env[:ui].error "Failed to create #{cache_dir(env)}/#{key_filename(env)}: #{e.class} - #{e}" end end end end end end
ruby
MIT
169cc1d9deeadae3ffc450d454aa065100617e5d
2026-01-04T17:57:07.755956Z
false
c10l/vagrant-butcher
https://github.com/c10l/vagrant-butcher/blob/169cc1d9deeadae3ffc450d454aa065100617e5d/lib/vagrant-butcher/helpers/action.rb
lib/vagrant-butcher/helpers/action.rb
module Vagrant module Butcher module Helpers module Action include Config def machine(env) @machine ||= env[:machine] end def root_path(env) @root_path ||= env[:root_path] end end end end end
ruby
MIT
169cc1d9deeadae3ffc450d454aa065100617e5d
2026-01-04T17:57:07.755956Z
false
c10l/vagrant-butcher
https://github.com/c10l/vagrant-butcher/blob/169cc1d9deeadae3ffc450d454aa065100617e5d/lib/vagrant-butcher/action/cleanup.rb
lib/vagrant-butcher/action/cleanup.rb
module Vagrant module Butcher module Action class Cleanup include ::Vagrant::Butcher::Helpers::Action include ::Vagrant::Butcher::Helpers::Connection def initialize(app, env) @app = app end def call(env) if butcher_config(machine(env)).enabled cleanup(env) else env[:ui].warn "Vagrant::Butcher disabled, not cleaning up Chef server!" end @app.call(env) end end end end end
ruby
MIT
169cc1d9deeadae3ffc450d454aa065100617e5d
2026-01-04T17:57:07.755956Z
false
c10l/vagrant-butcher
https://github.com/c10l/vagrant-butcher/blob/169cc1d9deeadae3ffc450d454aa065100617e5d/lib/vagrant-butcher/action/copy_guest_key.rb
lib/vagrant-butcher/action/copy_guest_key.rb
module Vagrant module Butcher module Action class CopyGuestKey include ::Vagrant::Butcher::Helpers::Action include ::Vagrant::Butcher::Helpers::KeyFiles def initialize(app, env) @app = app end def call(env) begin @app.call(env) ensure copy_guest_key(env) if chef_client?(env) end end end end end end
ruby
MIT
169cc1d9deeadae3ffc450d454aa065100617e5d
2026-01-04T17:57:07.755956Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/install.rb
install.rb
#! /usr/bin/env ruby #-- # Copyright 2004 Austin Ziegler <ruby-install@halostatue.ca> # Install utility. Based on the original installation script for rdoc by the # Pragmatic Programmers. # # This program is free software. It may be redistributed and/or modified under # the terms of the GPL version 2 (or later) or the Ruby licence. # # Usage # ----- # In most cases, if you have a typical project layout, you will need to do # absolutely nothing to make this work for you. This layout is: # # bin/ # executable files -- "commands" # lib/ # the source of the library # # The default behaviour: # 1) Build Rdoc documentation from all files in bin/ (excluding .bat and .cmd), # all .rb files in lib/, ./README, ./ChangeLog, and ./Install. # 2) Build ri documentation from all files in bin/ (excluding .bat and .cmd), # and all .rb files in lib/. This is disabled by default on Microsoft Windows. # 3) Install commands from bin/ into the Ruby bin directory. On Windows, if a # if a corresponding batch file (.bat or .cmd) exists in the bin directory, # it will be copied over as well. Otherwise, a batch file (always .bat) will # be created to run the specified command. # 4) Install all library files ending in .rb from lib/ into Ruby's # site_lib/version directory. # #++ require 'rbconfig' require 'find' require 'fileutils' require 'tempfile' require 'optparse' require 'ostruct' IS_WINDOWS = RUBY_PLATFORM.match?(/(mswin|mingw)/) InstallOptions = OpenStruct.new def glob(list) g = list.map { |i| Dir.glob(i) } g.flatten! g.compact! g end def do_configs(configs, target, strip = 'conf/') Dir.mkdir(target) unless File.directory? target configs.each do |cf| ocf = File.join(InstallOptions.config_dir, cf.gsub(/#{strip}/, '')) FileUtils.install(cf, ocf, mode: 0644, preserve: true, verbose: true) end end def do_bins(bins, target, strip = 's?bin/') Dir.mkdir(target) unless File.directory? target bins.each do |bf| obf = bf.gsub(/#{strip}/, '') install_binfile(bf, obf, target) end end def do_libs(libs, strip = 'lib/') libs.each do |lf| next if File.directory? lf olf = File.join(InstallOptions.site_dir, lf.sub(/^#{strip}/, '')) op = File.dirname(olf) FileUtils.makedirs(op, mode: 0755, verbose: true) FileUtils.chmod(0755, op) FileUtils.install(lf, olf, mode: 0644, preserve: true, verbose: true) end end def do_man(man, strip = 'man/') man.each do |mf| omf = File.join(InstallOptions.man_dir, mf.gsub(/#{strip}/, '')) om = File.dirname(omf) FileUtils.makedirs(om, mode: 0755, verbose: true) FileUtils.chmod(0755, om) FileUtils.install(mf, omf, mode: 0644, preserve: true, verbose: true) %x{gzip --force --no-name #{omf}} end end def do_locales(locale, strip = 'locales/') locale.each do |lf| next if File.directory? lf olf = File.join(InstallOptions.locale_dir, lf.sub(/^#{strip}/, '')) op = File.dirname(olf) FileUtils.makedirs(op, mode: 0755, verbose: true) FileUtils.chmod(0755, op) FileUtils.install(lf, olf, mode: 0644, preserve: true, verbose: true) end end ## # Prepare the file installation. # def prepare_installation InstallOptions.configs = true InstallOptions.batch_files = true ARGV.options do |opts| opts.banner = "Usage: #{File.basename($0)} [options]" opts.separator "" opts.on('--[no-]configs', 'Prevents the installation of config files', 'Default off.') do |ontest| InstallOptions.configs = ontest end opts.on('--destdir[=OPTIONAL]', 'Installation prefix for all targets', 'Default essentially /') do |destdir| InstallOptions.destdir = destdir end opts.on('--configdir[=OPTIONAL]', 'Installation directory for config files', 'Default /etc/puppetlabs/puppet') do |configdir| InstallOptions.configdir = configdir end opts.on('--codedir[=OPTIONAL]', 'Installation directory for code files', 'Default /etc/puppetlabs/code') do |codedir| InstallOptions.codedir = codedir end opts.on('--vardir[=OPTIONAL]', 'Installation directory for var files', 'Default /opt/puppetlabs/puppet/cache') do |vardir| InstallOptions.vardir = vardir end opts.on('--publicdir[=OPTIONAL]', 'Installation directory for public files such as the `last_run_summary.yaml` report', 'Default /opt/puppetlabs/puppet/public') do |publicdir| InstallOptions.publicdir = publicdir end opts.on('--rundir[=OPTIONAL]', 'Installation directory for state files', 'Default /var/run/puppetlabs') do |rundir| InstallOptions.rundir = rundir end opts.on('--logdir[=OPTIONAL]', 'Installation directory for log files', 'Default /var/log/puppetlabs/puppet') do |logdir| InstallOptions.logdir = logdir end opts.on('--bindir[=OPTIONAL]', 'Installation directory for binaries', 'overrides RbConfig::CONFIG["bindir"]') do |bindir| InstallOptions.bindir = bindir end opts.on('--localedir[=OPTIONAL]', 'Installation directory for locale information', 'Default /opt/puppetlabs/puppet/share/locale') do |localedir| InstallOptions.localedir = localedir end opts.on('--ruby[=OPTIONAL]', 'Ruby interpreter to use with installation', 'overrides ruby used to call install.rb') do |ruby| InstallOptions.ruby = ruby end opts.on('--sitelibdir[=OPTIONAL]', 'Installation directory for libraries', 'overrides RbConfig::CONFIG["sitelibdir"]') do |sitelibdir| InstallOptions.sitelibdir = sitelibdir end opts.on('--mandir[=OPTIONAL]', 'Installation directory for man pages', 'overrides RbConfig::CONFIG["mandir"]') do |mandir| InstallOptions.mandir = mandir end opts.on('--no-batch-files', 'Prevents installation of batch files for windows', 'Default off') do |batch_files| InstallOptions.batch_files = false end opts.on('--quick', 'Performs a quick installation. Only the', 'installation is done.') do |quick| InstallOptions.configs = true warn "--quick is deprecated. Use --configs" end opts.separator("") opts.on_tail('--help', "Shows this help text.") do $stderr.puts opts exit end opts.parse! rescue OptionParser::InvalidOption => e $stderr.puts e exit 1 end # Mac OS X 10.5 and higher declare bindir # /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin # which is not generally where people expect executables to be installed # These settings are appropriate defaults for all OS X versions. if RUBY_PLATFORM =~ /^universal-darwin[\d\.]+$/ RbConfig::CONFIG['bindir'] = "/usr/bin" end if not InstallOptions.configdir.nil? configdir = InstallOptions.configdir elsif IS_WINDOWS configdir = File.join(ENV['ALLUSERSPROFILE'], "PuppetLabs", "puppet", "etc") else configdir = "/etc/puppetlabs/puppet" end if not InstallOptions.codedir.nil? codedir = InstallOptions.codedir elsif IS_WINDOWS codedir = File.join(ENV['ALLUSERSPROFILE'], "PuppetLabs", "code") else codedir = "/etc/puppetlabs/code" end if not InstallOptions.vardir.nil? vardir = InstallOptions.vardir elsif IS_WINDOWS vardir = File.join(ENV['ALLUSERSPROFILE'], "PuppetLabs", "puppet", "cache") else vardir = "/opt/puppetlabs/puppet/cache" end if not InstallOptions.publicdir.nil? publicdir = InstallOptions.publicdir elsif IS_WINDOWS publicdir = File.join(ENV['ALLUSERSPROFILE'], "PuppetLabs", "puppet", "public") else publicdir = "/opt/puppetlabs/puppet/public" end if not InstallOptions.rundir.nil? rundir = InstallOptions.rundir elsif IS_WINDOWS rundir = File.join(ENV['ALLUSERSPROFILE'], "PuppetLabs", "puppet", "var", "run") else rundir = "/var/run/puppetlabs" end if not InstallOptions.logdir.nil? logdir = InstallOptions.logdir elsif IS_WINDOWS logdir = File.join(ENV['ALLUSERSPROFILE'], "PuppetLabs", "puppet", "var", "log") else logdir = "/var/log/puppetlabs/puppet" end if not InstallOptions.bindir.nil? bindir = InstallOptions.bindir else bindir = RbConfig::CONFIG['bindir'] end if not InstallOptions.localedir.nil? localedir = InstallOptions.localedir else if IS_WINDOWS localedir = File.join(ENV['PROGRAMFILES'], "Puppet Labs", "Puppet", "puppet", "share", "locale") else localedir = "/opt/puppetlabs/puppet/share/locale" end end if not InstallOptions.sitelibdir.nil? sitelibdir = InstallOptions.sitelibdir else sitelibdir = RbConfig::CONFIG["sitelibdir"] if sitelibdir.nil? sitelibdir = $LOAD_PATH.find { |x| x =~ /site_ruby/ } if sitelibdir.nil? version = [RbConfig::CONFIG["MAJOR"], RbConfig::CONFIG["MINOR"]].join(".") sitelibdir = File.join(RbConfig::CONFIG["libdir"], "ruby", version, "site_ruby") elsif sitelibdir !~ Regexp.quote(version) sitelibdir = File.join(sitelibdir, version) end end end if not InstallOptions.mandir.nil? mandir = InstallOptions.mandir else mandir = RbConfig::CONFIG['mandir'] end # This is the new way forward if not InstallOptions.destdir.nil? destdir = InstallOptions.destdir else destdir = '' end configdir = join(destdir, configdir) codedir = join(destdir, codedir) vardir = join(destdir, vardir) publicdir = join(destdir, publicdir) rundir = join(destdir, rundir) logdir = join(destdir, logdir) bindir = join(destdir, bindir) localedir = join(destdir, localedir) mandir = join(destdir, mandir) sitelibdir = join(destdir, sitelibdir) FileUtils.makedirs(configdir) if InstallOptions.configs FileUtils.makedirs(codedir) FileUtils.makedirs(bindir) FileUtils.makedirs(mandir) FileUtils.makedirs(sitelibdir) FileUtils.makedirs(vardir) FileUtils.makedirs(publicdir) FileUtils.makedirs(rundir) FileUtils.makedirs(logdir) FileUtils.makedirs(localedir) InstallOptions.site_dir = sitelibdir InstallOptions.codedir = codedir InstallOptions.config_dir = configdir InstallOptions.bin_dir = bindir InstallOptions.man_dir = mandir InstallOptions.var_dir = vardir InstallOptions.public_dir = publicdir InstallOptions.run_dir = rundir InstallOptions.log_dir = logdir InstallOptions.locale_dir = localedir end ## # Join two paths. On Windows, dir must be converted to a relative path, # by stripping the drive letter, but only if the basedir is not empty. # def join(basedir, dir) return "#{basedir}#{dir[2..-1]}" if IS_WINDOWS and basedir.length > 0 and dir.length > 2 "#{basedir}#{dir}" end ## # Install file(s) from ./bin to RbConfig::CONFIG['bindir']. Patch it on the way # to insert a #! line; on a Unix install, the command is named as expected # (e.g., bin/rdoc becomes rdoc); the shebang line handles running it. Under # windows, we add an '.rb' extension and let file associations do their stuff. def install_binfile(from, op_file, target) tmp_file = Tempfile.new('puppet-binfile') if not InstallOptions.ruby.nil? ruby = InstallOptions.ruby else ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) end File.open(from) do |ip| File.open(tmp_file.path, "w") do |op| op.puts "#!#{ruby}" unless IS_WINDOWS contents = ip.readlines contents.shift if contents[0] =~ /^#!/ op.write contents.join end end if IS_WINDOWS && InstallOptions.batch_files installed_wrapper = false unless File.extname(from) =~ /\.(cmd|bat)/ if File.exist?("#{from}.bat") FileUtils.install("#{from}.bat", File.join(target, "#{op_file}.bat"), mode: 0755, preserve: true, verbose: true) installed_wrapper = true end if File.exist?("#{from}.cmd") FileUtils.install("#{from}.cmd", File.join(target, "#{op_file}.cmd"), mode: 0755, preserve: true, verbose: true) installed_wrapper = true end if not installed_wrapper tmp_file2 = Tempfile.new('puppet-wrapper') cwv = <<-EOS @echo off SETLOCAL if exist "%~dp0environment.bat" ( call "%~dp0environment.bat" %0 %* ) else ( SET "PATH=%~dp0;%PATH%" ) ruby.exe -S -- puppet %* EOS File.open(tmp_file2.path, "w") { |cw| cw.puts cwv } FileUtils.install(tmp_file2.path, File.join(target, "#{op_file}.bat"), mode: 0755, preserve: true, verbose: true) tmp_file2.unlink end end end FileUtils.install(tmp_file.path, File.join(target, op_file), mode: 0755, preserve: true, verbose: true) tmp_file.unlink end # Change directory into the puppet root so we don't get the wrong files for install. FileUtils.cd File.dirname(__FILE__) do # Set these values to what you want installed. configs = glob(%w{conf/puppet.conf conf/hiera.yaml}) bins = glob(%w{bin/*}) man = glob(%w{man/man[0-9]/*}) libs = glob(%w{lib/**/*}) locales = glob(%w{locales/**/*}) prepare_installation if IS_WINDOWS windows_bins = glob(%w{ext/windows/*bat}) end do_configs(configs, InstallOptions.config_dir) if InstallOptions.configs do_bins(bins, InstallOptions.bin_dir) do_bins(windows_bins, InstallOptions.bin_dir, 'ext/windows/') if IS_WINDOWS && InstallOptions.batch_files do_libs(libs) do_locales(locales) do_man(man) unless IS_WINDOWS end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/rakelib/references/get_typedocs.rb
rakelib/references/get_typedocs.rb
# This script will print the Puppet type docs to stdout in JSON format. # There are some subtleties that make this a pain to run. Basically: Even if you # 'require' a specific copy of the Puppet code, the autoloader will grab bits # and pieces of Puppet code from other copies of Puppet scattered about the Ruby # load path. This causes a mixture of docs from different versions: although I # think the version you require will usually win for things that exist in both # versions, providers or attributes that only exist in one version will leak # through and you'll get an amalgamation. # So the only safe thing to do is run this in a completely separate process, and # ruthlessly control the Ruby load path. We expect that when you're executing # this code, your $RUBYLIB contains the version of Puppet you want to load, and # there are no other versions of Puppet available as gems, installed via system # packages, etc. etc. etc. require 'json' require 'puppet' require 'puppet/util/docs' extend Puppet::Util::Docs # We use scrub(). # The schema of the typedocs object: # { :name_of_type => { # :description => 'Markdown fragment: description of type', # :features => { :feature_name => 'feature description', ... } # # If there are no features, the value of :features will be an empty hash. # :providers => { # If there are no providers, the value of :providers will be an empty hash. # :name_of_provider => { # :description => 'Markdown fragment: docs for this provider', # :features => [:feature_name, :other_feature, ...] # # If provider has no features, the value of :features will be an empty array. # }, # ...etc... # } # :attributes => { # Puppet dictates that there will ALWAYS be at least one attribute. # :name_of_attribute => { # :description => 'Markdown fragment: docs for this attribute', # :kind => (:property || :parameter), # :namevar => (true || false), # always false if :kind => :property # }, # ...etc... # }, # }, # ...etc... # } typedocs = {} Puppet::Type.loadall Puppet::Type.eachtype { |type| # List of types to ignore: next if type.name == :puppet next if type.name == :component next if type.name == :whit # Initialize the documentation object for this type docobject = { :description => scrub(type.doc), :attributes => {} } # Handle features: # inject will return empty hash if type.features is empty. docobject[:features] = type.features.inject( {} ) { |allfeatures, name| allfeatures[name] = scrub( type.provider_feature(name).docs ) allfeatures } # Handle providers: # inject will return empty hash if type.providers is empty. docobject[:providers] = type.providers.inject( {} ) { |allproviders, name| allproviders[name] = { :description => scrub( type.provider(name).doc ), :features => type.provider(name).features } allproviders } # Override several features missing due to bug #18426: if type.name == :user docobject[:providers][:useradd][:features] << :manages_passwords << :manages_password_age << :libuser if docobject[:providers][:openbsd] docobject[:providers][:openbsd][:features] << :manages_passwords << :manages_loginclass end end if type.name == :group docobject[:providers][:groupadd][:features] << :libuser end # Handle properties: docobject[:attributes].merge!( type.validproperties.inject( {} ) { |allproperties, name| property = type.propertybyname(name) raise "Could not retrieve property #{propertyname} on type #{type.name}" unless property description = property.doc $stderr.puts "No docs for property #{name} of #{type.name}" unless description and !description.empty? allproperties[name] = { :description => scrub(description), :kind => :property, :namevar => false # Properties can't be namevars. } allproperties } ) # Handle parameters: docobject[:attributes].merge!( type.parameters.inject( {} ) { |allparameters, name| description = type.paramdoc(name) $stderr.puts "No docs for parameter #{name} of #{type.name}" unless description and !description.empty? # Strip off the too-huge provider list. The question of what to do about # providers is a decision for the formatter, not the fragment collector. description = description.split('Available providers are')[0] if name == :provider allparameters[name] = { :description => scrub(description), :kind => :parameter, :namevar => type.key_attributes.include?(name) # returns a boolean } allparameters } ) # Finally: typedocs[type.name] = docobject } print JSON.dump(typedocs)
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/util/binary_search_specs.rb
util/binary_search_specs.rb
#!/usr/bin/env ruby # Author: Nick Lewis specs_in_order = File.read('spec_order.txt').split failing_spec = ARGV.first specs = specs_in_order[0...specs_in_order.index(failing_spec)] suspects = specs while suspects.length > 1 do count = suspects.length specs_to_run = suspects[0...(count/2)] puts "Trying #{specs_to_run.join(' ')}" start = Time.now system("bundle exec rspec #{specs_to_run.join(' ')} #{failing_spec}") puts "Finished in #{Time.now - start} seconds" if $? == 0 puts "This group is innocent. The culprit is in the other half." suspects = suspects[(count/2)..-1] else puts "One of these is guilty." suspects = specs_to_run end end puts "The culprit is #{suspects.first}"
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/util/puppet_facts_output.rb
packaging/acceptance/util/puppet_facts_output.rb
test_name "get facts, obfuscate, and save to a local file for uploading to facterdb" do FACTS_OVERRIDE = { 'dmi' => { 'product' => { 'serial_number' => 'VMware-99 ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff' } }, 'ssh' => { 'dsa' => { 'fingerprints' => { 'sha1' => 'SSHFP 2 1 b51c7675469cb52bfa624e54bafe3ef3252f18a8', 'sha256' => 'SSHFP 2 2 8ad3dee51616eea1922c7d0c386003564fc81a7b3c9719eda81d41fc3a1a81ce' }, 'key' => 'AAAAB3NzaC1kc3MAAACBAJllU17cVy4GEZpRPZq8ad2I/j6U01ymbbhtbGqlySh7bRujid3GeIDNODgwrySQWb0L8elE4QPy48zffzO55K3wysQR/sJr5SJASihkgiLN0EzYo/yDK1pyGsm9XvAmDV1y1NOkRqJud2Pg+big4t7VXHRldKffUDOr96YR1Ye9AAAAFQCSePSAGpYs3pRdqNuieYYa2Nl44QAAAIAzX0iwS3rqTOLkAl0qpgYFsd3a68dwgKK4ZixnI0L/MEB1ij1V95LHXSM18/zuwMMspkvYAMXMZQbWjvio7e7T/nh8ZMX2FUUD5tKWzkKZoCkaZK+AS/EmfUCr9C1mZF4lLK/hNKHCMUeX8dBqJyV6WvFc5UoF86OYwiNDIp7g7QAAAIAKEHm8BcZdnml4eiFTtJkgd+CYL96WlVhzYZ2sCO9iltWlcpushnOYPg95z8bIqgNR2/0Y7eB3WlxF79oJRQD4AXABqd/qAnEVmKT89EO4VHGHQrNCGfOmh+kGLJEkTrMxilLX1MABw5zUaXcSxoLDUbEOIWkYisCZzCYaZWnUYQ==', 'type' => 'ssh-dss' }, 'ecdsa' => { 'fingerprints' => { 'sha1' => 'SSHFP 3 1 e5b5956a90381025744364c6a5e583dc241dccea', 'sha256' => 'SSHFP 3 2 15cb5a64a36ac9e2922181a428d128d00746ff780c4d719d208f74365cee26d6' }, 'key' => 'AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPdGax2c3kNpf74zdu49dYPOKETTb6+2cr4Nsd+cTGXA4/gEH0nTjsBaKpQQYOHXqWCACwhoe7GmsGgpPMnVEgs=', 'type' => 'ecdsa-sha2-nistp256' }, 'ed25519' => { 'fingerprints' => { 'sha1' => 'SSHFP 4 1 dce8023eb0e3df834f18a61c63fb47df815a5613', 'sha256' => 'SSHFP 4 2 b4db91f2762a3e6df8e626a91deff44199069e435d4e994811f7d8845c65c4b1' }, 'key' => 'AAAAC3NzaC1lZDI1NTE5AAAAILn7Z73yMs5fRZLbo719JS6XB3GucAI7Z3xA7w80SVBA', 'type' => 'ssh-ed25519' }, 'rsa' => { 'fingerprints' => { 'sha1' => 'SSHFP 1 1 8a0a9734d3d00ef801b7ff97f93360d9e53bc96b', 'sha256' => 'SSHFP 1 2 62d70febba163aa40af1ad445c4083cce852c09ebc03216303ed8d15bd42a617' }, 'key' => 'AAAAB3NzaC1yc2EAAAADAQABAAABgQDGWL5DqPcs0nXR2VzOE7QAIxWKcCWihE3p2J8QYsRBYpEIBJvC2pXtmxd5SmPX7ZAAqmM0txtmzhxUsudPOhvsygGQiOuEvSZb1YrlP6G/t+Kq3VvAzS5NeQvmkL4vqXXRqfRGrgXjcv2EV7bCePgWo7Fhk6XsS7QwiCjhkiSaAOP2KeZN52dQt9g6TJnMf8ooi1liNSBjwTBpo4ACIhbuZpzEtoNnamXVOYgmGC2bhasYMgoQf8G6ArDKB+aVEz/mJu3g93vlKCrwfYAZXwXmlnyz5Wex2HBU9Cpag6ONWKrOpK/rWxgA67AhMW/DUNAG6CBUbZdTKbh0JXDCS4O9KxD4h3cBTu3/UcfV6b87KiaAZO6Ald7VLLkG3SZxOCUgDTu+Y946pt36/faVb/zX7B71wvQTHs24tVjyVWl6uh9JFUTIAW7ch34KjqzmZi21t14BoOKEqaUVoTjYWlzMumsR9GSitUB/0071lFpk0nfLKK3m913PIQPL8/se63U=', 'type' => 'ssh-rsa' } }, 'networking' => { 'dhcp' => '10.16.8.13', 'ip' => '10.160.8.13', 'ip6' => 'fe80::225f:adad:bcd0:1f75', 'mac' => '2c:54:91:88:c9:e3', 'network' => '10.160.8.0', 'network6' => 'fe80::' }, 'hypervisors' => { 'vmware' => { } } } # Recursively merge two hashes, merging the second into the first. # Only keys present in both hashes will be overridden by the second hash. # # Example: # first = {:a=>{:b=>"c", :d=>"e"}} # second = {:a=>{:b=>"d", :e=>"f"}, :foo=>"bar"} # # deep_merge_if_key(first, second) #=> {:a=>{:b=>"d", :d=>"e"}} def deep_merge_if_key(first, second) merger = proc do |key, v1, v2| if Hash === v1 && Hash === v2 v2.empty? ? v2 : v1.merge(v2.select { |k| v1.keys.include?(k) }, &merger) elsif Array === v1 && Array === v2 [v1, v2].flatten .compact .group_by { |v| v[:key] } .values .map { |e| e.reduce(&:merge) } else v2 end end first.merge(second.select { |k| first.keys.include?(k) }, &merger) end # Add additional overrides to the FACTS_OVERRIDE constant, consisting of # legacy facts and primary network-related facts, then return the constructed # fact hash. def build_override_facts(primary_network) facts_override = FACTS_OVERRIDE facts_override['serialnumber'] = facts_override['dmi']['product']['serial_number'] ['dsa', 'ecdsa', 'ed25519', 'rsa'].each do |key| facts_override["ssh#{key}key"] = facts_override['ssh'][key]['key'] facts_override["sshfp_#{key}"] = facts_override['ssh'][key]['fingerprints']['sha1'] + "\n" + facts_override['ssh'][key]['fingerprints']['sha256'] end facts_override['networking']['interfaces'] = {} facts_override['networking']['interfaces'][primary_network] = facts_override['networking'] facts_override['networking']['interfaces'][primary_network]['bindings'] = [{}] facts_override['networking']['interfaces'][primary_network]['bindings'].first['address'] = facts_override['networking']['ip'] facts_override['networking']['interfaces'][primary_network]['bindings'].first['network'] = facts_override['networking']['network'] facts_override['networking']['interfaces'][primary_network]['bindings6'] = [{}] facts_override['networking']['interfaces'][primary_network]['bindings6'].first['address'] = facts_override['networking']['ip6'] facts_override['networking']['interfaces'][primary_network]['bindings6'].first['network'] = facts_override['networking']['network6'] facts_override['ipaddress'] = facts_override['networking']['ip'] facts_override['ipaddress6'] = facts_override['networking']['ip6'] facts_override["ipaddress_#{primary_network}"] = facts_override['networking']['ip'] facts_override["ipaddress6_#{primary_network}"] = facts_override['networking']['ip6'] facts_override['macaddress'] = facts_override['networking']['mac'] facts_override["macaddress_#{primary_network}"] = facts_override['networking']['mac'] facts_override['network'] = facts_override['networking']['network'] facts_override["network_#{primary_network}"] = facts_override['networking']['network'] facts_override["network6_#{primary_network}"] = facts_override['networking']['network6'] facts_override['dhcp_servers'] = {} facts_override['dhcp_servers'][primary_network] = facts_override['networking']['dhcp'] facts_override['dhcp_servers']['system'] = facts_override['networking']['dhcp'] facts_override end # Given a fact hash, return a facterdb-compliant filepath. # # Example: 4.2.6/centos-8-x86_64.facts def filename_from_facts(facts) facterversion = facts['facterversion'] osname = facts['operatingsystem'].downcase osrelease = facts['operatingsystemmajrelease'] arch = facts['hardwaremodel'] File.join(facterversion, "#{osname}-#{osrelease}-#{arch}.facts") end agents.each do |agent| on(agent, facter('--show-legacy -p -j'), :acceptable_exit_codes => [0]) do |result| facts = JSON.parse(result.stdout) facter_major_version = facts['facterversion'] primary_network = facts['networking']['primary'] override_facts = build_override_facts(primary_network) final_facts = deep_merge_if_key(facts, override_facts) # save locally file_path = File.expand_path(File.join('output', 'facts', filename_from_facts(final_facts))) FileUtils.mkdir_p(File.dirname(file_path)) File.write(file_path, JSON.pretty_generate(final_facts)) end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/augeas_validation.rb
packaging/acceptance/tests/augeas_validation.rb
skip_test 'non-windows only test' if hosts.any? { |host| host.platform =~ /windows/ } tag 'audit:high' test_name 'Augeas Validation' do teardown do hosts.each do |agent| file = <<-EOF augeas { 'test_ssh': lens => 'Ssh.lns', incl => '/etc/ssh/ssh_config', context => '/files/etc/ssh/ssh_config', changes => [ 'remove Host testing.testville.nil' ] } EOF on(agent, "puppet apply -e \"#{file}\"") end end hosts.each do |agent| step 'validate Augeas binary' do on(agent, '/opt/puppetlabs/puppet/bin/augtool --version') end step 'validate we can apply a resource type augeas' do file = <<-EOF augeas { 'test_ssh': lens => 'Ssh.lns', incl => '/etc/ssh/ssh_config', context => '/files/etc/ssh/ssh_config', changes => [ 'set Host testing.testville.nil' ] } EOF on(agent, "puppet apply -e \"#{file}\" --detailed-exitcodes", acceptable_exit_codes: [2]) end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_simple_custom_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_simple_custom_fact.rb
test_name 'Ensure Facter values usage for simple xustom fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_facts_dir = File.join(foo_module_dir, 'lib', 'facter') step 'create module directories' do agent.mkdir_p(foo_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create simple custom fact' do create_remote_file(agent, File.join(foo_facts_dir, "my_fizz_fact.rb"), <<-FILE) Facter.add(:fizz) do setcode do 'buzz' end end FILE end step 'check that custom fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"fizz\"])'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"fizz\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"fizz\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.fizz\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/validate_vendored_modules.rb
packaging/acceptance/tests/validate_vendored_modules.rb
def vendor_modules_path(host) case host['platform'] when /windows/ "'C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\vendor_modules;C:\\Program Files (x86)\\Puppet Labs\\Puppet\\puppet\\vendor_modules'" else '/opt/puppetlabs/puppet/vendor_modules/' end end test_name "PA-1998: Validate that vendored modules are installed" do step "'module list' lists the vendored modules and reports no missing dependencies" do agents.each do |agent| vendor_modules = vendor_modules_path(agent) on(agent, puppet("module --modulepath=#{vendor_modules} list")) do |result| refute_empty(result.stdout.strip, "Expected to find vendor modules in #{vendor_modules}, but the directory did not exist") refute_match(/no modules installed/i, result.stdout, "Expected to find vendor modules in #{vendor_modules}, but the directory was empty") refute_match(/Missing dependency/i, result.stderr, "Some vendored module dependencies are missing in #{vendor_modules}") end end end step "`describe --list` lists vendored module types" do vendored_types = %w[ augeas cron host mount scheduled_task selboolean selmodule ssh_authorized_key sshkey yumrepo zfs zone zpool ] agents.each do |agent| on(agent, puppet("describe --modulepath=#{vendor_modules_path(agent)} --list")) do |result| vendored_types.each do |type| assert_match(/#{type}/, result.stdout, "Vendored module type `#{type}` didn't appear in the list of known types") end end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_dotted_external_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_dotted_external_fact.rb
test_name 'Ensure Facter values usage for dotted external fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_facts_dir = File.join(foo_module_dir, 'facts.d') step 'create module directories' do agent.mkdir_p(foo_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create simple external fact' do create_remote_file(agent, File.join(foo_facts_dir, "my_fizz_fact.txt"),'f.i.z.z=buzz') end step 'check that external fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"f.i.z.z\"])'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"f.i.z.z\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"\\\"f.i.z.z\\\"\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that external fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.\\\"f.i.z.z\\\"\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/module_install.rb
packaging/acceptance/tests/module_install.rb
test_name 'PA-3125: make sure we can install a forge module' do tag 'audit:high', 'audit:acceptance' require 'puppet/acceptance/common_utils' module_name = "puppetlabs/mailalias_core" agents.each do |agent| need_to_uninstall = false teardown do on agent, puppet("module", "uninstall", "--force", module_name) if need_to_uninstall end step "test we can install puppetlabs/mailalias_core forge module" do on agent, puppet("module", "install", module_name) do |result| need_to_uninstall = true unless result.stdout =~ /Module .* is already installed./ end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_external_overrides_custom.rb
packaging/acceptance/tests/ensure_facter_values_for_external_overrides_custom.rb
test_name 'Ensure Facter values usage for external fact overriding custom fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_custom_facts_dir = File.join(foo_module_dir, 'lib', 'facter') foo_external_facts_dir = File.join(foo_module_dir, 'facts.d') step 'create module directories' do agent.mkdir_p(foo_custom_facts_dir) agent.mkdir_p(foo_external_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create external and custom fact' do create_remote_file(agent, File.join(foo_custom_facts_dir, "my_fizz_fact.rb"), <<-FILE) Facter.add(:fizz) do setcode do 'custom_fact_buzz' end end FILE create_remote_file(agent, File.join(foo_external_facts_dir, "my_fizz_fact.txt"),'fizz=external_fact_buzz') end step 'check that external fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"fizz\"])'") do |output| assert_match(/Notice: .*: external_fact_buzz/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"fizz\"))'") do |output| assert_match(/Notice: .*: external_fact_buzz/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"fizz\"))'") do |output| assert_match(/Notice: .*: external_fact_buzz/, output.stdout) end end step 'check that external fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.fizz\"))'") do |output| assert_match(/Notice: .*: external_fact_buzz/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_SCL_python_pip_works.rb
packaging/acceptance/tests/ensure_SCL_python_pip_works.rb
test_name 'PUP-8351: Ensure pip provider works with RHSCL python' do confine :to, :platform => /centos-(6|7)-x86_64/ tag 'audit:medium', 'audit:acceptance' teardown do on agent, 'yum remove python27-python-pip -y' end step 'install and enable RHSCL python' do on agent, 'yum install centos-release-scl -y' on agent, 'yum install python27-python-pip -y' end step 'With with the SCL python enabled: Attempt \'resource package\' with a python package and the pip provider' do on(agent, 'source /opt/rh/python27/enable && puppet resource package vulture ensure=present provider=\'pip\'') end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_command_can_be_executed.rb
packaging/acceptance/tests/ensure_facter_command_can_be_executed.rb
test_name 'Ensure facter command can be executed' do require 'puppet/acceptance/common_utils' agents.each do |agent| step "test facter command" do facter = agent['platform'] =~ /win/ ? 'cmd /c facter' : 'facter' on agent, "#{facter} --version", :acceptable_exit_codes => [0] end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/test_manpage_clobber.rb
packaging/acceptance/tests/test_manpage_clobber.rb
test_name 'PA-2768: Extend manpath instead of overriding it' do tag 'audit:low', 'audit:acceptance' # shellpath scripts are only installed on linux, however macos knows how to find # man directories relative to the existing path confine :except, :platform => ['windows', 'aix', 'solaris'] agents.each do |agent| man_command = nil step 'test for man command' do on(agent, 'command -v man', :acceptable_exit_codes => [0, 1]) do |result| man_command = result.stdout.chomp end end skip_test "man command not found on #{agent.hostname} (#{agent.platform})" unless man_command step 'test if we have puppet manpages' do on(agent, "#{man_command} puppet") end step 'test if we have unix manpages' do on(agent, "#{man_command} ls") end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_custom_overrides_core_dotted_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_custom_overrides_core_dotted_fact.rb
test_name 'Ensure Facter values usage for custom fact overriding core dotted fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_custom_facts_dir = File.join(foo_module_dir, 'lib', 'facter') initial_ruby_version = on(agent, facter("ruby.version")).stdout.chomp step 'create module directories' do agent.mkdir_p(foo_custom_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'custom fact' do create_remote_file(agent, File.join(foo_custom_facts_dir, "my_fizz_fact.rb"), <<-FILE) Facter.add('ruby.version') do has_weight 10001 setcode do '1.1.1' end end FILE end step 'check that custom fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"ruby.version\"])'") do |output| assert_match(/Notice: .*: 1.1.1/, output.stdout) end end step 'check that previous value is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"ruby\"][\"version\"])'") do |output| assert_match(/Notice: .*: #{initial_ruby_version}/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"ruby.version\"))'") do |output| assert_match(/Notice: .*: 1.1.1/, output.stdout) end end step 'check that previous value is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"ruby\", \"version\"))'") do |output| assert_match(/Notice: .*: #{initial_ruby_version}/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"\\\"ruby.version\\\"\"))'") do |output| assert_match(/Notice: .*: 1.1.1/, output.stdout) end end step 'check that previous value is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"ruby.version\"))'") do |output| assert_match(/Notice: .*: #{initial_ruby_version}/, output.stdout) end end step 'check that custom fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.\\\"ruby.version\\\"\"))'") do |output| assert_match(/Notice: .*: 1.1.1/, output.stdout) end end step 'check that previous value is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.ruby.version\"))'") do |output| assert_match(/Notice: .*: #{initial_ruby_version}/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/selinux.rb
packaging/acceptance/tests/selinux.rb
test_name 'PA-3067: Manage selinux' do tag 'audit:high', 'audit:acceptance' confine :to, :platform => /el-|fedora-|debian-|ubuntu-/ confine :except, :platform => /el-6/ require 'puppet/acceptance/common_utils' agents.each do |agent| step "test require 'selinux'" on agent, "#{ruby_command(agent)} -e 'require \"selinux\"'" end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_external_overrides_core_dotted_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_external_overrides_core_dotted_fact.rb
test_name 'Ensure Facter values usage for external fact overriding core dotted fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_external_facts_dir = File.join(foo_module_dir, 'facts.d') step 'create module directories' do agent.mkdir_p(foo_external_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create external and custom fact' do create_remote_file(agent, File.join(foo_external_facts_dir, "my_fizz_fact.txt"),'ruby.version=1.1.1') end step 'check that external fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"ruby.version\"])'") do |output| assert_match(/Notice: .*: 1.1.1/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"ruby.version\"))'") do |output| assert_match(/Notice: .*: 1.1.1/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"\\\"ruby.version\\\"\"))'") do |output| assert_match(/Notice: .*: 1.1.1/, output.stdout) end end step 'check that external fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.\\\"ruby.version\\\"\"))'") do |output| assert_match(/Notice: .*: 1.1.1/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/puppet_facts.rb
packaging/acceptance/tests/puppet_facts.rb
# Verify that -p loads external and custom facts from puppet locations test_name "C14783: puppet facts show loads facts from puppet" do tag 'audit:high' agents.each do |agent| external_dir = agent.puppet['pluginfactdest'] external_file = File.join(external_dir, "external.txt") custom_dir = File.join(agent.puppet['plugindest'], "facter") custom_file = File.join(custom_dir, 'custom.rb') teardown do agent.rm_rf(external_file) agent.rm_rf(custom_dir) end step "Agent #{agent}: create external fact" do agent.mkdir_p(external_dir) create_remote_file(agent, external_file, "external=external") end step "Agent #{agent}: create custom fact" do agent.mkdir_p(custom_dir) create_remote_file(agent, custom_file, "Facter.add(:custom) { setcode { 'custom' } }") end step "Agent #{agent}: verify facts" do on(agent, puppet("facts show external")) do |puppet_output| assert_match(/"external": "external"/, puppet_output.stdout.chomp) end on(agent, puppet("facts show custom")) do |puppet_output| assert_match(/"custom": "custom"/, puppet_output.stdout.chomp) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_external_overrides_custom_overrides_core_top_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_external_overrides_custom_overrides_core_top_fact.rb
test_name 'Ensure Facter values usage for external fact overriding custom and core top fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_custom_facts_dir = File.join(foo_module_dir, 'lib', 'facter') foo_external_facts_dir = File.join(foo_module_dir, 'facts.d') custom_ruby_value = '{"version": "1.1.1"}' external_ruby_value = '{"version": "0.0.0"}' step 'create module directories' do agent.mkdir_p(foo_custom_facts_dir) agent.mkdir_p(foo_external_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create external and custom fact' do create_remote_file(agent, File.join(foo_custom_facts_dir, "my_fizz_fact.rb"), <<-FILE) Facter.add('ruby') do has_weight(999) setcode do '#{custom_ruby_value}' end end FILE create_remote_file(agent, File.join(foo_external_facts_dir, "my_fizz_fact.txt"),"ruby=#{external_ruby_value}") end step 'check that json custom fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"ruby\"])'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that json custom fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"ruby\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that json custom fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"ruby\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that json custom fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.ruby\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that json custom fact is interpreted as text' do on agent, puppet("apply -e 'notice(\$facts[\"ruby\"][\"version\"])'") , acceptable_exit_codes: [1] do |output| refute_match(/Notice: .*: 1.1.1/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_custom_overrides_core_top_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_custom_overrides_core_top_fact.rb
test_name 'Ensure Facter values usage for custom fact overriding core top fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_custom_facts_dir = File.join(foo_module_dir, 'lib', 'facter') custom_ruby_value = '{"version": "1.1.1"}' step 'create module directories' do agent.mkdir_p(foo_custom_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create external and custom fact' do create_remote_file(agent, File.join(foo_custom_facts_dir, "ruby.rb"), <<-FILE) Facter.add('ruby') do has_weight(999) setcode do '#{custom_ruby_value}' end end FILE end step 'check that custom fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"ruby\"])'") do |output| assert_match(/Notice: .*: #{custom_ruby_value}/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"ruby\"))'") do |output| assert_match(/Notice: .*: #{custom_ruby_value}/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"ruby\"))'") do |output| assert_match(/Notice: .*: #{custom_ruby_value}/, output.stdout) end end step 'check that custom fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.ruby\"))'") do |output| assert_match(/Notice: .*: #{custom_ruby_value}/, output.stdout) end end step 'check that json custom fact is interpreted as text' do on agent, puppet("apply -e 'notice(\$facts[\"ruby\"][\"version\"])'") , acceptable_exit_codes: [1] do |output| refute_match(/Notice: .*: 1.1.1/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_puppet_facts_can_use_facter.rb
packaging/acceptance/tests/ensure_puppet_facts_can_use_facter.rb
test_name 'Ensure puppet facts can use facter' do require 'puppet/acceptance/common_utils' agents.each do |agent| step 'test puppet facts with correct facter version' do on(agent, puppet('facts'), :acceptable_exit_codes => [0]) do |result| facter_major_version = Integer(JSON.parse(result.stdout)["facterversion"].split('.').first) assert(5 >= facter_major_version, "wrong facter version") end end step "test puppet facts with facter has all the dependencies installed" do on(agent, puppet('facts --debug'), :acceptable_exit_codes => [0]) do |result| if agent['platform'] =~ /win/ # exclude augeas as it is not provided on Windows unresolved_fact = result.stdout.match(/(resolving fact (?!augeas).+\, but)/) else unresolved_fact = result.stdout.match(/(resolving fact .+\, but)/) end assert_nil(unresolved_fact, "missing dependency for facter from: #{unresolved_fact.inspect}") end end step "test that stderr is empty on puppet facts'" do on(agent, puppet('facts'), :acceptable_exit_codes => [0]) do |result| assert_empty(result.stderr, "Expected `puppet facts` stderr to be empty") end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/env_windows_installdir_fact.rb
packaging/acceptance/tests/env_windows_installdir_fact.rb
# (PA-466) The env_windows_installdir fact is set as an environment variable # fact via environment.bat on Windows systems. Test to ensure it is both # present and accurate. test_name 'PA-466: Ensure env_windows_installdir fact is present and correct' do tag 'audit:high', # PE and modules rely on this fact in order to execute ruby, curl, etc 'audit:acceptance' confine :to, :platform => 'windows' require 'json' agents.each do |agent| step "test for presence/accuracy of fact on #{agent}" do platform = agent[:platform] ruby_arch = agent[:ruby_arch] || 'x86' # ruby_arch defaults to x86 if nil install_dir = platform =~ /-64$/ && ruby_arch == 'x86' ? "C:\\Program Files (x86)\\Puppet Labs\\Puppet" : "C:\\Program Files\\Puppet Labs\\Puppet" on agent, puppet('facts', '--render-as json') do |result| facts = JSON.parse(result.stdout) actual_value = facts["env_windows_installdir"] assert_equal(install_dir, actual_value, "env_windows_installdir fact did not match expected output") end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/validate_vendored_openssl.rb
packaging/acceptance/tests/validate_vendored_openssl.rb
require 'puppet/acceptance/temp_file_utils' test_name 'Validate openssl version and fips' do extend Puppet::Acceptance::TempFileUtils tag 'audit:high' def openssl_command(host) puts "privatebindir=#{host['privatebindir']}" "env PATH=\"#{host['privatebindir']}:${PATH}\" openssl" end def create_bat_wrapper(host, file, command) tempfile = get_test_file_path(agent, file) create_remote_file(agent, tempfile, command) "cmd /c $(cygpath -w #{tempfile})" end agents.each do |agent| openssl = openssl_command(agent) step "check openssl version" do on(agent, "#{openssl} version -v") do |result| assert_match(/^OpenSSL 3\./, result.stdout) end end if agent['template'] =~ /fips/ step "check fips_enabled fact" do on(agent, facter("fips_enabled")) do |result| assert_match(/^true/, result.stdout) end end step "check openssl providers" do if agent['template'] =~ /^win/ list_command = create_bat_wrapper(agent, "list_providers.bat", <<~END) call "C:\\Program Files\\Puppet Labs\\Puppet\\bin\\environment.bat" %0 %* openssl list -providers END else list_command = "#{openssl} list -providers" end on(agent, list_command) do |result| assert_match(Regexp.new(<<~END, Regexp::MULTILINE), result.stdout) \s*fips \s*name: OpenSSL FIPS Provider \s*version: 3.0.9 \s*status: active END end end step "check fipsmodule.cnf" do if agent['template'] =~ /^win/ verify_command = create_bat_wrapper(agent, "verify_fips.bat", <<~END) call "C:\\Program Files\\Puppet Labs\\Puppet\\bin\\environment.bat" %0 %* openssl fipsinstall -module "%OPENSSL_MODULES%\\fips.dll" -provider_name fips -in "%OPENSSL_CONF_INCLUDE%\\fipsmodule.cnf" -verify END else verify_command = "#{openssl} fipsinstall -module /opt/puppetlabs/puppet/lib/ossl-modules/fips.so -provider_name fips -in /opt/puppetlabs/puppet/ssl/fipsmodule.cnf -verify" end on(agent, verify_command) do |result| assert_match(/VERIFY PASSED/, result.stderr) end end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_json_external_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_json_external_fact.rb
test_name 'Ensure Facter values usage for json external fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_facts_dir = File.join(foo_module_dir, 'facts.d') step 'create module directories' do agent.mkdir_p(foo_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create simple external fact' do create_remote_file(agent, File.join(foo_facts_dir, "my_fizz_fact.txt"),'fizz={"bizz": "buzz"}') end step 'check that json external fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"fizz\"])'") do |output| assert_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json external fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"fizz\"))'") do |output| assert_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json external fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"fizz\"))'") do |output| assert_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json external fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.fizz\"))'") do |output| assert_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json external fact key is not visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"fizz.buzz\"])'") do |output| refute_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json external fact key is not visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"fizz.buzz\"))'") do |output| refute_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json external fact key is not visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"fizz.buzz\"))'"), acceptable_exit_codes: [1] do |output| refute_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json external fact key is not visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.fizz.buzz\"))'"), acceptable_exit_codes: [1] do |output| refute_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_json_custom_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_json_custom_fact.rb
test_name 'Ensure Facter values usage for json custom fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_facts_dir = File.join(foo_module_dir, 'lib', 'facter') step 'create module directories' do agent.mkdir_p(foo_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create simple external fact' do create_remote_file(agent, File.join(foo_facts_dir, "my_fizz_fact.rb"), <<-FILE) Facter.add(:fizz) do setcode do '{"bizz": "buzz"}' end end FILE end step 'check that json custom fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"fizz\"])'") do |output| assert_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json custom fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"fizz\"))'") do |output| assert_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json custom fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"fizz\"))'") do |output| assert_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json custom fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.fizz\"))'") do |output| assert_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json custom fact key is not visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"fizz.buzz\"])'") do |output| refute_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json custom fact key is not visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"fizz.buzz\"))'") do |output| refute_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json custom fact key is not visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"fizz.buzz\"))'"), acceptable_exit_codes: [1] do |output| refute_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end step 'check that json custom fact key is not visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.fizz.buzz\"))'"), acceptable_exit_codes: [1] do |output| refute_match(/Notice: .*: {"bizz": "buzz"}/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_external_overrides_custom_overrides_core_dotted_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_external_overrides_custom_overrides_core_dotted_fact.rb
test_name 'Ensure Facter values usage for external fact overriding custom and core dotted fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_custom_facts_dir = File.join(foo_module_dir, 'lib', 'facter') foo_external_facts_dir = File.join(foo_module_dir, 'facts.d') custom_ruby_value = '1.1.1' external_ruby_value = '0.0.0' step 'create module directories' do agent.mkdir_p(foo_custom_facts_dir) agent.mkdir_p(foo_external_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create external and custom fact' do create_remote_file(agent, File.join(foo_custom_facts_dir, "my_fizz_fact.rb"), <<-FILE) Facter.add('ruby.version') do setcode do '#{custom_ruby_value}' end end FILE create_remote_file(agent, File.join(foo_external_facts_dir, "my_fizz_fact.txt"),"ruby.version=#{external_ruby_value}") end step 'check that external fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"ruby.version\"])'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"ruby.version\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"\\\"ruby.version\\\"\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that external fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.\\\"ruby.version\\\"\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_puppet-agent_paths.rb
packaging/acceptance/tests/ensure_puppet-agent_paths.rb
# ensure installs and code honor new puppet-agent path spec: # https://github.com/puppetlabs/puppet-specifications/blob/master/file_paths.md test_name 'PUP-4033: Ensure aio path spec is honored' tag 'audit:high', 'audit:acceptance', 'audit:refactor' # move to puppet-agent acceptance require 'puppet/acceptance/common_utils' extend Puppet::Acceptance::CommandUtils # include file_exists? require 'puppet/acceptance/temp_file_utils' extend Puppet::Acceptance::TempFileUtils def config_options(agent) platform = agent[:platform] case platform when /windows/ common_app_data = 'C:/ProgramData' puppetlabs_data = "#{common_app_data}/PuppetLabs" codedir = "#{puppetlabs_data}/code" confdir = "#{puppetlabs_data}/puppet/etc" vardir = "#{puppetlabs_data}/puppet/cache" publicdir = "#{puppetlabs_data}/puppet/public" logdir = "#{puppetlabs_data}/puppet/var/log" rundir = "#{puppetlabs_data}/puppet/var/run" facterdir = "#{puppetlabs_data}/facter" sep = ";" module_working_dir = on(agent, "#{ruby_command(agent)} -e 'require \"tmpdir\"; print Dir.tmpdir'").stdout.chomp else codedir = '/etc/puppetlabs/code' confdir = '/etc/puppetlabs/puppet' vardir = '/opt/puppetlabs/puppet/cache' publicdir = '/opt/puppetlabs/puppet/public' logdir = '/var/log/puppetlabs/puppet' rundir = '/var/run/puppetlabs' facterdir = "/opt/puppetlabs/facter" sep = ":" module_working_dir = "#{vardir}/puppet-module" end [ # code {:name => :codedir, :expected => codedir, :installed => :dir}, {:name => :environmentpath, :expected => "#{codedir}/environments"}, # confdir {:name => :confdir, :expected => confdir, :installed => :dir}, {:name => :autosign, :expected => "#{confdir}/autosign.conf"}, {:name => :binder_config, :expected => ""}, {:name => :csr_attributes, :expected => "#{confdir}/csr_attributes.yaml"}, {:name => :trusted_oid_mapping_file, :expected => "#{confdir}/custom_trusted_oid_mapping.yaml"}, {:name => :deviceconfig, :expected => "#{confdir}/device.conf"}, {:name => :fileserverconfig, :expected => "#{confdir}/fileserver.conf"}, {:name => :config, :expected => "#{confdir}/puppet.conf", :installed => :file}, {:name => :route_file, :expected => "#{confdir}/routes.yaml"}, {:name => :ssldir, :expected => "#{confdir}/ssl", :installed => :dir}, {:name => :hiera_config, :expected => "#{confdir}/hiera.yaml"}, # vardir {:name => :vardir, :expected => "#{vardir}", :installed => :dir}, {:name => :bucketdir, :expected => "#{vardir}/bucket"}, {:name => :devicedir, :expected => "#{vardir}/devices"}, {:name => :pluginfactdest, :expected => "#{vardir}/facts.d", :installed => :dir}, {:name => :libdir, :expected => "#{vardir}/lib", :installed => :dir}, {:name => :factpath, :expected => "#{vardir}/lib/facter#{sep}#{vardir}/facts", :not_path => true}, {:name => :module_working_dir, :expected => module_working_dir}, {:name => :reportdir, :expected => "#{vardir}/reports"}, {:name => :server_datadir, :expected => "#{vardir}/server_data"}, {:name => :statedir, :expected => "#{vardir}/state", :installed => :dir}, {:name => :yamldir, :expected => "#{vardir}/yaml"}, # logdir/rundir {:name => :logdir, :expected => logdir, :installed => :dir}, {:name => :rundir, :expected => rundir, :installed => :dir}, {:name => :pidfile, :expected => "#{rundir}/agent.pid"}, # publicdir {:name => :publicdir, :expected => publicdir, :installed => :dir}, #non-Puppet config dirs {:name => :facter_factsdir, :expected => "#{facterdir}/facts.d", :installed => :dir, :not_puppet_config => true}, ] end step 'test configprint outputs' agents.each do |agent| on(agent, puppet_agent('--configprint all')) do |result| config_options(agent).select {|v| !v[:not_puppet_config] }.each do |config_option| assert_match("#{config_option[:name]} = #{config_option[:expected]}", result.stdout) end end end step 'test puppet genconfig entries' agents.each do |agent| on(agent, puppet_agent('--genconfig')) do |result| config_options(agent).select {|v| !v[:not_puppet_config] }.each do |config_option| assert_match("#{config_option[:name]} = #{config_option[:expected]}", result.stdout) end end end step 'test puppet agent paths exist' agents.each do |agent| config_options(agent).select {|v| !v[:not_path] }.each do |config_option| path = config_option[:expected] case config_option[:installed] when :dir if !dir_exists?(agent, path) fail_test("Failed to find expected directory '#{path}' on agent '#{agent}'") end when :file if !file_exists?(agent, path) fail_test("Failed to find expected file '#{path}' on agent '#{agent}'") end end end end public_binaries = { :posix => ['puppet', 'facter'], :win => ['puppet.bat', 'facter.bat'] } def locations(platform, ruby_arch, type) if type == 'foss' return '/usr/bin' end case platform when /windows/ # If undefined, ruby_arch defaults to x86 if ruby_arch == 'x64' ruby_arch = /-64/ else ruby_arch = /-32/ end if platform =~ ruby_arch return 'C:/Program Files/Puppet Labs/Puppet/bin' else return 'C:/Program Files (x86)/Puppet Labs/Puppet/bin' end else return '/opt/puppetlabs/bin' end end step 'test puppet binaries exist' agents.each do |agent| dir = locations(agent[:platform], agent[:ruby_arch], @options[:type]) os = agent['platform'] =~ /windows/ ? :win : :posix file_type = (@options[:type] == 'git' || os == :win) ? :binary : :symlink public_binaries[os].each do |binary| path = File.join(dir, binary) case file_type when :binary if !file_exists?(agent, path) fail_test("Failed to find expected binary '#{path}' on agent '#{agent}'") end when :symlink if !link_exists?(agent, path) fail_test("Failed to find expected symbolic link '#{path}' on agent '#{agent}'") end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ffi.rb
packaging/acceptance/tests/ffi.rb
test_name 'FFI can be required' do tag 'audit:low', 'audit:acceptance' require 'puppet/acceptance/common_utils' agents.each do |agent| step "test require 'ffi'" on agent, "#{ruby_command(agent)} -e 'require \"ffi\"'" end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_dotted_custom_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_dotted_custom_fact.rb
test_name 'Ensure Facter values usage for dotted custom fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_facts_dir = File.join(foo_module_dir, 'lib', 'facter') step 'create module directories' do agent.mkdir_p(foo_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create simple custom fact' do create_remote_file(agent, File.join(foo_facts_dir, "my_fizz_fact.rb"), <<-FILE) Facter.add('f.i.z.z') do setcode do 'buzz' end end FILE end step 'check that custom fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"f.i.z.z\"])'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"f.i.z.z\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"\\\"f.i.z.z\\\"\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.\\\"f.i.z.z\\\"\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/file_permissions.rb
packaging/acceptance/tests/file_permissions.rb
# SDDL Decoder Ring # # O:SY => owner system # G:SY => group system # D: => DACL # Flags # P => protected # AI => automatic inheritance has been computed # ACES (ace1)(ace2)... # Type # A => allow # Inheritance Flags # OI => object inherit (affects child files) # CI => container inherit (affects child directories) # ID => inherited from a parent # Access Right # FA => file all 0x1f01ff # 0x1200a9 => file read (0x00120089) | file execute (0x001200A0) # Trustee SID # SY => system # BA => builtin local admins # WD => world (everyone) # script = <<-'SCRIPT' $SDDL_DIR_ADMIN_ONLY = "O:SYG:SYD:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)" $SDDL_FILE_ADMIN_ONLY = "O:SYG:SYD:AI(A;ID;FA;;;SY)(A;ID;FA;;;BA)" $SDDL_DIR_INHERITED_ADMIN_ONLY = "O:SYG:SYD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)" $SDDL_DIR_EVERYONE = "O:SYG:SYD:P(A;OICI;0x1200a9;;;WD)(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)" function Compare-Sddl { param ( [String]$Path, [String]$Expected ) $acl = Get-Acl $Path if ($acl.Sddl -eq $Expected) { Write-Host "Path $($Path) matched $($Expected)" } else { Write-Host "Security Descriptor does not match!" Write-Host "Actual:" Write-Host "Path: $($Path)" Write-Host "Sddl: $($acl.Sddl)" Write-Host "Protected: $($acl.AreAccessRulesProtected)" Write-Host "Owner: $($acl.Owner)" Write-Host "Group: $($acl.Group)" Write-Host "DACL:" Write-Host $acl.AccessToString Write-Host Write-Host "Expected:" Write-Host $Expected exit(1) } } # Make sure public directories allow everyone read & execute Compare-Sddl -Path C:\ProgramData\PuppetLabs\ -Expected $SDDL_DIR_EVERYONE Compare-Sddl -Path C:\ProgramData\PuppetLabs\facter -Expected $SDDL_DIR_EVERYONE # Make sure sensitive directories restrict permissions Compare-Sddl -Path C:\ProgramData\PuppetLabs\code -Expected $SDDL_DIR_ADMIN_ONLY Compare-Sddl -Path C:\ProgramData\PuppetLabs\puppet -Expected $SDDL_DIR_ADMIN_ONLY Compare-Sddl -Path C:\ProgramData\PuppetLabs\pxp-agent -Expected $SDDL_DIR_ADMIN_ONLY # Make sure directory and file created by packaging inherit from parent Compare-Sddl -Path C:\ProgramData\PuppetLabs\code\environments\production -Expected $SDDL_DIR_INHERITED_ADMIN_ONLY Compare-Sddl -Path C:\ProgramData\PuppetLabs\code\environments\production\environment.conf -Expected $SDDL_FILE_ADMIN_ONLY # Ensure we didn't miss anything, Exclude doesn't work right on 2008r2 $expected=@("facter","code","puppet","pxp-agent"); $children = Get-ChildItem -Path C:\ProgramData\PuppetLabs if ($children.Length -ne $expected.Length) { $unexpected = Compare-Object -ReferenceObject $children -DifferenceObject $expected $files = $unexpected -Join "," Write-Host "Unexpected files: $($files)" exit(1) } SCRIPT test_name 'PA-2019: Verify file permissions' do skip_test 'requires version file which is created by AIO' if [:gem, :git].include?(@options[:type]) agents.each do |agent| next if agent.platform !~ /windows/ execute_powershell_script_on(agent, script) end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/linker_variable_cleanup.rb
packaging/acceptance/tests/linker_variable_cleanup.rb
require 'puppet/acceptance/common_utils' extend Puppet::Acceptance::CommandUtils confine :except, :platform => 'windows' def libsource(host) kernel = on(host, facter("kernel")).stdout.chomp.downcase arch = on(host, facter("architecture")).stdout.chomp.downcase case kernel when "linux" case arch when "x86_64", "amd64" "libexplode.so.linux64" when "i386" "libexplode.so.linux32" else nil end when "aix" "libexplode.so.aix" when "sunos" case arch when "i86sol" "libexplode.so.solaris" else nil end else nil end end def libdest(host) kernel = on(host, facter("kernel")).stdout.chomp.downcase case kernel when "aix" "libruby.so" when "sunos" "libm.so.2" else "libm.so.6" end end test_name 'PA-437: cleanup linker environment' do skip_test 'requires wrapper script which is created by the AIO' if [:gem, :git].include?(@options[:type]) fixtures = File.dirname(__FILE__) + "/../fixtures/dyld/" dirs = {} libs = {} step "Lay down a crashing library on the SUT" do agents.each do |agent| source = libsource(agent) if source == nil then libs[agent] = nil dirs[agent] = nil next end dirs[agent] = agent.tmpdir("lib") + "/" libs[agent] = dirs[agent] + libdest(agent) fixture = fixtures + source scp_to(agent, fixture, libs[agent]) end end teardown do agents.each do |agent| next if dirs[agent] == nil on agent, "rm -rf #{dirs[agent]}" end end step "Put the crashing library on the load path" do agents.each do |agent| next if dirs[agent] == nil kernel = on(agent, facter("kernel")).stdout.downcase.strip var = case kernel when "aix" "LIBPATH" else "LD_LIBRARY_PATH" end on agent, puppet("--version"), :environment => { var => dirs[agent] } end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_custom_overrides_external.rb
packaging/acceptance/tests/ensure_facter_values_for_custom_overrides_external.rb
test_name 'Ensure Facter values usage custom fact overriding external fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_custom_facts_dir = File.join(foo_module_dir, 'lib', 'facter') foo_external_facts_dir = File.join(foo_module_dir, 'facts.d') step 'create module directories' do agent.mkdir_p(foo_custom_facts_dir) agent.mkdir_p(foo_external_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create external and custom fact' do create_remote_file(agent, File.join(foo_custom_facts_dir, "my_fizz_fact.rb"), <<-FILE) Facter.add(:fizz) do has_weight 10001 setcode do 'custom_fact_buzz' end end FILE create_remote_file(agent, File.join(foo_external_facts_dir, "my_fizz_fact.txt"),'fizz=external_fact_buzz') end step 'check that custom fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"fizz\"])'") do |output| assert_match(/Notice: .*: custom_fact_buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"fizz\"))'") do |output| assert_match(/Notice: .*: custom_fact_buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"fizz\"))'") do |output| assert_match(/Notice: .*: custom_fact_buzz/, output.stdout) end end step 'check that custom fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.fizz\"))'") do |output| assert_match(/Notice: .*: custom_fact_buzz/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_simple_external_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_simple_external_fact.rb
test_name 'Ensure Facter values usage for simple external fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_facts_dir = File.join(foo_module_dir, 'facts.d') step 'create module directories' do agent.mkdir_p(foo_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create simple external fact' do create_remote_file(agent, File.join(foo_facts_dir, "my_fizz_fact.txt"),'fizz=buzz') end step 'check that external fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"fizz\"])'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"fizz\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"fizz\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end step 'check that external fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.fizz\"))'") do |output| assert_match(/Notice: .*: buzz/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/validate_vendored_ruby.rb
packaging/acceptance/tests/validate_vendored_ruby.rb
require 'puppet/acceptance/common_utils.rb' require 'puppet/acceptance/temp_file_utils' extend Puppet::Acceptance::CommandUtils def package_installer(agent) # for some reason, beaker does not have a configured package installer # for AIX so we manually set up the package installer for it. if agent['platform'] =~ /aix/ lambda { |package| on(agent, "rm -f `basename #{package}` && curl -O #{package} && rpm -Uvh `basename #{package}`") } else lambda { |package| agent.install_package(package) } end end def setup_build_environment(agent) # We set the gem path for install here to our internal shared vendor # path. This allows us to verify that our Ruby is able to read from # this path when listing / loading gems in the test below. # The sqlite3 gem >= 1.5.0 bundles libsqlite3, which breaks some tests # We add `--enable-system-libraries` to use system libsqlite3 gem_install_sqlite3 = "env GEM_HOME=/opt/puppetlabs/puppet/lib/ruby/vendor_gems " + gem_command(agent) + " install sqlite3 -- --enable-system-libraries" install_package_on_agent = package_installer(agent) rubygems_version = agent['platform'] =~ /aix-7\.2/ ? '3.4.22' : '' on(agent, "#{gem_command(agent)} update --system #{rubygems_version}") case agent['platform'] when /aix/ # sed on AIX does not support in place edits or delete on(agent, "sed '/\"warnflags\"/d' /opt/puppetlabs/puppet/lib/ruby/3.2.0/powerpc-aix7.2.0.0/rbconfig.rb > no_warnflags_rbconfig.rb") on(agent, "cp no_warnflags_rbconfig.rb /opt/puppetlabs/puppet/lib/ruby/3.2.0/powerpc-aix7.2.0.0/rbconfig.rb") # use pl-build-tools' gcc on AIX machines gem_install_sqlite3 = "export PATH=\"/opt/pl-build-tools/bin:$PATH\" && #{gem_install_sqlite3}" when /solaris-11(.4|)-i386/ # We need to install a newer compiler to build native extensions, # so we use a newer GCC from OpenCSW vanagon_noask_contents = "mail=\n"\ "instance=overwrite\n"\ "partial=nocheck\n"\ "runlevel=nocheck\n"\ "idepend=nocheck\n"\ "rdepend=nocheck\n"\ "space=quit\n"\ "setuid=nocheck\n"\ "conflict=nocheck\n"\ "action=nocheck\n"\ "basedir=default" vanagon_noask_path = "/var/tmp/vanagon-noask" on(agent, "echo \"#{vanagon_noask_contents}\" > #{vanagon_noask_path}") vanagon_pkgutil_contents = "mirror=https://artifactory.delivery.puppetlabs.net/artifactory/generic__remote_opencsw_mirror/testing" vanagon_pkgutil_path = "/var/tmp/vanagon-pkgutil.conf" on(agent, "echo \"#{vanagon_pkgutil_contents}\" > #{vanagon_pkgutil_path}") on(agent, 'pkgadd -n -a /var/tmp/vanagon-noask -d http://get.opencsw.org/now all') on(agent, '/opt/csw/bin/pkgutil --config=/var/tmp/vanagon-pkgutil.conf -y -i gcc5core') gem_install_sqlite3 = "export PATH=\"/opt/csw/bin:$PATH\" && #{gem_install_sqlite3}" when /solaris-11-sparc/ install_package_on_agent.call("developer/gcc-48") gem_install_sqlite3 = "export PATH=\"/usr/gcc/4.8/bin:$PATH\" && #{gem_install_sqlite3}" end gem_install_sqlite3 end def install_dependencies(agent) return if agent['platform'] =~ /macos|solaris-11|sparc/ install_package_on_agent = package_installer(agent) dependencies = { 'apt-get' => ['gcc', 'make', 'libsqlite3-dev'], 'yum' => ['gcc', 'make', 'sqlite-devel'], 'zypper' => ['gcc', 'sqlite3-devel'], 'opt/csw/bin/pkgutil' => ['sqlite3', 'libsqlite3_dev'], 'rpm' => [ 'http://pl-build-tools.delivery.puppetlabs.net/aix/6.1/ppc/pl-gcc-5.2.0-11.aix6.1.ppc.rpm', 'http://osmirror.delivery.puppetlabs.net/AIX_MIRROR/pkg-config-0.19-6.aix5.2.ppc.rpm', 'http://osmirror.delivery.puppetlabs.net/AIX_MIRROR/info-4.6-1.aix5.1.ppc.rpm', 'https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/buildsources/readline-7.0-3.aix5.1.ppc.rpm', 'https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/buildsources/readline-devel-7.0-3.aix5.1.ppc.rpm', 'https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/buildsources/sqlite-3.20.0-1.aix5.1.ppc.rpm', 'https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/buildsources/sqlite-devel-3.20.0-1.aix5.1.ppc.rpm' ] } provider = dependencies.keys.find do |_provider| result = on(agent, "which #{_provider}", :accept_all_exit_codes => true) # the `which` command on Solaris returns a 0 exit code even when the file # does not exist agent['platform'] =~ /solaris/ ? result.stdout.chomp !~ /no #{_provider}/ : result.exit_code.zero? end providers = dependencies.keys.join(', ') assert(provider, "The agent does not have one of #{providers} as its package provider") dependencies[provider].each do |dependency| install_package_on_agent.call(dependency) end end test_name 'PA-1319: Validate that the vendored ruby can load gems and is configured correctly' do step "'gem list' displays a decent list of gems" do minimum_number_of_gems = 3 # \d+\.\d+\.\d+ describes the gem version gem_re = /[\w-]+ \(\d+\.\d+\.\d+(?:, \d+\.\d+\.\d+)*\)/ agents.each do |agent| gem = gem_command(agent) listed_gems = on(agent, "#{gem} list").stdout.chomp.scan(gem_re) assert(listed_gems.size >= minimum_number_of_gems, "'gem list' fails to list the available gems (i.e., the rubygems environment is not sane)") end end step "vendored ruby successfully loads gems" do agents.each do |agent| irb = irb_command(agent) ['hocon', 'deep_merge', 'puppet/resource_api'].each do |gem| if agent['platform'] =~ /windows*/ # Although beaker can set a PATH for puppet-agent on Windows, it isn't # able to set up the environment for the purpose of loading gems this # way; See BKR-1445 and BKR-986. As a workaround, run the environment # script before requiring the gem. We're using `ruby -r` instead of # irb here because `cmd /c` will only run one argument command before # returning to cygwin (additional arguments will be treated as bash) # and using irb introduces too many quotes. cmd = "env PATH=\"#{agent['privatebindir']}:${PATH}\" cmd /c \"environment.bat && ruby -r#{gem} -e 'puts true'\"" stdout = on(agent, cmd).stdout.chomp assert_match(/true/, stdout, "ruby failed to require the #{gem} gem") else stdout = on(agent, "echo \"require '#{gem}'\" | #{irb}").stdout.chomp assert_match(/true/, stdout, "'irb' failed to require the #{gem} gem") end end end end step "'gem install' successfully installs a gem with native extensions" do agents_to_skip = select_hosts({:platform => [/windows/, /cisco/, /eos/, /cumulus/, /aix-7.3-power/]}, agents) agents_to_test = agents - agents_to_skip agents_to_test.each do |agent| gem_install_sqlite3 = setup_build_environment(agent) # Upgrade the AlmaLinux release package for newer keys until our image is updated (RE-16096) on(agent, 'dnf -y upgrade almalinux-release') if on(agent, facter('os.name')).stdout.strip == 'AlmaLinux' install_dependencies(agent) on(agent, gem_install_sqlite3) gem = gem_command(agent) listed_gems = on(agent, "#{gem} list").stdout.chomp assert_match(/sqlite3/, listed_gems, "'gem install' failed to build the sqlite3 gem") end end step "'gem update --system' keeps vendor_gems still in path" do agents_to_skip = select_hosts({:platform => [/windows/, /cisco/, /eos/, /cumulus/]}, agents) agents_to_test = agents - agents_to_skip agents_to_test.each do |agent| rubygems_version = agent['platform'] =~ /aix-7\.2/ ? '3.4.22' : '' on(agent, "/opt/puppetlabs/puppet/bin/gem update --system #{rubygems_version}") list_env = on(agent, "/opt/puppetlabs/puppet/bin/gem env").stdout.chomp unless list_env.include?("/opt/puppetlabs/puppet/lib/ruby/vendor_gems") fail_test("Failed to keep vendor_gems directory in GEM_PATH!") end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_facter_values_for_external_overrides_core_top_fact.rb
packaging/acceptance/tests/ensure_facter_values_for_external_overrides_core_top_fact.rb
test_name 'Ensure Facter values usage for external fact overriding core top fact' do agents.each do |agent| output = on agent, puppet('config print modulepath') if agent.platform =~ /windows/ delimiter = ';' else delimiter = ':' end module_path = output.stdout.split(delimiter)[0] foo_module_dir = File.join(module_path, 'foo') foo_external_facts_dir = File.join(foo_module_dir, 'facts.d') external_ruby_value = '{"version": "1.1.1"}' step 'create module directories' do agent.mkdir_p(foo_external_facts_dir) end teardown do agent.rm_rf(foo_module_dir) end step 'create external and custom fact' do create_remote_file(agent, File.join(foo_external_facts_dir, "my_fizz_fact.txt"),"ruby=#{external_ruby_value}") end step 'check that external fact is visible to puppet in $facts' do on agent, puppet("apply -e 'notice(\$facts[\"ruby\"])'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.dig' do on agent, puppet("apply -e 'notice(\$facts.dig(\"ruby\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that external fact is visible to puppet in $facts.get' do on agent, puppet("apply -e 'notice(\$facts.get(\"ruby\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that external fact is visible to puppet in getvar' do on agent, puppet("apply -e 'notice(getvar(\"facts.ruby\"))'") do |output| assert_match(/Notice: .*: #{external_ruby_value}/, output.stdout) end end step 'check that external json fact is interpreted as text' do on agent, puppet("apply -e 'notice(\$facts[\"ruby\"][\"version\"])'") , acceptable_exit_codes: [1] do |output| refute_match(/Notice: .*: 1.1.1/, output.stdout) end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_macos_executables_are_signed.rb
packaging/acceptance/tests/ensure_macos_executables_are_signed.rb
test_name 'Ensure puppet executables are codesigned on mac OS' do confine :to, :platform => /macos/ tag 'audit:high' agents.each do |agent| [ '/opt/puppetlabs/bin/puppet', '/opt/puppetlabs/puppet/bin/puppet', '/opt/puppetlabs/puppet/bin/pxp-agent', '/opt/puppetlabs/puppet/bin/wrapper.sh' ].each do |path| step "test #{path}" do on(agent, "codesign -vv #{path}") do |result| output = result.output assert_match(/valid on disk/, output) assert_match(/satisfies its Designated Requirement/, output) end end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/ensure_version_file.rb
packaging/acceptance/tests/ensure_version_file.rb
require 'puppet/acceptance/temp_file_utils' extend Puppet::Acceptance::TempFileUtils # ensure a version file is created according to the puppet-agent path specification: # https://github.com/puppetlabs/puppet-specifications/blob/master/file_paths.md test_name 'PA-466: Ensure version file is created on agent' do skip_test 'requires version file which is created by AIO' if [:gem, :git].include?(@options[:type]) step "test for existence of version file" do agents.each do |agent| platform = agent[:platform] ruby_arch = agent[:ruby_arch] || 'x86' # ruby_arch defaults to x86 if nil if platform =~ /windows/ version_file = platform =~ /-64$/ && ruby_arch == 'x86' ? "C:/Program Files (x86)/Puppet Labs/Puppet/VERSION" : "C:/Program Files/Puppet Labs/Puppet/VERSION" else version_file = "/opt/puppetlabs/puppet/VERSION" end if !file_exists?(agent, version_file) fail_test("Failed to find version file #{version_file} on agent #{agent}") end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/tests/windows_eventlog.rb
packaging/acceptance/tests/windows_eventlog.rb
test_name "Write to Windows eventlog" tag 'audit:medium', # core feature, high impact, but low risk 'audit:refactor', # Use block style `test_name` 'audit:acceptance' # unclear if this is an important packaging level feature # test (warrants acceptance level) that wouldn't also be # caught by other test (perhaps combine with other tests), # or if the functionality is assumed by other acceptance tests # (then this test can be deleted), or if packaging can be # assumed and the logging functionality can be tested at the # integration level. confine :to, :platform => 'windows' require 'puppet/acceptance/common_utils' extend Puppet::Acceptance::CommandUtils agents.each do |agent| # get remote time # https://msdn.microsoft.com/en-us/library/aa394226(v=vs.85).aspx # set Microsecond and time zone offset both to 0 now = on(agent, "#{ruby_command(agent)} -e \"puts Time.now.utc.strftime('%Y%m%d%H%M%S.000000-000')\"").stdout.chomp # generate an error, no master on windows boxes # we use `agent` because it creates an eventlog log destination by default, # whereas `apply` does not. on(agent, puppet('agent', '--server', '127.0.0.1', '--test'), :acceptable_exit_codes => [1]) # make sure there's a Puppet error message in the log # cygwin + ssh + wmic hangs trying to read stdin, so echo '' | on(agent, "cmd /c echo '' | wmic ntevent where \"LogFile='Application' and SourceName='Puppet' and TimeWritten >= '#{now}'\" get Message,Type /format:csv") do |result| fail_test "Event not found in Application event log" unless result.stdout.include?('target machine actively refused it. - connect(2) for "127.0.0.1"') end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/teardown/common/099_Archive_Logs.rb
packaging/acceptance/teardown/common/099_Archive_Logs.rb
require 'date' def file_glob(host, path) result = on(host, "ls #{path}", :acceptable_exit_codes => [0, 2]) return [] if result.exit_code != 0 return result.stdout.strip.split("\n") end # This test is prefixed with zzz so it will hopefully run last. test_name 'Backup puppet logs and app data on all hosts' do today = Date.today().to_s # truncate the job name so it only has the name-y part and no parameters job_name = (ENV['JOB_NAME'] || 'unknown_jenkins_job') .sub(/[A-Z0-9_]+=.*$/, '') .gsub(/[\/,.]/, '_')[0..200] archive_name = "#{job_name}__#{ENV['BUILD_ID']}__#{today}__sut-files.tgz" archive_root = "SUT_#{today}" hosts.each do |host| step("Capturing log errors for #{host}") do case host[:platform] when /windows/ # on Windows, all of the desired data (including logs) is in the data dir puppetlabs_data = 'C:/ProgramData/PuppetLabs' archive_file_from(host, puppetlabs_data, {}, archive_root, archive_name) # Note: Windows `ls` uses absolute paths for all matches when an absolute path is supplied. tempdir = 'C:/Windows/TEMP' file_glob(host, File.join(tempdir, 'install-puppet-*.log')).each do |install_log| archive_file_from(host, install_log, {}, archive_root, archive_name) end file_glob(host, File.join(tempdir, 'puppet-*-installer.log')).each do |install_log| archive_file_from(host, install_log, {}, archive_root, archive_name) end else puppetlabs_logdir = '/var/log/puppetlabs' grep_for_alerts = if host[:platform] =~ /solaris/ "egrep -i 'warn|error|fatal'" elsif host[:platform] =~ /aix/ "grep -iE -B5 -A10 'warn|error|fatal'" else "grep -i -B5 -A10 'warn\\|error\\|fatal'" end ## If there are any PL logs, try to echo all warning, error, and fatal ## messages from all PL logs to the job's output on(host, <<-GREP_FOR_ALERTS, :accept_all_exit_codes => true ) if [ -d #{puppetlabs_logdir} ] && [ -n "$(find #{puppetlabs_logdir} -name '*.log*')" ]; then for log in $(find #{puppetlabs_logdir} -name '*.log*'); do # grep /dev/null only to get grep to print filenames, since -H is not in POSIX spec for grep #{grep_for_alerts} $log /dev/null; echo "" done fi GREP_FOR_ALERTS step("Archiving logs for #{host} into #{archive_name} (muzzling everything but :warn or higher beaker logs...)") do ## turn the logger off to avoid getting hundreds of lines of scp progress output previous_level = @logger.log_level @logger.log_level = :warn pxp_cache = '/opt/puppetlabs/pxp-agent/spool' puppetlabs_data = '/etc/puppetlabs' version_lookup_result = on(host, "cat /opt/puppetlabs/puppet/VERSION", :accept_all_exit_codes => true) # If we can't find a VERSION file, chances are puppet wasn't # installed and these paths aren't present. Beaker's # archive_file_from() will fail if it can't find the file, and we # want to proceed... if version_lookup_result.exit_code == 0 agent_version = version_lookup_result.output.strip archive_file_from(host, pxp_cache, {}, archive_root, archive_name) unless version_is_less(agent_version, "1.3.2") archive_file_from(host, puppetlabs_data, {}, archive_root, archive_name) archive_file_from(host, puppetlabs_logdir, {}, archive_root, archive_name) end syslog_dir = '/var/log' syslog_name = 'messages' if host[:platform] =~ /ubuntu|debian/ syslog_name = 'syslog' elsif host[:platform] =~ /solaris/ syslog_dir = '/var/adm' # Next few lines are for debugging POOLER-200, once that is resolved this can be removed @logger.log_level = previous_level on(host, 'egrep -i \'reboot after panic\' /var/adm/messages', :acceptable_exit_codes => [0,1,2]) @logger.log_level = :warn elsif host[:platform] =~ /macos/ syslog_name = "system.log" elsif host[:platform] =~ /fedora/ on(host, "journalctl --no-pager > /var/log/messages") elsif host[:platform] =~ /aix/ on(host, "alog -o -t console > /var/log/messages") end syslog_path = File.join(syslog_dir, syslog_name) if host.file_exist?(syslog_path) archive_file_from(host, syslog_path, {}, archive_root, archive_name) end ## turn the logger back on in case someone else wants to log things @logger.log_level = previous_level end end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/pre-suite/configure_type_defaults.rb
packaging/acceptance/pre-suite/configure_type_defaults.rb
# Ensures that the /root/.ssh/environment file is # set up with a path that includes /opt/puppetlabs/bin. # Normally this would be called as part of beaker-puppet # install steps, but we are installing openvox-agent outside # of beaker-puppet, since it doesn't handle openvox. test_name('configure root ssh environment path') do configure_type_defaults_on(agents) end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/lib/helper.rb
packaging/acceptance/lib/helper.rb
$LOAD_PATH << File.expand_path(File.dirname(__FILE__)) require 'beaker-puppet'
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/lib/puppet/acceptance/common_utils.rb
packaging/acceptance/lib/puppet/acceptance/common_utils.rb
module Puppet module Acceptance module CommandUtils def irb_command(host, type='aio') command(host, 'irb', type) end module_function :irb_command def command(host, cmd, type) return on(host, "which #{cmd}").stdout.chomp unless type == 'aio' return "env PATH=\"#{host['privatebindir']}:${PATH}\" cmd /c #{cmd}" if host['platform'] =~ /windows/ "env PATH=\"#{host['privatebindir']}:${PATH}\" #{cmd}" end end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/lib/puppet/acceptance/temp_file_utils.rb
packaging/acceptance/lib/puppet/acceptance/temp_file_utils.rb
module Puppet module Acceptance module TempFileUtils # Return the name of the root user, as appropriate for the platform. def root_user(host) case host['platform'] when /windows/ 'Administrator' else 'root' end end # Return the name of the root group, as appropriate for the platform. def root_group(host) case host['platform'] when /windows/ 'Administrators' when /aix/ 'system' when /macos|bsd/ 'wheel' else 'root' end end # Create a file on the host. # Parameters: # [host] the host to create the file on # [file_path] the path to the file to be created # [file_content] a string containing the contents to be written to the file # [options] a hash containing additional behavior options. Currently supported: # * :mkdirs (default false) if true, attempt to create the parent directories on the remote host before writing # the file # * :owner (default 'root') the username of the user that the file should be owned by # * :group (default 'puppet') the name of the group that the file should be owned by # * :mode (default '644') the mode (file permissions) that the file should be created with def create_test_file(host, file_rel_path, file_content, options = {}) # set default options options[:mkdirs] ||= false options[:mode] ||= "755" options[:owner] ||= root_user(host) options[:group] ||= root_group(host) file_path = get_test_file_path(host, file_rel_path) mkdirs(host, File.dirname(file_path)) if (options[:mkdirs] == true) create_remote_file(host, file_path, file_content) chown(host, options[:owner], options[:group], file_path) chmod(host, options[:mode], file_path) end # Given a relative path, returns an absolute path for a test file. Basically, this just prepends the # a unique temp dir path (specific to the current test execution) to your relative path. def get_test_file_path(host, file_rel_path) initialize_temp_dirs unless @host_test_tmp_dirs File.join(@host_test_tmp_dirs[host.name], file_rel_path) end # Check for the existence of a temp file for the current test; basically, this just calls file_exists?(), # but prepends the path to the current test's temp dir onto the file_rel_path parameter. This allows # tests to be written using only a relative path to specify file locations, while still taking advantage # of automatic temp file cleanup at test completion. def test_file_exists?(host, file_rel_path) file_exists?(host, get_test_file_path(host, file_rel_path)) end def file_exists?(host, file_path) host.execute("test -f \"#{file_path}\"", :acceptable_exit_codes => [0, 1]) do |result| return result.exit_code == 0 end end def dir_exists?(host, dir_path) host.execute("test -d \"#{dir_path}\"", :acceptable_exit_codes => [0, 1]) do |result| return result.exit_code == 0 end end def link_exists?(host, link_path) host.execute("test -L \"#{link_path}\"", :acceptable_exit_codes => [0, 1]) do |result| return result.exit_code == 0 end end def file_contents(host, file_path) host.execute("cat \"#{file_path}\"") do |result| return result.stdout end end def tmpdir(host, basename) host_tmpdir = host.tmpdir(basename) # we need to make sure that the puppet user can traverse this directory... chmod(host, "755", host_tmpdir) host_tmpdir end def mkdirs(host, dir_path) on(host, "mkdir -p #{dir_path}") end def chown(host, owner, group, path) on(host, "chown #{owner}:#{group} #{path}") end def chmod(host, mode, path) on(host, "chmod #{mode} #{path}") end # Returns an array containing the owner, group and mode of # the file specified by path. The returned mode is an integer # value containing only the file mode, excluding the type, e.g # S_IFDIR 0040000 def stat(host, path) require File.join(File.dirname(__FILE__),'common_utils.rb') ruby = ruby_command(host) owner = on(host, "#{ruby} -e 'require \"etc\"; puts (Etc.getpwuid(File.stat(\"#{path}\").uid).name)'").stdout.chomp group = on(host, "#{ruby} -e 'require \"etc\"; puts (Etc.getgrgid(File.stat(\"#{path}\").gid).name)'").stdout.chomp mode = on(host, "#{ruby} -e 'puts (File.stat(\"#{path}\").mode & 07777)'").stdout.chomp.to_i [owner, group, mode] end def initialize_temp_dirs() # pluck this out of the test case environment; not sure if there is a better way @cur_test_file = @path @cur_test_file_shortname = File.basename(@cur_test_file, File.extname(@cur_test_file)) # now we can create a hash of temp dirs--one per host, and unique to this test @host_test_tmp_dirs = Hash[agents.map do |host| [host.name, tmpdir(host, @cur_test_file_shortname)] end ] end def remove_temp_dirs() agents.each do |host| on(host, "rm -rf #{@host_test_tmp_dirs[host.name]}") end end # a silly variable for keeping track of whether or not all of the tests passed... @all_tests_passed = false end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/acceptance/config/aio/options.rb
packaging/acceptance/config/aio/options.rb
{ :type => 'aio', }
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-zfs_core.rb
packaging/configs/components/module-puppetlabs-zfs_core.rb
component "module-puppetlabs-zfs_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-zfs_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-mount_core.rb
packaging/configs/components/module-puppetlabs-mount_core.rb
component "module-puppetlabs-mount_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-mount_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/cleanup.rb
packaging/configs/components/cleanup.rb
# This component exists only to remove unnecessary files that bloat the final puppet-agent package. component "cleanup" do |pkg, settings, platform| unless settings[:dev_build] # Unless the settings specify that this is a development build, remove # unneeded header files (boost headers, for example, increase the size of # the package to an unacceptable degree). # # Note that: # - Ruby is not in this list because its headers are required to build native # extensions for gems. # - Curl and OpenSSL are not in this list because their headers are # required to build other libraries (e.g. libssh2 and libgit2) in other # projects that rely on puppet-agent (e.g. pe-r10k-vanagon). unwanted_headers = ["augeas.h", "boost", "cpp-pcp-client", "fa.h", "facter", "hocon", "leatherman", "libexslt", "libxml2", "libxslt", "whereami", "yaml-cpp"] # We need a full path on windows because /usr/bin is not in the PATH at this point rm = platform.is_windows? ? '/usr/bin/rm' : 'rm' cleanup_steps = [ unwanted_headers.map { |h| "#{rm} -rf #{settings[:includedir]}/#{h}" }, # Also remove OpenSSL manpages "#{rm} -rf #{settings[:prefix]}/ssl/man", ] if platform.is_windows? # On Windows releases that distribute curl, these curl binaries can # interfere with the native ones when puppet-agent's bindir is in the PATH: cleanup_steps << "#{rm} #{settings[:bindir]}/curl*" end cleanup_steps << "#{rm} -rf #{settings[:service_conf]}" pkg.install { cleanup_steps } end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-cron_core.rb
packaging/configs/components/module-puppetlabs-cron_core.rb
component "module-puppetlabs-cron_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-cron_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/_base-module.rb
packaging/configs/components/_base-module.rb
# This file is a basis for vendor modules that should be installed alongside # puppet-agent in settings[:module_vendordir]. It should not be used as a # component; Instead, other module components should load it using # `instance_eval`. Here's an example: # # component "module-puppetlabs-stdlib" do |pkg, settings, platform| # pkg.version "4.25.1" # pkg.md5sum "f18f3361cb8c85770e96eeed05358f05" # # instance_eval File.read("configs/components/_base-module.rb") # end # # Module components must be named with the following format: # module-<module-author>-<module-name>.rb # # No dependency resolution is attempted automatically; You must define separate # vanagon components for each module and make their dependencies explicit. unless defined?(pkg) raise "_base-module.rb is not a valid vanagon component; Load it with `instance_eval` in another component instead." end match_data = pkg.get_name.match(/module-([^-]+)-([^-]+)/) unless match_data raise "module components must be named with the format `module-<module-author>-<module-name>.rb`" end module_author, module_name = match_data.captures # Modules must have puppet pkg.build_requires 'puppet' # This is just a tarball; Skip unpack, patch, configure, build, check steps pkg.install_only true # Ensure the vendored modules directory makes it into the package with the right permissions if platform.is_windows? pkg.directory(settings[:module_vendordir]) else pkg.directory(settings[:module_vendordir], mode: '0755', owner: 'root', group: 'root') end target_directory = File.join(settings[:module_vendordir], module_name) pkg.install do [ # Rename appropriately for use with puppet "mv #{module_author}-#{module_name} #{target_directory}", # Remove git and CI-related files "rm -rf #{File.join(target_directory, '.[!.]*')}", ] end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-scheduled_task.rb
packaging/configs/components/module-puppetlabs-scheduled_task.rb
component "module-puppetlabs-scheduled_task" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-scheduled_task.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-host_core.rb
packaging/configs/components/module-puppetlabs-host_core.rb
component "module-puppetlabs-host_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-host_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/execution_wrapper.rb
packaging/configs/components/execution_wrapper.rb
# This lays down the execution_wrapper script, which used to be a piece of pxp-agent # that Choria depends on, but is now a plain Ruby script. component "execution_wrapper" do |pkg, settings, platform| pkg.add_source "file://resources/files/execution_wrapper" pkg.install_file "execution_wrapper", "#{settings[:bindir]}/execution_wrapper", mode: '0755' if platform.is_windows? pkg.add_source "file://resources/files/windows/execution_wrapper.bat" pkg.install_file "execution_wrapper.bat", "#{settings[:bindir]}/execution_wrapper.bat" end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/openfact.rb
packaging/configs/components/openfact.rb
component "openfact" do |pkg, settings, platform| pkg.load_from_json('configs/components/openfact.json') pkg.build_requires 'puppet-runtime' # Provides ruby and rubygem-deep-merge flags = " --bindir=#{settings[:bindir]} \ --sitelibdir=#{settings[:ruby_vendordir]} \ --man \ --mandir=#{settings[:mandir]} \ --ruby=#{File.join(settings[:bindir], 'ruby')} " if platform.is_windows? pkg.add_source("file://resources/files/windows/facter.bat", sum: "eabed128c7160289790a2b59a84a9a13") pkg.add_source("file://resources/files/windows/facter_interactive.bat", sum: "20a1c0bc5368ffb24980f42432f1b372") pkg.add_source("file://resources/files/windows/run_facter_interactive.bat", sum: "c5e0c0a80e5c400a680a06a4bac8abd4") pkg.install_file "../facter.bat", "#{settings[:link_bindir]}/facter.bat" pkg.install_file "../facter_interactive.bat", "#{settings[:link_bindir]}/facter_interactive.bat" pkg.install_file "../run_facter_interactive.bat", "#{settings[:link_bindir]}/run_facter_interactive.bat" end pkg.install do [ "#{settings[:host_ruby]} install.rb \ --no-batch-files \ --no-configs \ #{flags}" ] end pkg.install_file "openfact.gemspec", "#{settings[:gem_home]}/specifications/#{pkg.get_name}-#{pkg.get_version_forced}.gemspec" if platform.is_windows? pkg.directory File.join(settings[:sysconfdir], 'facter', 'facts.d') else pkg.directory File.join(settings[:install_root], 'facter', 'facts.d') end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-zone_core.rb
packaging/configs/components/module-puppetlabs-zone_core.rb
component "module-puppetlabs-zone_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-zone_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/puppet-resource_api.rb
packaging/configs/components/puppet-resource_api.rb
component "puppet-resource_api" do |pkg, settings, platform| pkg.load_from_json("configs/components/puppet-resource_api.json") pkg.build_requires "puppet-runtime" # Install into the directory for gems shared by puppet and puppetserver pkg.environment "GEM_HOME", settings[:puppet_gem_vendor_dir] # PA-25 in order to install gems in a cross-compiled environment we need to # set RUBYLIB to include puppet, so that its gemspec can resolve # puppet/version requires. Without this the gem install # will fail by blowing out the stack. pkg.environment "RUBYLIB", "#{settings[:ruby_vendordir]}:$(RUBYLIB)" pkg.build do ["#{settings[:host_gem]} build puppet-resource_api.gemspec"] end pkg.install do ["#{settings[:gem_install]} puppet-resource_api-*.gem"] end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-sshkeys_core.rb
packaging/configs/components/module-puppetlabs-sshkeys_core.rb
component "module-puppetlabs-sshkeys_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-sshkeys_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/shellpath.rb
packaging/configs/components/shellpath.rb
component "shellpath" do |pkg, settings, platform| pkg.version "2023-02-15" pkg.add_source "file://resources/files/puppet-agent.sh", sum: "f5987a68adf3844ca15ba53813ad6f63" pkg.add_source "file://resources/files/puppet-agent.csh", sum: "62b360a7d15b486377ef6c7c6d05e881" pkg.install_file("./puppet-agent.sh", "/etc/profile.d/puppet-agent.sh") pkg.install_file("./puppet-agent.csh", "/etc/profile.d/puppet-agent.csh") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-selinux_core.rb
packaging/configs/components/module-puppetlabs-selinux_core.rb
component "module-puppetlabs-selinux_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-selinux_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/pl-ruby-patch.rb
packaging/configs/components/pl-ruby-patch.rb
# This component patches the pl-ruby package on cross compiled # platforms. Ruby gem components should require this. # # We have to do this when installing gems with native extensions in # order to trick rubygems into thinking we have a different ruby # version and target architecture # # This component should also be present in the puppet-runtime project component "pl-ruby-patch" do |pkg, settings, platform| if platform.is_cross_compiled? if platform.is_macos? pkg.build_requires 'gnu-sed' pkg.environment "PATH", "/usr/local/opt/gnu-sed/libexec/gnubin:$(PATH)" end ruby_api_version = settings[:ruby_version].gsub(/\.\d*$/, '.0') ruby_version_y = settings[:ruby_version].gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2') base_ruby = if platform.name =~ /macos/ "/usr/local/opt/ruby@#{ruby_version_y}/lib/ruby/#{ruby_api_version}" else "/opt/pl-build-tools/lib/ruby/2.1.0" end target_triple = if platform.architecture =~ /ppc64el|ppc64le/ "powerpc64le-linux" elsif platform.name == 'solaris-11-sparc' "sparc-solaris-2.11" elsif platform.is_macos? "aarch64-darwin" else "#{platform.architecture}-linux" end pkg.build do [ %(#{platform[:sed]} -i 's/Gem::Platform.local.to_s/"#{target_triple}"/' #{base_ruby}/rubygems/basic_specification.rb), %(#{platform[:sed]} -i 's/Gem.extension_api_version/"#{ruby_api_version}"/' #{base_ruby}/rubygems/basic_specification.rb) ] end # make rubygems use our target rbconfig when installing gems case File.basename(base_ruby) when '2.0.0', '2.1.0' sed_command = %(s|Gem.ruby|&, '-r/opt/puppetlabs/puppet/share/doc/rbconfig-#{settings[:ruby_version]}-orig.rb'|) else sed_command = %(s|Gem.ruby.shellsplit|& << '-r/opt/puppetlabs/puppet/share/doc/rbconfig-#{settings[:ruby_version]}-orig.rb'|) end pkg.build do [ %(#{platform[:sed]} -i "#{sed_command}" #{base_ruby}/rubygems/ext/ext_conf_builder.rb) ] end end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/wrapper-script.rb
packaging/configs/components/wrapper-script.rb
# This component creates wrapper scripts to clean up the environment on UNIX platforms component "wrapper-script" do |pkg, settings, platform| pkg.add_source "file://resources/files/aix-wrapper.sh" pkg.add_source "file://resources/files/osx-wrapper.sh" pkg.add_source "file://resources/files/sysv-wrapper.sh" wrapper = "#{settings[:bindir]}/wrapper.sh" if platform.is_aix? pkg.install_file "aix-wrapper.sh", wrapper, mode: '0755' elsif platform.is_macos? pkg.install_file "osx-wrapper.sh", wrapper, mode: '0755' else pkg.install_file "sysv-wrapper.sh", wrapper, mode: '0755' end ["facter", "puppet"].each do |exe| pkg.link wrapper, "#{settings[:link_bindir]}/#{exe}" end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/openssl-fips.rb
packaging/configs/components/openssl-fips.rb
component "openssl-fips" do |pkg, settings, platform| raise "openssl-fips is not a valid component on non-fips platforms" unless platform.is_fips? pkg.build_requires "puppet-runtime" openssl_fips_details = JSON.parse(File.read('configs/components/openssl-fips.json')) openssl_fips_version = openssl_fips_details['version'] openssl_fips_location = openssl_fips_details['location'] tarball_name = "#{pkg.get_name}-#{openssl_fips_version}.#{platform.name}.tar.gz" pkg.url File.join(openssl_fips_location, tarball_name) pkg.sha1sum File.join(openssl_fips_location, "#{tarball_name}.sha1") pkg.version openssl_fips_version pkg.install_only true pkg.add_source("file://resources/patches/openssl/openssl-fips.cnf.patch") openssl_ssldir = File.join(settings[:prefix], 'ssl') openssl_cnf = File.join(openssl_ssldir, 'openssl.cnf') openssl_fips_cnf = File.join(openssl_ssldir, 'openssl-fips.cnf') # Overlay openssl-fips shared library onto puppet-runtime in /opt at *build* time # # Don't generate `fipsmodule.cnf` during the build. It must be generated # during postinstall action. # # Don't include FIPS-enabled `openssl.cnf` in the package. It must be moved # into place after `fipsmodule.cnf` is generated. So ship `openssl-fips.cnf` # and rename it to `openssl.cnf` during postinstall action. # extract_dir = platform.is_windows? ? '/cygdrive/c' : '/' pkg.install do [ "#{platform.tar} --skip-old-files --directory=#{extract_dir} --extract --gunzip --file=#{tarball_name}", "mv #{openssl_cnf} #{openssl_fips_cnf}", "#{platform.patch} --strip=1 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch -d #{openssl_ssldir}/ < openssl-fips.cnf.patch" ] end if platform.is_windows? # We need to include fipsmodule.cnf, but it's hard on Windows because the # installation directory is user-configurable and openssl doesn't support # "./fipsmodule.cnf" to mean look in the same directory as openssl.cnf. # # From https://www.openssl.org/docs/man3.0/man5/config.html # # "The environment variable OPENSSL_CONF_INCLUDE, if it exists, is # prepended to all relative pathnames. If the pathname is still relative, # it is interpreted based on the current working directory." # # So to make it clear how the relative path is converted to absolute, specify # the environment variable directly in openssl-fips.cnf, which will be copied # to openssl.cnf during installation. Use \x24 to specify a literal '$' # character. pkg.install do ["sed -i 's|.include /opt/puppetlabs/puppet/ssl/fipsmodule.cnf|.include \\x24ENV::OPENSSL_CONF_INCLUDE/fipsmodule.cnf|' #{openssl_fips_cnf}"] end end # See "Making all applications use the FIPS module by default" in # https://www.openssl.org/docs/man3.0/man7/fips_module.html # # We have to run `openssl fipsinstall` to generate `fipsmodule.cnf`. This # generates an HMAC for the `fips.so` and stores that value in `fipsmodule.cnf`. # Only later can we enable fips, by overwriting `openssl.cnf` with the fips # enabled version. # # During an upgrade, `fips.so` may be modified, invaliding the checksum in # `fipsmodule.cnf`, and that will prevent `openssl fipsinstall` from working. # So override OPENSSL_CONF to use the pristine `openssl.cnf` without fips # enabled to regenerate `fipsmodule.conf` # if platform.is_rpm? # If you modify the following code, update customactions.wxs.erb too! pkg.add_postinstall_required_action ["install", "upgrade"], [<<-HERE.undent OPENSSL_CONF=/opt/puppetlabs/puppet/ssl/openssl.cnf.dist /opt/puppetlabs/puppet/bin/openssl fipsinstall -module /opt/puppetlabs/puppet/lib/ossl-modules/fips.so -provider_name fips -out /opt/puppetlabs/puppet/ssl/fipsmodule.cnf /usr/bin/cp --preserve /opt/puppetlabs/puppet/ssl/openssl-fips.cnf /opt/puppetlabs/puppet/ssl/openssl.cnf /usr/bin/chmod 0644 /opt/puppetlabs/puppet/ssl/openssl.cnf /usr/bin/chmod 0644 /opt/puppetlabs/puppet/ssl/fipsmodule.cnf HERE ] # Delete generated files, they may not exist, so force # # REMIND: update for Windows pkg.add_preremove_action ["removal"], [ "rm --force /opt/puppetlabs/puppet/ssl/openssl.cnf", "rm --force /opt/puppetlabs/puppet/ssl/fipsmodule.cnf" ] end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/puppet-runtime.rb
packaging/configs/components/puppet-runtime.rb
component 'puppet-runtime' do |pkg, settings, platform| unless settings[:puppet_runtime_version] && settings[:puppet_runtime_location] && settings[:puppet_runtime_basename] raise "Expected to find :puppet_runtime_version, :puppet_runtime_location, and :puppet_runtime_basename settings; Please set these in your project file before including puppet-runtime as a component." end pkg.version settings[:puppet_runtime_version] tarball_name = "#{settings[:puppet_runtime_basename]}.tar.gz" pkg.url File.join(settings[:puppet_runtime_location], tarball_name) pkg.sha1sum File.join(settings[:puppet_runtime_location], "#{tarball_name}.sha1") pkg.requires 'findutils' if platform.is_linux? pkg.install_only true # Even though puppet's ruby comes from puppet-runtime, we still need a ruby # to build with on these platforms: if platform.is_cross_compiled? if platform.is_solaris? raise "Unknown solaris os_version: #{platform.os_version}" unless platform.os_version == '11' pkg.build_requires 'pl-ruby' elsif platform.is_linux? pkg.build_requires 'pl-ruby' elsif platform.is_macos? ruby_version_y = settings[:ruby_version].gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2') pkg.build_requires "ruby@#{ruby_version_y}" end end if platform.is_windows? # Elevate.exe is simply used when one of the run_facter.bat or # run_puppet.bat files are called. These set up the required environment # for the program, and elevate.exe gives the program the elevated # privileges it needs to run. # Comes from https://github.com/jpassing/elevate pkg.add_source "file://resources/files/windows/elevate.exe.config", sum: "a5aecf3f7335fa1250a0f691d754d561" pkg.add_source "https://artifacts.overlookinfratech.com/components/elevate.exe", sum: "bd81807a5c13da32dd2a7157f66fa55d" pkg.install_file 'elevate.exe.config', "#{settings[:bindir]}/elevate.exe.config" pkg.install_file 'elevate.exe', "#{settings[:bindir]}/elevate.exe" # We need to make sure we're setting permissions correctly for the executables # in the ruby bindir since preserving permissions in archives in windows is # ... weird, and we need to be able to use cygwin environment variable use # so cmd.exe was not working as expected. install_command = [ "gunzip -c #{tarball_name} | tar -k -C /cygdrive/c/ -xf -", "chmod 755 #{settings[:bindir].sub('C:', '/cygdrive/c')}/*" ] elsif platform.is_macos? # We can't untar into '/' because of SIP on macOS; Just copy the contents # of these directories instead: install_command = [ "tar -xzf #{tarball_name}", "for d in opt var private; do sudo rsync -ka \"$${d}/\" \"/$${d}/\"; done" ] else install_command = ["gunzip -c #{tarball_name} | #{platform.tar} -k -C / -xf -"] end pkg.install do install_command end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/puppet.rb
packaging/configs/components/puppet.rb
require_relative '../../../lib/puppet/version' component "puppet" do |pkg, settings, platform| pkg.url 'file://../' pkg.version Puppet.version pkg.build_requires "puppet-runtime" # Provides ruby and rubygem-win32-dir # Used to compile binary translation files # i18n is not supported on Solaris pkg.build_requires "gettext" unless platform.is_solaris? || platform.is_aix? pkg.build_requires "gettext-devel" if platform.is_windows? platform.get_service_types.each do |servicetype| case servicetype when "systemd" pkg.install_service "ext/systemd/puppet.service", "ext/redhat/client.sysconfig", init_system: servicetype when "sysv" if platform.is_deb? pkg.install_service "ext/debian/puppet.init", "ext/debian/puppet.default", init_system: servicetype elsif platform.is_sles? pkg.install_service "ext/suse/client.init", "ext/redhat/client.sysconfig", init_system: servicetype elsif platform.is_rpm? pkg.install_service "ext/redhat/client.init", "ext/redhat/client.sysconfig", init_system: servicetype end when "launchd" pkg.install_service "ext/osx/puppet.plist", nil, "org.voxpupuli.puppet", init_system: servicetype when "smf" pkg.install_service "ext/solaris/smf/puppet.xml", "ext/solaris/smf/puppet", service_type: "network", init_system: servicetype when "aix" pkg.install_service "resources/aix/puppet.service", nil, "puppet", init_system: servicetype when "windows" # Note - this definition indicates that the file should be filtered out from the Wix # harvest. A corresponding service definition file is also required in resources/windows/wix pkg.install_service "SourceDir\\#{settings[:base_dir]}\\#{settings[:pl_company_id]}\\#{settings[:pl_product_id]}\\puppet\\bin\\ruby.exe" else fail "need to know where to put service files" end end if (platform.get_service_types.include?("sysv") && platform.is_rpm?) || platform.is_aix? puppet_bin = "/opt/puppetlabs/bin/puppet" rpm_statedir = "%{_localstatedir}/lib/rpm-state/#{pkg.get_name}" service_statefile = "#{rpm_statedir}/service_state" pkg.add_preinstall_action ["upgrade"], [<<-HERE.undent mkdir -p #{rpm_statedir} && chown root #{rpm_statedir} && chmod 0700 #{rpm_statedir} || : if [ -x #{puppet_bin} ] ; then #{puppet_bin} resource service puppet | awk -F "'" '/ensure[[:space:]]+=>/ { print $2 }' > #{service_statefile} || : fi HERE ] pkg.add_postinstall_action ["upgrade"], [<<-HERE.undent if [ -f #{service_statefile} ] ; then #{puppet_bin} resource service puppet ensure=$(cat #{service_statefile}) > /dev/null 2>&1 || : rm -rf #{rpm_statedir} || : fi HERE ] end # For Debian platforms generate a package trigger to ensure puppetserver # restarts itself when the agent package is upgraded (PA-1130) pkg.add_debian_activate_triggers "puppetserver-restart" if platform.is_deb? # To create a tmpfs directory for the piddir, it seems like it's either this # or a PR against Puppet until that sort of support can be rolled into the # Vanagon tooling directly. It's totally a hack, and I'm not proud of this # in any meaningful way. # - Ryan "I'm sorry. I'm so sorry." McKern, June 8 2015 # - Jira # RE-3954 if platform.get_service_types.include?('systemd') pkg.build do "echo 'd #{settings[:piddir]} 0755 root root -' > puppet-agent.conf" end # Also part of the ugly, ugly, ugly, sad, tragic hack. # - Ryan "Rub some HEREDOC on it" McKern, June 8 2015 # - Jira # RE-3954 pkg.install_configfile 'puppet-agent.conf', File.join(settings[:tmpfilesdir], 'puppet-agent.conf') end # We do not currently support i18n on Solaris or AIX unless platform.is_solaris? || platform.is_aix? if platform.is_windows? msgfmt = "/usr/bin/msgfmt.exe" elsif platform.is_macos? msgfmt = "/usr/local/opt/gettext/bin/msgfmt" if platform.architecture == 'arm64' msgfmt = "/opt/homebrew/bin/msgfmt" end else msgfmt = "msgfmt" end pkg.configure do ["for dir in ./locales/*/ ; do [ -d \"$${dir}\" ] || continue ; [ -d \"$${dir}/LC_MESSAGES\" ] || /bin/mkdir \"$${dir}/LC_MESSAGES\" ; #{msgfmt} \"$${dir}/puppet.po\" -o \"$${dir}/LC_MESSAGES/puppet.mo\" ; done ;",] end end # Puppet requires tar, otherwise PMT will not install modules if platform.is_solaris? if platform.os_version == "11" pkg.requires 'archiver/gnu-tar' end else # PMT doesn't work on AIX, don't add a useless dependency # We will need to revisit when we update PMT support pkg.requires 'tar' unless platform.is_aix? end if platform.is_macos? pkg.add_source("file://resources/files/osx_paths.txt", sum: "077ceb5e2f71cf733190a61d2fd221fb") pkg.install_file("../osx_paths.txt", "/etc/paths.d/puppet-agent", sudo: true) end if platform.is_windows? pkg.environment "PATH", "/usr/bin:$(shell cygpath -u #{settings[:gcc_bindir]}):$(shell cygpath -u #{settings[:ruby_bindir]}):$(shell cygpath -u #{settings[:bindir]}):/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0" end if platform.is_windows? vardir = File.join(settings[:sysconfdir], 'puppet', 'cache') publicdir = File.join(settings[:sysconfdir], 'puppet', 'public') configdir = File.join(settings[:sysconfdir], 'puppet', 'etc') logdir = File.join(settings[:sysconfdir], 'puppet', 'var', 'log') piddir = File.join(settings[:sysconfdir], 'puppet', 'var', 'run') else vardir = File.join(settings[:prefix], 'cache') publicdir = File.join(settings[:prefix], 'public') configdir = settings[:puppet_configdir] logdir = settings[:logdir] piddir = settings[:piddir] end pkg.install do [ "#{settings[:host_ruby]} install.rb \ --ruby=#{File.join(settings[:bindir], 'ruby')} \ --bindir=#{settings[:bindir]} \ --configdir=#{configdir} \ --sitelibdir=#{settings[:ruby_vendordir]} \ --codedir=#{settings[:puppet_codedir]} \ --vardir=#{vardir} \ --publicdir=#{publicdir} \ --rundir=#{piddir} \ --logdir=#{logdir} \ --localedir=#{settings[:datadir]}/locale \ --configs \ --quick \ --no-batch-files \ --man \ --mandir=#{settings[:mandir]}",] end if platform.is_windows? pkg.install do ["/usr/bin/cp #{settings[:prefix]}/VERSION #{settings[:install_root]}",] end end unless platform.is_windows? # Include the eyaml executable pkg.link "#{settings[:puppet_gem_vendor_dir]}/bin/eyaml", "#{settings[:bindir]}/eyaml" end #The following will add the vim syntax files for puppet #in the /opt/puppetlabs/puppet/share/vim directory pkg.add_source "file://resources/files/ftdetect/ftdetect_puppet.vim", sum: "9e93cd63787de6b9ed458c95061f06eb" pkg.add_source "file://resources/files/ftplugin/ftplugin_puppet.vim", sum: "0fde61360edf2bb205947f768bfb2d57" pkg.add_source "file://resources/files/indent/indent_puppet.vim", sum: "4bc2dee4c9c4e74aa3103339ad3ab227" pkg.add_source "file://resources/files/syntax/syntax_puppet.vim", sum: "3ef904628c734af25fe673638c4e0b3d" pkg.install_configfile("../ftdetect_puppet.vim", "#{settings[:datadir]}/vim/puppet-vimfiles/ftdetect/puppet.vim") pkg.install_configfile("../ftplugin_puppet.vim", "#{settings[:datadir]}/vim/puppet-vimfiles/ftplugin/puppet.vim") pkg.install_configfile("../indent_puppet.vim", "#{settings[:datadir]}/vim/puppet-vimfiles/indent/puppet.vim") pkg.install_configfile("../syntax_puppet.vim", "#{settings[:datadir]}/vim/puppet-vimfiles/syntax/puppet.vim") pkg.install_file "openvox.gemspec", "#{settings[:gem_home]}/specifications/#{pkg.get_name}-#{pkg.get_version_forced}.gemspec" if platform.is_windows? # Install the appropriate .batch files to the INSTALLDIR/bin directory pkg.add_source("file://resources/files/windows/environment.bat", sum: "810195e5fe09ce1704d0f1bf818b2d9a") pkg.add_source("file://resources/files/windows/puppet.bat", sum: "002618e115db9fd9b42ec611e1ec70d2") pkg.add_source("file://resources/files/windows/puppet_interactive.bat", sum: "4b40eb0df91d2ca8209302062c4940c4") pkg.add_source("file://resources/files/windows/puppet_shell.bat", sum: "24477c6d2c0e7eec9899fb928204f1a0") pkg.add_source("file://resources/files/windows/run_puppet_interactive.bat", sum: "d4ae359425067336e97e4e3a200027d5") pkg.install_file "../environment.bat", "#{settings[:link_bindir]}/environment.bat" pkg.install_file "../puppet.bat", "#{settings[:link_bindir]}/puppet.bat" pkg.install_file "../puppet_interactive.bat", "#{settings[:link_bindir]}/puppet_interactive.bat" pkg.install_file "../run_puppet_interactive.bat", "#{settings[:link_bindir]}/run_puppet_interactive.bat" pkg.install_file "../puppet_shell.bat", "#{settings[:link_bindir]}/puppet_shell.bat" pkg.install_file "ext/windows/service/daemon.bat", "#{settings[:bindir]}/daemon.bat" pkg.install_file "ext/windows/service/daemon.rb", "#{settings[:service_dir]}/daemon.rb" pkg.install_file "../wix/icon/voxpupuli.ico", "#{settings[:miscdir]}/voxpupuli.ico" pkg.install_file "../wix/license/LICENSE.rtf", "#{settings[:miscdir]}/LICENSE.rtf" pkg.directory settings[:service_dir] end pkg.configfile File.join(configdir, 'puppet.conf') pkg.directory vardir, mode: '0750' pkg.directory publicdir, mode: '0755' pkg.directory configdir pkg.directory File.join(settings[:datadir], "locale") pkg.directory settings[:puppet_codedir] pkg.directory File.join(settings[:puppet_codedir], "modules") pkg.directory File.join(settings[:prefix], "modules") pkg.directory File.join(settings[:puppet_codedir], 'environments') pkg.directory File.join(settings[:puppet_codedir], 'environments', 'production') pkg.directory File.join(settings[:puppet_codedir], 'environments', 'production', 'manifests') pkg.directory File.join(settings[:puppet_codedir], 'environments', 'production', 'modules') pkg.directory File.join(settings[:puppet_codedir], 'environments', 'production', 'data') pkg.install_configfile 'conf/environment.conf', File.join(settings[:puppet_codedir], 'environments', 'production', 'environment.conf') if platform.is_windows? pkg.directory File.join(settings[:sysconfdir], 'puppet', 'var', 'log') pkg.directory File.join(settings[:sysconfdir], 'puppet', 'var', 'run') else pkg.directory File.join(settings[:logdir], 'puppet'), mode: "0750" end if platform.is_eos? pkg.link "#{settings[:sysconfdir]}", "#{settings[:link_sysconfdir]}" end pkg.install_file "ext/hiera/hiera.yaml", File.join(settings[:puppet_codedir], 'environments', 'production', 'hiera.yaml') pkg.configfile File.join(settings[:puppet_codedir], 'environments', 'production', 'hiera.yaml') pkg.configfile File.join(configdir, 'hiera.yaml') unless platform.is_windows? old_hiera = File.join(settings[:puppet_codedir], 'hiera.yaml') cnf_hiera = File.join(configdir, 'hiera.yaml') env_hiera = File.join(settings[:puppet_codedir], 'environments', 'production', 'hiera.yaml') rmv_hiera = File.join(configdir, 'remove_hiera5_files.rm') # Pre-Install script saves copies of existing hiera configuration files, # and also creates "marker" files to indicate that the files pre-existed. # We want to ensure that our copy preserves the metadata (e.g. permissions, # timestamps, extended attributes) of the existing hiera config. files. The # necessary flags that do this are platform dependent. if platform.is_solaris? # The @ option preserves extended attributes cp_cmd = "cp -p@" elsif platform.is_aix? # The U option preserves extended attributes. # On AIX 7.2, the S option preserves file # sparseness. cp_cmd = "cp -pU" cp_cmd += "S" if platform.name =~ /7.2/ else cp_cmd = "cp -a" end preinstall = <<-PREINST # Backup the old hiera configs if present, so that we # can drop them back in place if the package manager # tries to remove it. if [ -e #{old_hiera} ]; then #{cp_cmd} #{old_hiera}{,.pkg-old} touch #{rmv_hiera} fi if [ -e #{cnf_hiera} ]; then #{cp_cmd} #{cnf_hiera}{,.pkg-old} touch #{rmv_hiera} fi if [ -e #{env_hiera} ]; then #{cp_cmd} #{env_hiera}{,.pkg-old} touch #{rmv_hiera} fi PREINST # Post-install script restores any old hiera config files that have been saved. # It also remove any extra hiera configuration files that we laid down. postinstall = <<-POSTINST # Remove any extra hiera config files we laid down if prev config present if [ -e #{rmv_hiera} ]; then rm -f #{cnf_hiera} rm -f #{env_hiera} rm -f #{rmv_hiera} fi # Restore the old hiera, if it existed if [ -e #{old_hiera}.pkg-old ]; then mv #{old_hiera}{.pkg-old,} fi if [ -e #{cnf_hiera}.pkg-old ]; then mv #{cnf_hiera}{.pkg-old,} fi if [ -e #{env_hiera}.pkg-old ]; then mv #{env_hiera}{.pkg-old,} fi POSTINST pkg.add_preinstall_action ["upgrade"], [preinstall] pkg.add_postinstall_action ["upgrade"], [postinstall] end end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-augeas_core.rb
packaging/configs/components/module-puppetlabs-augeas_core.rb
component "module-puppetlabs-augeas_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-augeas_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/components/module-puppetlabs-yumrepo_core.rb
packaging/configs/components/module-puppetlabs-yumrepo_core.rb
component "module-puppetlabs-yumrepo_core" do |pkg, settings, platform| pkg.load_from_json("configs/components/module-puppetlabs-yumrepo_core.json") instance_eval File.read("configs/components/_base-module.rb") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/ubuntu-25.04-aarch64.rb
packaging/configs/platforms/ubuntu-25.04-aarch64.rb
platform "ubuntu-25.04-aarch64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/el-8-x86_64.rb
packaging/configs/platforms/el-8-x86_64.rb
platform "el-8-x86_64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/redhatfips-9-x86_64.rb
packaging/configs/platforms/redhatfips-9-x86_64.rb
platform "redhatfips-9-x86_64" do |plat| # NOTE: You must run the build on a FIPS-enabled Linux host in order for this platform to # build correctly with the Docker engine. plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/amazon-2-x86_64.rb
packaging/configs/platforms/amazon-2-x86_64.rb
platform 'amazon-2-x86_64' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/windowsfips-2016-x64.rb
packaging/configs/platforms/windowsfips-2016-x64.rb
platform "windowsfips-2016-x64" do |plat| plat.vmpooler_template 'win-2016-fips-x86_64' plat.servicetype 'windows' # We need to ensure we install chocolatey prior to adding any nuget repos. Otherwise, everything will fall over plat.add_build_repository "https://artifactory.delivery.puppetlabs.net/artifactory/generic/buildsources/windows/chocolatey/install-chocolatey-1.4.0.ps1" plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe feature enable -n useFipsCompliantChecksums" plat.add_build_repository "https://artifactory.delivery.puppetlabs.net/artifactory/api/nuget/nuget" # We don't want to install any packages from the chocolatey repo by accident plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe sources remove -name chocolatey" # Install 7zip from chocolatey since it does not come pre-installed in the windowsfips-2016 VM. plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe install -y -debug 7zip.install" #FIXME we need Fips Compliant Wix, currently not in choco repositories plat.provision_with "curl -L --fail --retry 3 -o /tmp/wix314-binaries.zip https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/buildsources/wix314-binaries.zip && \"C:/Program Files/7-Zip/7z.exe\" x -y -o\"C:/Program Files (x86)/WiX Toolset v3.14/bin\" C:/cygwin64/tmp/wix314-binaries.zip && rm /tmp/wix314-binaries.zip && SETX WIX \"C:\\Program Files (x86)\\WiX Toolset v3.14\" /M" plat.install_build_dependencies_with "C:/ProgramData/chocolatey/bin/choco.exe install -y --no-progress" plat.make "/usr/bin/make" plat.patch "TMP=/var/tmp /usr/bin/patch.exe --binary" plat.platform_triple "x86_64-w64-mingw32" plat.package_type "msi" plat.output_dir "windowsfips" end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/ubuntu-24.04-amd64.rb
packaging/configs/platforms/ubuntu-24.04-amd64.rb
platform "ubuntu-24.04-amd64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/ubuntu-22.04-aarch64.rb
packaging/configs/platforms/ubuntu-22.04-aarch64.rb
platform "ubuntu-22.04-aarch64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/amazon-2-aarch64.rb
packaging/configs/platforms/amazon-2-aarch64.rb
platform 'amazon-2-aarch64' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/ubuntu-22.04-amd64.rb
packaging/configs/platforms/ubuntu-22.04-amd64.rb
platform "ubuntu-22.04-amd64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/sles-15-x86_64.rb
packaging/configs/platforms/sles-15-x86_64.rb
platform "sles-15-x86_64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/el-8-aarch64.rb
packaging/configs/platforms/el-8-aarch64.rb
platform "el-8-aarch64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/sles-12-x86_64.rb
packaging/configs/platforms/sles-12-x86_64.rb
platform "sles-12-x86_64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/debian-13-aarch64.rb
packaging/configs/platforms/debian-13-aarch64.rb
platform "debian-13-aarch64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/fedora-41-x86_64.rb
packaging/configs/platforms/fedora-41-x86_64.rb
platform 'fedora-41-x86_64' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/fedora-41-aarch64.rb
packaging/configs/platforms/fedora-41-aarch64.rb
platform 'fedora-41-aarch64' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/fedora-43-x86_64.rb
packaging/configs/platforms/fedora-43-x86_64.rb
platform 'fedora-43-x86_64' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/debian-11-armhf.rb
packaging/configs/platforms/debian-11-armhf.rb
platform "debian-11-armhf" do |plat| plat.servicedir "/lib/systemd/system" plat.defaultdir "/etc/default" plat.servicetype "systemd" plat.codename "bullseye" packages = ['build-essential', 'devscripts', 'rsync', 'fakeroot', 'debhelper'] plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}" plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends " end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/ubuntu-25.04-amd64.rb
packaging/configs/platforms/ubuntu-25.04-amd64.rb
platform "ubuntu-25.04-amd64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/debian-11-amd64.rb
packaging/configs/platforms/debian-11-amd64.rb
platform "debian-11-amd64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/el-9-ppc64le.rb
packaging/configs/platforms/el-9-ppc64le.rb
platform 'el-9-ppc64le' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/fedora-43-aarch64.rb
packaging/configs/platforms/fedora-43-aarch64.rb
platform 'fedora-43-aarch64' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/macos-all-x86_64.rb
packaging/configs/platforms/macos-all-x86_64.rb
platform 'macos-all-x86_64' do |plat| plat.inherit_from_default plat.output_dir File.join('macos', 'all', 'x86_64') end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/el-10-x86_64.rb
packaging/configs/platforms/el-10-x86_64.rb
platform "el-10-x86_64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/debian-12-armhf.rb
packaging/configs/platforms/debian-12-armhf.rb
platform "debian-12-armhf" do |plat| plat.servicedir "/lib/systemd/system" plat.defaultdir "/etc/default" plat.servicetype "systemd" plat.codename "bookworm" packages = ['build-essential', 'devscripts', 'rsync', 'fakeroot', 'debhelper'] plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends #{packages.join(' ')}" plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends " end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/amazon-2023-aarch64.rb
packaging/configs/platforms/amazon-2023-aarch64.rb
platform 'amazon-2023-aarch64' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/solaris-11-i386.rb
packaging/configs/platforms/solaris-11-i386.rb
platform "solaris-11-i386" do |plat| plat.servicedir "/lib/svc/manifest" plat.defaultdir "/lib/svc/method" plat.servicetype "smf" plat.vmpooler_template "solaris-11-x86_64" plat.add_build_repository 'http://solaris-11-reposync.delivery.puppetlabs.net:81', 'puppetlabs.com' plat.install_build_dependencies_with "pkg install ", " || [[ $? -eq 4 ]]" # PA-5702 override default directory to exclude 'i386' directory plat.output_dir File.join("solaris", "11", "puppet8") end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/macos-all-arm64.rb
packaging/configs/platforms/macos-all-arm64.rb
platform 'macos-all-arm64' do |plat| plat.inherit_from_default packages = %w[cmake pkg-config yaml-cpp] # We uninstall in case they are already installed, since GitHub Actions runners # will already have their own version and we want the homebrew core version. # We do || true so it doesn't fail if the packages don't exist. We have to do # it one by one because brew will not process the rest if one doesn't exist. packages.each do |pkg| plat.provision_with "brew uninstall #{pkg} 2>/dev/null || true && brew install #{pkg}" end plat.output_dir File.join('macos', 'all', 'arm64') end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/debian-13-amd64.rb
packaging/configs/platforms/debian-13-amd64.rb
platform "debian-13-amd64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/el-10-aarch64.rb
packaging/configs/platforms/el-10-aarch64.rb
platform "el-10-aarch64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/debian-11-aarch64.rb
packaging/configs/platforms/debian-11-aarch64.rb
platform "debian-11-aarch64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/fedora-42-x86_64.rb
packaging/configs/platforms/fedora-42-x86_64.rb
platform 'fedora-42-x86_64' do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false
OpenVoxProject/openvox
https://github.com/OpenVoxProject/openvox/blob/9336df16a11679d701a2bd9ebe1308d4fb669f57/packaging/configs/platforms/el-9-aarch64.rb
packaging/configs/platforms/el-9-aarch64.rb
platform "el-9-aarch64" do |plat| plat.inherit_from_default end
ruby
Apache-2.0
9336df16a11679d701a2bd9ebe1308d4fb669f57
2026-01-04T17:47:45.967003Z
false