File tree Expand file tree Collapse file tree 6 files changed +26
-1
lines changed Expand file tree Collapse file tree 6 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 111111#
112112# $tftp_replace_grub2_cfg:: Determines if grub2.cfg will be replaced
113113#
114+ # $system_image_root:: TFTP system image root directory
115+ #
114116# $dhcp:: Enable DHCP feature
115117#
116118# $dhcp_listen_on:: DHCP proxy to listen on https, http, or both
334336 Boolean $tftp_managed = true ,
335337 Boolean $tftp_manage_wget = true ,
336338 Optional[Stdlib::Absolutepath] $tftp_root = $foreman_proxy::params::tftp_root,
339+ Optional[Stdlib::Absolutepath] $system_image_root = $foreman_proxy::params::system_image_root,
337340 Optional[Array[Stdlib::Absolutepath]] $tftp_dirs = undef ,
338341 Optional[String] $tftp_servername = undef ,
339342 Boolean $tftp_replace_grub2_cfg = false ,
Original file line number Diff line number Diff line change 88#
99# @param tftproot
1010# The root directory to use. This is required if the module is enabled.
11+ #
12+ # @param system_image_root
13+ # The system image root directory to use. This is required if the module
14+ # is supposed to download and extract OS image files.
1115class foreman_proxy::module::tftp (
1216 Boolean $enabled = $foreman_proxy::tftp,
1317 Foreman_proxy::ListenOn $listen_on = $foreman_proxy::tftp_listen_on,
1418 Optional[Stdlib::Absolutepath] $tftproot = $foreman_proxy::tftp_root,
19+ Optional[Stdlib::Absolutepath] $system_image_root = $foreman_proxy::system_image_root,
1520) {
1621 if $enabled {
1722 assert_type(NotUndef, $tftproot )
23+ assert_type(NotUndef, $system_image_root )
1824 }
1925
2026 foreman_proxy::module { 'tftp' :
Original file line number Diff line number Diff line change 33class foreman_proxy::tftp (
44 String[1] $user = $foreman_proxy::user,
55 Optional[Stdlib::Absolutepath] $root = $foreman_proxy::tftp_root,
6+ Optional[Stdlib::Absolutepath] $system_image_root = $foreman_proxy::tftp_system_image_root,
67 Optional[Array[Stdlib::Absolutepath]] $directories = $foreman_proxy::tftp_dirs,
78 Array[Stdlib::Absolutepath] $syslinux_filenames = $foreman_proxy::params::tftp_syslinux_filenames,
89 Boolean $manage_wget = $foreman_proxy::tftp_manage_wget,
2425 recurse => true ,
2526 }
2627
28+ file { $system_image_root:
29+ ensure => directory ,
30+ owner => $user ,
31+ mode => ' 0644' ,
32+ }
33+
2734 file { "${tftp::root}/grub2/grub.cfg" :
2835 ensure => file ,
2936 owner => $user ,
Original file line number Diff line number Diff line change 3838 end
3939 end
4040
41+ let ( :system_image_root ) { '/var/lib/foreman-proxy/tftp/system_images' }
42+
4143 puppetca_command = "#{ puppet_path } cert *"
4244
4345 context 'without parameters' do
274276 '---' ,
275277 ':enabled: false' ,
276278 ":tftproot: #{ tftp_root } " ,
279+ ":system_image_root: #{ system_image_root } "
277280 ] )
278281 end
279282
434437 '---' ,
435438 ':enabled: https' ,
436439 ":tftproot: #{ tftp_root } " ,
440+ ":system_image_root: #{ system_image_root } "
437441 ] )
438442 end
439443
462466 '---' ,
463467 ':enabled: https' ,
464468 ':tftproot: /tftproot' ,
465- ':tftp_servername: 127.0.1.1'
469+ ':tftp_servername: 127.0.1.1' ,
470+ ':system_image_root: /var/lib/foreman-proxy/tftp/system_images}'
466471 ] )
467472 end
468473 end
Original file line number Diff line number Diff line change 1515
1616 it { is_expected . to contain_class ( 'foreman_proxy::tftp::netboot' ) }
1717
18+ system_image_root = '/var/lib/foreman-proxy/tftp/system_images'
1819 case facts [ :osfamily ]
1920 when 'Debian'
2021 tftp_root = '/srv/tftp'
Original file line number Diff line number Diff line change 1313# Defines the default certificate action for certificate checking.
1414# When false, the argument --no-check-certificate will be used.
1515#:verify_server_cert: true
16+
17+ # Defines the default folder to provide system images.
18+ :system_image_root: <%= scope.lookupvar("foreman_proxy::module::tftp::system_image_root") %>
You can’t perform that action at this time.
0 commit comments