Sha256: b0e495e17e1c49e61ee84752cecd0884a5f57ef027c9a6e1ec0a51b829b23421

Contents?: true

Size: 816 Bytes

Versions: 29

Compression:

Stored size: 816 Bytes

Contents

desc 'Create RHEL/OracleLinux/Scientific factsets from CentOS factsets'
task :rhel_alts do
  Dir[File.join(__dir__, '..', 'facts', '*', 'centos-*-x86_64.facts')].each do |f|
    centos_factset = File.read(f)

    rhel_path = f.gsub(%r{centos-}, 'redhat-')
    File.open(rhel_path, 'w') do |fd|
      fd.puts centos_factset.gsub(%r{CentOS}, 'RedHat')
    end

    oracle_path = f.gsub(%r{centos-}, 'oraclelinux-')
    File.open(oracle_path, 'w') do |fd|
      fd.puts centos_factset.gsub(%r{CentOS}, 'OracleLinux')
    end

    # Scientific isn't going to be updated to 8
    if File.basename(f)[%r{-(\d+)-}, 1].to_i <= 7
      scientific_path = f.gsub(%r{centos-}, 'scientific-')
      File.open(scientific_path, 'w') do |fd|
        fd.puts centos_factset.gsub(%r{CentOS}, 'Scientific')
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
facterdb-1.21.0 rakelib/rhel_alts.rake
facterdb-1.20.0 rakelib/rhel_alts.rake
facterdb-1.19.0 rakelib/rhel_alts.rake
facterdb-1.18.0 rakelib/rhel_alts.rake
facterdb-1.17.0 rakelib/rhel_alts.rake
facterdb-1.16.1 rakelib/rhel_alts.rake
facterdb-1.16.0 rakelib/rhel_alts.rake
facterdb-1.15.0 rakelib/rhel_alts.rake
facterdb-1.14.0 rakelib/rhel_alts.rake
facterdb-1.13.0 rakelib/rhel_alts.rake
facterdb-1.12.2 rakelib/rhel_alts.rake
facterdb-1.12.1 rakelib/rhel_alts.rake
facterdb-1.12.0 rakelib/rhel_alts.rake
facterdb-1.11.0 rakelib/rhel_alts.rake
facterdb-1.10.1 rakelib/rhel_alts.rake
facterdb-1.10.0 rakelib/rhel_alts.rake
facterdb-1.9.0 rakelib/rhel_alts.rake
facterdb-1.8.0 rakelib/rhel_alts.rake
facterdb-1.7.0 rakelib/rhel_alts.rake
facterdb-1.6.0 rakelib/rhel_alts.rake