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

Remove legacy facts #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion manifests/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$dpkg_opts = '-o DPkg::Options="--force-confold"',
$cache = '/var/cache/apt',
){
if $::osfamily != 'Debian' {
if $facts['os']['family'] != 'Debian' {
fail("This class only supported on Debian-based platforms.\n")
}

Expand Down
18 changes: 9 additions & 9 deletions manifests/apt/mirror.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,47 @@
$repositories = [
{
'uri' => $uri,
'distribution' => $::lsbdistcodename,
'distribution' => $facts['os']['distro']['codename'],
'components' => ['main', 'restricted'],
},
{
'uri' => $uri,
'distribution' => "${::lsbdistcodename}-updates",
'distribution' => "${facts['os']['distro']['codename']}-updates",
'components' => ['main', 'restricted'],
},
{
'uri' => $uri,
'distribution' => $::lsbdistcodename,
'distribution' => $facts['os']['distro']['codename'],
'components' => 'universe',
},
{
'uri' => $uri,
'distribution' => "${::lsbdistcodename}-updates",
'distribution' => "${facts['os']['distro']['codename']}-updates",
'components' => 'universe',
},
{
'uri' => $uri,
'distribution' => $::lsbdistcodename,
'distribution' => $facts['os']['distro']['codename'],
'components' => 'multiverse',
},
{
'uri' => $uri,
'distribution' => "${::lsbdistcodename}-updates",
'distribution' => "${facts['os']['distro']['codename']}-updates",
'components' => 'multiverse',
},
{
'uri' => $uri,
'distribution' => "${::lsbdistcodename}-security",
'distribution' => "${facts['os']['distro']['codename']}-security",
'components' => ['main', 'restricted'],
},
{
'uri' => $uri,
'distribution' => "${::lsbdistcodename}-security",
'distribution' => "${facts['os']['distro']['codename']}-security",
'components' => 'universe',
},
{
'uri' => $uri,
'distribution' => "${::lsbdistcodename}-security",
'distribution' => "${facts['os']['distro']['codename']}-security",
'components' => 'multiverse',
},
]
Expand Down
4 changes: 2 additions & 2 deletions manifests/bash/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Platform-dependent parameters for the bash shell.
#
class sys::bash::params {
case $::osfamily {
case $facts['os']['family'] {
darwin: {
# Bash is included by default on OS X.
$package = false
Expand Down Expand Up @@ -36,7 +36,7 @@
$defpath = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
}
default: {
fail("Don't know how to install bash on ${::osfamily}.\n")
fail("Don't know how to install bash on ${facts['os']['family']}.\n")
}
}
}
4 changes: 2 additions & 2 deletions manifests/bash/rc.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
$extra = undef,
$path = undef,
$pythonpath = undef,
$template = "sys/bash/${::osfamily}.erb",
$template = "sys/bash/${facts['os']['family']}.erb",
) {
include sys::bash

Expand Down Expand Up @@ -104,7 +104,7 @@
require => File["${homedir}/.bashrc"],
}

if $::operatingsystem == 'Solaris' {
if $facts['os']['name'] == 'Solaris' {
file { "${homedir}/.zfs_completion":
ensure => $file_ensure,
mode => '0600',
Expand Down
2 changes: 1 addition & 1 deletion manifests/curl/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Platform-dependent parameters for curl.
#
class sys::curl::params {
case $::osfamily {
case $facts['os']['family'] {
darwin: {
# Curl included by default on OS X.
$package = false
Expand Down
2 changes: 1 addition & 1 deletion manifests/dkms.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
fail("DKMS support is only for Linux kernels.\n")
}

if $::osfamily == 'RedHat' {
if $facts['os']['family'] == 'RedHat' {
# DKMS is in EPEL.
include sys::redhat::epel
Class['sys::redhat::epel'] -> Package[$package]
Expand Down
6 changes: 3 additions & 3 deletions manifests/fetch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
$user = undef,
) {

if ($redownload and $::osfamily != 'windows') {
if ($redownload and $facts['os']['family'] != 'windows') {
$unless = "test -s ${destination}"
$creates = undef
} else {
$unless = undef
$creates = $destination
}

case $::osfamily {
case $facts['os']['family'] {
darwin: {
# Use cURL on OS X.
if $cert_check {
Expand Down Expand Up @@ -83,7 +83,7 @@
}
}

if $::osfamily == 'windows' {
if $facts['os']['family'] == 'windows' {
$command = "(New-Object Net.WebClient).DownloadFile('${source}', '${destination}')"
} else {
# Constructing download options string using stdlib's `join` function.
Expand Down
4 changes: 2 additions & 2 deletions manifests/gcc/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Platform-dependent parameters for GCC.
#
class sys::gcc::params {
case $::osfamily {
case $facts['os']['family'] {
openbsd: {
# GCC included by default on OpenBSD.
$packages = false
Expand All @@ -18,7 +18,7 @@
$packages = ['gcc', 'gcc-c++', 'make']
}
default: {
fail("Do not know how to install/configure GCC on ${::osfamily}.\n")
fail("Do not know how to install/configure GCC on ${facts['os']['family']}.\n")
}
}
}
4 changes: 2 additions & 2 deletions manifests/git.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
$win_path = $sys::git::params::win_path,
) inherits sys::git::params {
# Extra gymnastics necessary if on windows.
if $::osfamily == 'windows' {
if $facts['os']['family'] == 'windows' {
# If a source is passed in, use it -- this can be a HTTP URL or UNC.
if $source {
$source_uri = $source
Expand Down Expand Up @@ -66,7 +66,7 @@
require => Package[$package],
}

if $::architecture == 'x64' {
if $facts['os']['architecture'] == 'x64' {
# Git now has native 64-bit support, remove 32-path.
windows::path { 'git-path-legacy':
ensure => absent,
Expand Down
6 changes: 3 additions & 3 deletions manifests/git/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Platform-dependent parameters for git.
#
class sys::git::params {
case $::osfamily {
case $facts['os']['family'] {
openbsd: {
include sys::openbsd::pkg
$package = 'git'
Expand All @@ -25,7 +25,7 @@
$release_tag = "v${version}.windows.1"
$base_url = "https://github.com/git-for-windows/git/releases/download/${release_tag}/"

if $::architecture == 'x64' {
if $facts['os']['architecture'] == 'x64' {
$basename = "Git-${version}-64-bit.exe"
} else {
$basename = "Git-${version}-32-bit.exe"
Expand All @@ -36,7 +36,7 @@
$win_path = 'C:\Program Files\Git\cmd'
}
default: {
fail("Do not know how to install git on ${::osfamily}.\n")
fail("Do not know how to install git on ${facts['os']['family']}.\n")
}
}
}
4 changes: 2 additions & 2 deletions manifests/htop/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# Platform-dependent parameters for installing htop.
#
class sys::htop::params {
case $::osfamily {
case $facts['os']['family'] {
debian: {
$package = 'htop'
}
redhat: {
$package = 'htop'
}
default: {
fail("Do not know how to install htop on ${::osfamily}.")
fail("Do not know how to install htop on ${facts['os']['family']}.")
}
}
}
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
class sys {
# Settings for the root and binary groups.
case $::osfamily {
case $facts['os']['family'] {
darwin: {
$binary_group = 'wheel'
$root_group = 'wheel'
Expand All @@ -34,7 +34,7 @@
}

# The root home directory is different on OS X.
case $::osfamily {
case $facts['os']['family'] {
darwin: {
$root_home = '/var/root'
}
Expand All @@ -44,7 +44,7 @@
}

# If we're on Debian-based systems, they use 'nogroup' instead of 'nobody'.
case $::osfamily {
case $facts['os']['family'] {
debian: {
$nobody_group = 'nogroup'
}
Expand Down
6 changes: 3 additions & 3 deletions manifests/luks/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# Platform-dependent parameters for LUKS.
#
class sys::luks::params {
case $::osfamily {
case $facts['os']['family'] {
debian: {
$package = 'cryptsetup'
}
redhat: {
case $::operatingsystemmajrelease {
case $facts['os']['release']['major'] {
7: {
$package = 'cryptsetup'
}
Expand All @@ -21,7 +21,7 @@
$package = 'cryptsetup'
}
default: {
fail("Do not know how to install LUKS on ${::osfamily}.\n")
fail("Do not know how to install LUKS on ${facts['os']['family']}.\n")
}
}
}
4 changes: 2 additions & 2 deletions manifests/nfs/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Platform-independent parameters for installing NFS client and/or server.
#
class sys::nfs::params {
case $::osfamily {
case $facts['os']['family'] {
darwin: {
# NFS client and server built-in to OS X.
$client = false
Expand All @@ -26,7 +26,7 @@
$provider = 'pkg'
}
default: {
fail("Do not know how to install NFS on ${::osfamily}\n")
fail("Do not know how to install NFS on ${facts['os']['family']}\n")
}
}
}
2 changes: 1 addition & 1 deletion manifests/openbsd/dnsmasq.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
$config = '/etc/dnsmasq.conf',
$cache_size = '750',
$default_lease = '24h',
$domain = $::domain,
$domain = $facts['networking']['domain'],
$expand_hosts = true,
$etc_hosts = '/etc/hosts',
$except_interfaces = [],
Expand Down
2 changes: 1 addition & 1 deletion manifests/openbsd/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
class sys::openbsd::params {
# The default mirror for OpenBSD packages.
$mirror = "http://ftp3.usa.openbsd.org/pub/OpenBSD/${::kernelmajversion}/packages/${::architecture}/"
$mirror = "http://ftp3.usa.openbsd.org/pub/OpenBSD/${::kernelmajversion}/packages/${facts['os']['architecture']}/"
}
4 changes: 2 additions & 2 deletions manifests/parted/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# Platform-dependent parameters for installing GNU parted.
#
class sys::parted::params {
case $::osfamily {
case $facts['os']['family'] {
debian: {
$package = 'parted'
}
redhat: {
$package = 'parted'
}
default: {
fail("Do not know how to install parted on ${::osfamily}.")
fail("Do not know how to install parted on ${facts['os']['family']}.")
}
}
}
4 changes: 2 additions & 2 deletions manifests/redhat/epel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
class sys::redhat::epel {
# Getting the right RPM depending on this RedHat release.
case $::operatingsystemrelease {
case $facts['os']['release']['full'] {
/^5\.\d+$/: {
$epel_name = 'epel-release-5-4'
$epel_rpm = "http://download.fedoraproject.org/pub/epel/5/i386/${epel_name}.noarch.rpm"
Expand All @@ -18,7 +18,7 @@
$epel_rpm = "http://download.fedoraproject.org/pub/epel/7/x86_64/e/${epel_name}.noarch.rpm"
}
default: {
fail("Do not know how to install EPEL on RedHat release: ${::operatingsystemrelease}.\n")
fail("Do not know how to install EPEL on RedHat release: ${facts['os']['release']['full']}.\n")
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/rsync/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$package = 'rsync'
$service = 'rsync'

case $::osfamily {
case $facts['os']['family'] {
openbsd: {
include sys::openbsd::pkg
$provider = undef
Expand Down
2 changes: 1 addition & 1 deletion manifests/screen/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Platform-dependent parameters for installing screen.
#
class sys::screen::params {
case $::osfamily {
case $facts['os']['family'] {
openbsd: {
include sys::openbsd::pkg
$package = 'screen'
Expand Down
2 changes: 1 addition & 1 deletion manifests/screen/rc.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$group = undef,
$home = undef,
$extra = undef,
$template = "sys/screen/${::osfamily}.erb",
$template = "sys/screen/${facts['os']['family']}.erb",
) {
include sys::screen

Expand Down
2 changes: 1 addition & 1 deletion manifests/solaris.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Module for Solaris 11 and Illumos derivatives (e.g., OpenIndiana, OmniOS).
#
class sys::solaris {
if $::osfamily != 'Solaris' or versioncmp($::kernelrelease, '5.11') < 0 {
if $facts['os']['family'] != 'Solaris' or versioncmp($::kernelrelease, '5.11') < 0 {
fail('Only Solaris 11+ and Illumos kernels are supported.\n')
}

Expand Down
Loading