Commit 56b8204d authored by Rane Squires's avatar Rane Squires

change name var references to custom variable name_

parent f027e327
Pipeline #75 canceled with stages
...@@ -18,7 +18,10 @@ class matlab::install( # $namevar matlab release version ...@@ -18,7 +18,10 @@ class matlab::install( # $namevar matlab release version
#$vardir = $::matlab::vardir::module_vardir # with trailing slash #$vardir = $::matlab::vardir::module_vardir # with trailing slash
$vardir = "/opt/matlab_install" $vardir = "/opt/matlab_install"
$install_destination = "${prefix}/MATLAB/${name}" # individual install name
$name_ = 'R2019a'
$install_destination = "${prefix}/MATLAB/${name_}"
# does user accept license ? # does user accept license ?
$agree = $licenseagree ? { $agree = $licenseagree ? {
...@@ -38,7 +41,7 @@ class matlab::install( # $namevar matlab release version ...@@ -38,7 +41,7 @@ class matlab::install( # $namevar matlab release version
} }
# make folder to mount on # make folder to mount on
file { "/mnt/matlab-${name}": file { "/mnt/matlab-${name_}":
ensure => directory, # make sure this is a directory ensure => directory, # make sure this is a directory
recurse => false, # don't manage directory recurse => false, # don't manage directory
purge => false, # don't purge unmanaged files purge => false, # don't purge unmanaged files
...@@ -53,50 +56,50 @@ class matlab::install( # $namevar matlab release version ...@@ -53,50 +56,50 @@ class matlab::install( # $namevar matlab release version
# get iso to mountUpdate Puppetfile # get iso to mountUpdate Puppetfile
# TODO: since there seem to be different iso's for each version, maybe # TODO: since there seem to be different iso's for each version, maybe
# we should add a unique identifier based on the $iso variable here. # we should add a unique identifier based on the $iso variable here.
file { "${vardir}/MATHWORKS-${name}.iso": file { "${vardir}/MATHWORKS-${name_}.iso":
ensure => present, ensure => present,
owner => root, owner => root,
group => root, group => root,
mode => '0600', # u=rw,go= mode => '0600', # u=rw,go=
backup => false, # don't backup to filebucket! backup => false, # don't backup to filebucket!
source => $iso, source => $iso,
alias => "matlab_iso.${name}", alias => "matlab_iso.${name_}",
require => File["/mnt/matlab-${name}"], require => File["/mnt/matlab-${name_}"],
} }
# mount! # mount!
# TODO: replace this mount with an exec that has an: # TODO: replace this mount with an exec that has an:
# onlyif => the_binary_is_not_installed so that a normal machine # onlyif => the_binary_is_not_installed so that a normal machine
# doesn't need to have the iso mounted all the time... # doesn't need to have the iso mounted all the time...
mount { "/mnt/matlab-${name}": mount { "/mnt/matlab-${name_}":
ensure => mounted, ensure => mounted,
atboot => true, atboot => true,
device => "${vardir}/MATHWORKS-${name}.iso", device => "${vardir}/MATHWORKS-${name_}.iso",
fstype => 'iso9660', fstype => 'iso9660',
options => 'loop,ro', options => 'loop,ro',
dump => '0', # fs_freq: 0 to skip file system dumps dump => '0', # fs_freq: 0 to skip file system dumps
pass => '0', # fs_passno: 0 to skip fsck on boot pass => '0', # fs_passno: 0 to skip fsck on boot
alias => "matlab_mount.${name}", alias => "matlab_mount.${name_}",
require => [File["matlab_iso.${name}"]], require => [File["matlab_iso.${name_}"]],
} }
# build installer parameters file in our scratch directory # build installer parameters file in our scratch directory
file { "${vardir}/installer_input.txt.${name}": file { "${vardir}/installer_input.txt.${name_}":
ensure => present, ensure => present,
owner => root, owner => root,
group => root, group => root,
mode => '0600', # u=rw,go=r mode => '0600', # u=rw,go=r
require => Mount["matlab_mount.${name}"], require => Mount["matlab_mount.${name_}"],
content => epp('matlab/installer_input.txt.epp'), content => epp('matlab/installer_input.txt.epp'),
alias => "matlab_input.${name}", alias => "matlab_input.${name_}",
} }
# install matlab # install matlab
exec { "/mnt/matlab-${name}/install -inputFile ${vardir}/installer_input.txt.${name}": exec { "/mnt/matlab-${name_}/install -inputFile ${vardir}/installer_input.txt.${name_}":
logoutput => on_failure, logoutput => on_failure,
creates => $install_destination, # when this folder appears, we assume it got installed creates => $install_destination, # when this folder appears, we assume it got installed
require => File["matlab_input.${name}"], require => File["matlab_input.${name_}"],
alias => "matlab_install.${name}", alias => "matlab_install.${name_}",
} }
# create 'licenses' directory # create 'licenses' directory
...@@ -109,7 +112,7 @@ class matlab::install( # $namevar matlab release version ...@@ -109,7 +112,7 @@ class matlab::install( # $namevar matlab release version
group => root, group => root,
mode => '0644', mode => '0644',
backup => false, # don't backup to filebucket backup => false, # don't backup to filebucket
require => Exec["matlab_install.${name}"], require => Exec["matlab_install.${name_}"],
} }
# copy over license file to activate # copy over license file to activate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment