Skip to content

Commit

Permalink
mod:hpc_apt: make APT foreign arch optional
Browse files Browse the repository at this point in the history
When $::hpc_apt::foreign_arch is not defined, the module should not try
to run the dpkg command (without argument).
  • Loading branch information
rezib committed Feb 14, 2017
1 parent 6c24b8b commit a0d53da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions puppet-config/modules/hpc_apt/manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
#
class hpc_apt::config inherits hpc_apt {

exec { 'add_foreign_arch':
command => "/usr/bin/dpkg --add-architecture ${::hpc_apt::foreign_arch}",
unless => "/usr/bin/dpkg --print-foreign-architectures | grep ${::hpc_apt::foreign_arch}",
if $::hpc_apt::foreign_arch {
exec { 'add_foreign_arch':
command => "/usr/bin/dpkg --add-architecture ${::hpc_apt::foreign_arch}",
unless => "/usr/bin/dpkg --print-foreign-architectures | grep ${::hpc_apt::foreign_arch}",
}
}

create_resources(apt::conf, $::hpc_apt::confs)
Expand Down
2 changes: 1 addition & 1 deletion puppet-config/modules/hpc_apt/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class hpc_apt (
$confs = {},
$sources = {},
$foreign_arch = '',
$foreign_arch = undef,
) {
include ::apt

Expand Down

0 comments on commit a0d53da

Please sign in to comment.