Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new facts for 4.3 and 4.4 and a few stragglers for 4.1 #272

Merged
merged 1 commit into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
244 changes: 122 additions & 122 deletions README.md

Large diffs are not rendered by default.

582 changes: 582 additions & 0 deletions facts/4.1/centos-7-x86_64.facts

Large diffs are not rendered by default.

519 changes: 519 additions & 0 deletions facts/4.1/debian-10-x86_64.facts

Large diffs are not rendered by default.

551 changes: 551 additions & 0 deletions facts/4.3/almalinux-8-x86_64.facts

Large diffs are not rendered by default.

525 changes: 525 additions & 0 deletions facts/4.3/almalinux-9-x86_64.facts

Large diffs are not rendered by default.

592 changes: 592 additions & 0 deletions facts/4.3/centos-7-x86_64.facts

Large diffs are not rendered by default.

526 changes: 526 additions & 0 deletions facts/4.3/debian-10-x86_64.facts

Large diffs are not rendered by default.

521 changes: 521 additions & 0 deletions facts/4.3/debian-11-x86_64.facts

Large diffs are not rendered by default.

507 changes: 507 additions & 0 deletions facts/4.3/fedora-36-x86_64.facts

Large diffs are not rendered by default.

512 changes: 512 additions & 0 deletions facts/4.3/fedora-37-x86_64.facts

Large diffs are not rendered by default.

533 changes: 533 additions & 0 deletions facts/4.3/opensuse-15-x86_64.facts

Large diffs are not rendered by default.

526 changes: 526 additions & 0 deletions facts/4.3/redhat-8-x86_64.facts

Large diffs are not rendered by default.

545 changes: 545 additions & 0 deletions facts/4.3/rocky-8-x86_64.facts

Large diffs are not rendered by default.

626 changes: 626 additions & 0 deletions facts/4.3/rocky-9-x86_64.facts

Large diffs are not rendered by default.

908 changes: 908 additions & 0 deletions facts/4.3/sles-12-x86_64.facts

Large diffs are not rendered by default.

557 changes: 557 additions & 0 deletions facts/4.3/ubuntu-18.04-x86_64.facts

Large diffs are not rendered by default.

647 changes: 647 additions & 0 deletions facts/4.3/ubuntu-20.04-x86_64.facts

Large diffs are not rendered by default.

655 changes: 655 additions & 0 deletions facts/4.3/ubuntu-22.04-x86_64.facts

Large diffs are not rendered by default.

551 changes: 551 additions & 0 deletions facts/4.4/almalinux-8-x86_64.facts

Large diffs are not rendered by default.

525 changes: 525 additions & 0 deletions facts/4.4/almalinux-9-x86_64.facts

Large diffs are not rendered by default.

592 changes: 592 additions & 0 deletions facts/4.4/centos-7-x86_64.facts

Large diffs are not rendered by default.

526 changes: 526 additions & 0 deletions facts/4.4/debian-10-x86_64.facts

Large diffs are not rendered by default.

521 changes: 521 additions & 0 deletions facts/4.4/debian-11-x86_64.facts

Large diffs are not rendered by default.

507 changes: 507 additions & 0 deletions facts/4.4/fedora-36-x86_64.facts

Large diffs are not rendered by default.

512 changes: 512 additions & 0 deletions facts/4.4/fedora-37-x86_64.facts

Large diffs are not rendered by default.

514 changes: 514 additions & 0 deletions facts/4.4/opensuse-15-x86_64.facts

Large diffs are not rendered by default.

526 changes: 526 additions & 0 deletions facts/4.4/redhat-8-x86_64.facts

Large diffs are not rendered by default.

545 changes: 545 additions & 0 deletions facts/4.4/rocky-8-x86_64.facts

Large diffs are not rendered by default.

626 changes: 626 additions & 0 deletions facts/4.4/rocky-9-x86_64.facts

Large diffs are not rendered by default.

908 changes: 908 additions & 0 deletions facts/4.4/sles-12-x86_64.facts

Large diffs are not rendered by default.

557 changes: 557 additions & 0 deletions facts/4.4/ubuntu-18.04-x86_64.facts

Large diffs are not rendered by default.

647 changes: 647 additions & 0 deletions facts/4.4/ubuntu-20.04-x86_64.facts

Large diffs are not rendered by default.

655 changes: 655 additions & 0 deletions facts/4.4/ubuntu-22.04-x86_64.facts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion facts/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "centos-7-x86_64" do |host|
host.vm.box = "centos/7"
host.vm.network :private_network, ip: '10.0.0.2'
host.vm.synced_folder ".", "/vagrant", :nfs => true
host.vm.synced_folder ".", "/vagrant", :nfs => true, :nfs_udp => false
host.vm.provision "shell", inline: "yum -y install ruby-devel gcc wget net-tools"
host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
host.vm.provision "shell", path: "get_facts.sh"
Expand Down
68 changes: 60 additions & 8 deletions facts/get_facts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ case "${osfamily}" in
wget "http://yum.puppetlabs.com/puppet7-release-el-${operatingsystemmajrelease}.noarch.rpm" -O /tmp/puppet7-release.rpm
if test -f /tmp/puppet7-release.rpm; then
rpm -ivh /tmp/puppet7-release.rpm
for puppet_agent_version in 7.5.0 7.6.1 7.17.0; do
for puppet_agent_version in 7.5.0 7.6.1 7.17.0 7.24.0; do
if yum install -y puppet-agent-${puppet_agent_version}; then
output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
mkdir -p $(dirname ${output_file})
Expand All @@ -74,15 +74,29 @@ case "${osfamily}" in
done
yum remove -y puppet7-release
fi
wget "http://yum.puppetlabs.com/puppet8-release-el-${operatingsystemmajrelease}.noarch.rpm" -O /tmp/puppet8-release.rpm
if test -f /tmp/puppet8-release.rpm; then
rpm -ivh /tmp/puppet8-release.rpm
for puppet_agent_version in 8.0.0; do
if yum install -y puppet-agent-${puppet_agent_version}; then
output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter os.name | tr '[:upper:]' '[:lower:]')-$(facter os.release.major)-$(facter os.hardware).facts"
mkdir -p $(dirname ${output_file})
facter --show-legacy -p -j | tee ${output_file}
fi
done
yum remove -y puppet8-release
fi
;;
'Debian')
apt_install curl
apt_install curl file
curl "https://apt.puppetlabs.com/puppet6-release-${lsbdistcodename}.deb" -o /tmp/puppet6-release.deb
# apt.puppetlabs.com returns an html document if the requested deb doesn't exist and /tmp/puppet6-release.deb will be an html doc
if test "$?" -eq 0 -a -f /tmp/puppet6-release.deb && [[ "$(file -b /tmp/puppet6-release.deb)" =~ "Debian binary package".* ]] ; then
dpkg --install /tmp/puppet6-release.deb
apt-get update
for puppet_agent_version in 6.2 6.4 6.6; do
# as of 2023-04-27 older 6.x series aren't available (i.e. facter 3.12)
# the trailing dot is so that 6.4.* is the match so we get the last in the 6.4 series and not 6.40
for puppet_agent_version in 6.4. 6.28.; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given that Puppet 6 is EoL I would be fine with dropping the whole logic after we merged this PR.

if apt_install puppet-agent=${puppet_agent_version}*; then
output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
mkdir -p $(dirname ${output_file})
Expand All @@ -93,10 +107,10 @@ case "${osfamily}" in
fi
curl "https://apt.puppetlabs.com/puppet7-release-${lsbdistcodename}.deb" -o /tmp/puppet7-release.deb
# apt.puppetlabs.com returns an html document if the requested deb doesn't exist and /tmp/puppet6-release.deb will be an html doc
if test "$?" -eq 0 -a -f /tmp/puppet7-release.deb && [[ "$(file -b /tmp/puppet6-release.deb)" =~ "Debian binary package".* ]] ; then
if test "$?" -eq 0 -a -f /tmp/puppet7-release.deb && [[ "$(file -b /tmp/puppet7-release.deb)" =~ "Debian binary package".* ]] ; then
dpkg --install /tmp/puppet7-release.deb
apt-get update
for puppet_agent_version in 7.5.0 7.6.1 7.12.0; do
for puppet_agent_version in 7.5.0 7.6.1 7.12.0 7.24.0; do
if apt_install puppet-agent=${puppet_agent_version}*; then
output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
mkdir -p $(dirname ${output_file})
Expand All @@ -105,7 +119,22 @@ case "${osfamily}" in
done
apt-get -y remove --purge puppet7-release
fi
apt_install make gcc libgmp-dev
curl "https://apt.puppetlabs.com/puppet8-release-${lsbdistcodename}.deb" -o /tmp/puppet8-release.deb
# apt.puppetlabs.com returns an html document if the requested deb doesn't exist and /tmp/puppet6-release.deb will be an html doc
if test "$?" -eq 0 -a -f /tmp/puppet8-release.deb && [[ "$(file -b /tmp/puppet8-release.deb)" =~ "Debian binary package".* ]] ; then
dpkg --install /tmp/puppet8-release.deb
apt-get update
for puppet_agent_version in 8.0.0; do
if apt_install puppet-agent=${puppet_agent_version}*; then
output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter os.name | tr '[:upper:]' '[:lower:]')-$(facter os.release.major)-$(facter os.hardware).facts"
mkdir -p $(dirname ${output_file})
facter --show-legacy -p -j | tee ${output_file}
fi
done
apt-get -y remove --purge puppet8-release
fi
# libc6-dev needed to build the ffi gem
apt_install make gcc libgmp-dev libc6-dev

# There are no puppet-agent packages for $releasename yet, so generate a Facter 3.x
# fact set from the official Debian package.
Expand Down Expand Up @@ -151,7 +180,7 @@ case "${osfamily}" in
http_method='https'
fi
if rpm -Uvh ${http_method}://yum.puppet.com/puppet6-release-sles-${operatingsystemmajrelease}.noarch.rpm; then
for puppet_agent_version in 6.2.0 6.4.2 6.6.0; do
for puppet_agent_version in 6.25.0 6.27.1; do
if zypper --gpg-auto-import-keys --non-interactive install puppet-agent-${puppet_agent_version}; then
output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
mkdir -p $(dirname ${output_file})
Expand All @@ -160,6 +189,26 @@ case "${osfamily}" in
done
zypper --non-interactive remove puppet6-release
fi
if rpm -Uvh ${http_method}://yum.puppet.com/puppet7-release-sles-${operatingsystemmajrelease}.noarch.rpm; then
for puppet_agent_version in 7.5.0 7.6.1 7.12.0 7.24.0; do
if zypper --gpg-auto-import-keys --non-interactive install puppet-agent-${puppet_agent_version}; then
output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
mkdir -p $(dirname ${output_file})
facter --show-legacy -p -j | tee ${output_file}
fi
done
zypper --non-interactive remove puppet7-release
fi
if rpm -Uvh ${http_method}://yum.puppet.com/puppet8-release-sles-${operatingsystemmajrelease}.noarch.rpm; then
for puppet_agent_version in 8.0.0; do
if zypper --gpg-auto-import-keys --non-interactive install puppet-agent-${puppet_agent_version}; then
output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
mkdir -p $(dirname ${output_file})
facter --show-legacy -p -j | tee ${output_file}
fi
done
zypper --non-interactive remove puppet8-release
fi
;;
'Archlinux')
pacman -Syu --noconfirm ruby puppet ruby-bundler base-devel dnsutils facter
Expand All @@ -174,6 +223,9 @@ case "${osfamily}" in
facter --show-legacy -p -j | tee ${output_file}
esac

# this lower section relies on the ruby version and facter version that came
# with the last installed puppet_agent per above
# puppet-agent 8.0.0 has ruby 3.2.2 and it cant install 4.0.0, 4.1.0 facter gem
operatingsystem=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
operatingsystemrelease=$(facter operatingsystemrelease)
operatingsystemmajrelease=$(facter operatingsystemmajrelease)
Expand All @@ -190,7 +242,7 @@ else
fi
bundle install --path vendor/bundler

for version in 4.0.0 4.1.0 4.2.0; do
for version in 4.0.0 4.1.0 4.2.0 4.3.0 4.4.0; do
FACTER_GEM_VERSION="~> ${version}" bundle update
# sometimes all versions of facter are not possible, if the bundle update fails, skip the rest of the loop
if [ $? -ne 0 ]; then
Expand Down