This repository was archived by the owner on Jan 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +44
-1
lines changed
Expand file tree Collapse file tree 4 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 3939 String $sha256sums_url = $consul::params::sha256sums_url,
4040 String $exporter_download_url = $consul::params::exporter_download_url,
4141 String $exporter_signature_url = $consul::params::exporter_signature_url,
42+ String $backinator_version = $consul::params::backinator_version,
43+ String $backinator_download_url = $consul::params::backinator_download_url,
44+ String $backinator_sha256 = $consul::params::backinator_sha256,
4245 Integer $uid = 871,
4346 Integer $gid = 871,
4447 String $user = ' consul' ,
Original file line number Diff line number Diff line change 2323 ' G'
2424 )
2525
26+ $backinator_download_url = regsubst(
27+ $consul::backinator_download_url ,
28+ ' #VERSION#' ,
29+ $consul::backinator_version ,
30+ ' G'
31+ )
32+
2633 # install unzip if necessary
2734 ensure_resource(' package' , ' unzip' , {})
2835
9198 }
9299 }
93100
101+
102+ archive {"${consul::_dest_dir}/consul-backinator" :
103+ ensure => present ,
104+ extract => false ,
105+ source => $backinator_download_url ,
106+ checksum => $consul::backinator_sha256 ,
107+ checksum_type => ' sha256' ,
108+ cleanup => false ,
109+ creates => " ${consul::_dest_dir} /consul-backinator" ,
110+ }
111+ -> file {" ${consul::_dest_dir} /consul-backinator" :
112+ ensure => file ,
113+ mode => ' 0755' ,
114+ }
115+ -> file {" ${consul::link_path} /${consul::app_name} -backinator" :
116+ ensure => link,
117+ target => " ${consul::_dest_dir} /consul-backinator" ,
118+ }
119+
94120 file { "${consul::_dest_dir}/consul-backup.sh" :
95121 ensure => file ,
96122 content => file (' consul/consul-backup.sh' ),
Original file line number Diff line number Diff line change 66class consul::params {
77 $app_name = ' consul'
88 $version = ' 1.2.1'
9+ $exporter_version = ' 0.3.0'
10+ $backinator_version = ' 1.3'
911 $download_dir = ' /tmp'
1012 $systemd_dir = ' /etc/systemd/system'
1113 $data_dir = ' /var/lib/consul'
1214 $config_dir = ' /etc/consul'
1315 $dest_dir = ' /opt'
14- $exporter_version = ' 0.3.0'
1516 $download_url = ' https://releases.hashicorp.com/consul/#VERSION#/consul_#VERSION#_linux_amd64.zip'
1617 $sha256sums_url = ' https://releases.hashicorp.com/consul/#VERSION#/consul_#VERSION#_SHA256SUMS'
1718 $signature_url = ' https://releases.hashicorp.com/consul/#VERSION#/consul_#VERSION#_SHA256SUMS.sig'
1819 $exporter_download_url = ' https://github.com/prometheus/consul_exporter/releases/download/v#VERSION#/consul_exporter-#VERSION#.linux-amd64.tar.gz'
1920 $exporter_signature_url = ' https://releases.tarmak.io/signatures/consul_exporter/#VERSION#/consul_exporter-#VERSION#.linux-amd64.tar.gz.asc'
21+ $backinator_download_url = ' https://github.com/myENA/consul-backinator/releases/download/v#VERSION#/consul-backinator-#VERSION#-amd64-linux.tar.gz'
22+ $backinator_sha256 = ' 8ea624487a86007825884685dbc978ba87f7a448f11d59b9eb29fd5b1b2a0e87'
2023}
Original file line number Diff line number Diff line change 4343 :target => '/opt/consul-1.2.1/consul-backup.sh' ,
4444 )
4545 end
46+
47+ it 'should install consul backinator' do
48+ should contain_file ( '/opt/consul-1.2.1/consul-backinator' ) . with (
49+ :ensure => 'file' ,
50+ :mode => '0755' ,
51+ )
52+ should contain_file ( '/opt/bin/consul-backinator' ) . with (
53+ :ensure => 'link' ,
54+ :target => '/opt/consul-1.2.1/consul-backinator' ,
55+ )
56+ end
4657 end
4758end
You can’t perform that action at this time.
0 commit comments