Skip to content

Commit

Permalink
puppet: Switch from top-level fact variables to facts dict, again.
Browse files Browse the repository at this point in the history
These were somehow missed in 57f8b48.
  • Loading branch information
alexmv authored and timabbott committed Apr 5, 2024
1 parent 7072794 commit 235e2ee
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion puppet/kandra/manifests/aws_tools.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

if ! $is_ec2 {
if $::os['architecture'] != 'amd64' {
if $facts['os']['architecture'] != 'amd64' {
# We would need to build aws_signing_helper from source
fail('Only amd64 hosts supported on non-EC2')
}
Expand Down
2 changes: 1 addition & 1 deletion puppet/kandra/manifests/ksplice_uptrack.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
mode => '0644',
content => template('kandra/uptrack/uptrack.conf.erb'),
}
$setup_apt_repo_file = "${::zulip_scripts_path}/lib/setup-apt-repo"
$setup_apt_repo_file = "${facts['zulip_scripts_path']}/lib/setup-apt-repo"
exec{ 'setup-apt-repo-ksplice':
command => "${setup_apt_repo_file} --list ksplice",
unless => "${setup_apt_repo_file} --list ksplice --verify",
Expand Down
4 changes: 2 additions & 2 deletions puppet/kandra/manifests/profile/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
mode => '0644',
source => 'puppet:///modules/kandra/apt/apt.conf.d/50unattended-upgrades',
}
if $::os['distro']['release']['major'] == '22.04' {
if $facts['os']['distro']['release']['major'] == '22.04' {
file { '/etc/needrestart/conf.d/zulip.conf':
ensure => file,
mode => '0644',
Expand Down Expand Up @@ -83,7 +83,7 @@
file { '/etc/chrony/chrony.conf':
ensure => file,
mode => '0644',
source => "puppet:///modules/kandra/chrony-${::os['distro']['release']['major']}.conf",
source => "puppet:///modules/kandra/chrony-${facts['os']['distro']['release']['major']}.conf",
require => Package['chrony'],
notify => Service['chrony'],
}
Expand Down
2 changes: 1 addition & 1 deletion puppet/kandra/manifests/teleport/base.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class kandra::teleport::base {
include zulip::supervisor

$setup_apt_repo_file = "${::zulip_scripts_path}/lib/setup-apt-repo"
$setup_apt_repo_file = "${facts['zulip_scripts_path']}/lib/setup-apt-repo"
exec{ 'setup-apt-repo-teleport':
command => "${setup_apt_repo_file} --list teleport",
unless => "${setup_apt_repo_file} --list teleport --verify",
Expand Down
1 change: 1 addition & 0 deletions puppet/kandra/manifests/teleport/db.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class kandra::teleport::db {
include kandra::teleport::base

$fqdn = $facts['networking']['fqdn']
$is_ec2 = zulipconf('machine', 'hosting_provider', 'ec2') == 'ec2'
$join_token = zulipsecret('secrets', 'teleport_join_token', '')
file { '/etc/teleport_db.yaml':
Expand Down
2 changes: 1 addition & 1 deletion puppet/kandra/manifests/vector.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$dir = "/srv/zulip-vector-${version}"
$bin = "${dir}/bin/vector"

$arch = $::os['architecture'] ? {
$arch = $facts['os']['architecture'] ? {
'amd64' => 'x86_64',
'aarch64' => 'aarch64',
}
Expand Down
5 changes: 3 additions & 2 deletions puppet/zulip/manifests/external_dep.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
String $sha256 = '',
String $mode = '0755',
) {
$arch = $facts['os']['architecture']
if $sha256 == '' {
if $zulip::common::versions[$title]['sha256'] =~ Hash {
$sha256_filled = $zulip::common::versions[$title]['sha256'][$::os['architecture']]
$sha256_filled = $zulip::common::versions[$title]['sha256'][$arch]
if $sha256_filled == undef {
err("No sha256 found for ${title} for architecture ${facts['os']['architecture']}")
err("No sha256 found for ${title} for architecture ${arch}")
fail()
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion puppet/zulip/manifests/postfix_localmail.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
include zulip::snakeoil
$postfix_packages = [ 'postfix', ]

$fqdn = $::networking['fqdn']
$fqdn = $facts['networking']['fqdn']
if $fqdn == '' {
fail('Your system does not have a fully-qualified domain name defined. See hostname(1).')
}
Expand Down

0 comments on commit 235e2ee

Please sign in to comment.