feat: initial commit
This commit is contained in:
commit
38f495e3f4
457 changed files with 40577 additions and 0 deletions
48
environments/production/modules/garage/manifests/init.pp
Normal file
48
environments/production/modules/garage/manifests/init.pp
Normal file
|
@ -0,0 +1,48 @@
|
|||
class garage {
|
||||
contain garage::install
|
||||
contain garage::config
|
||||
contain garage::service
|
||||
|
||||
contain garage::webui
|
||||
}
|
||||
|
||||
class garage::install {
|
||||
file { '/opt/garage':
|
||||
ensure => directory,
|
||||
mode => '0640'
|
||||
}
|
||||
|
||||
file { '/opt/garage/garage':
|
||||
ensure => file,
|
||||
source => 'https://garagehq.deuxfleurs.fr/_releases/v1.1.0/x86_64-unknown-linux-musl/garage',
|
||||
mode => '0740'
|
||||
}
|
||||
}
|
||||
|
||||
class garage::config {
|
||||
file { '/opt/garage/garage.toml':
|
||||
content => template('garage/conf.toml.erb'),
|
||||
ensure => file,
|
||||
mode => '0644',
|
||||
notify => [Service['garage'], Service['garage-webui']]
|
||||
}
|
||||
}
|
||||
|
||||
class garage::service {
|
||||
file { '/lib/systemd/system/garage.service':
|
||||
mode => '0644',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
content => template('garage/garage.service.erb'),
|
||||
}~>
|
||||
exec { 'garage-systemd-reload':
|
||||
command => 'systemctl daemon-reload',
|
||||
path => [ '/usr/bin', '/bin', '/usr/sbin' ],
|
||||
refreshonly => true,
|
||||
}
|
||||
|
||||
service { 'garage':
|
||||
ensure => running,
|
||||
enable => true,
|
||||
}
|
||||
}
|
35
environments/production/modules/garage/manifests/webui.pp
Normal file
35
environments/production/modules/garage/manifests/webui.pp
Normal file
|
@ -0,0 +1,35 @@
|
|||
class garage::webui {
|
||||
contain garage::webui::install
|
||||
contain garage::webui::service
|
||||
}
|
||||
|
||||
class garage::webui::install {
|
||||
file { '/opt/garage-webui':
|
||||
ensure => directory
|
||||
}
|
||||
|
||||
file { '/opt/garage-webui/webui':
|
||||
source => 'https://github.com/khairul169/garage-webui/releases/download/1.0.8/garage-webui-v1.0.8-linux-amd64',
|
||||
ensure => 'file',
|
||||
mode => '0740',
|
||||
}
|
||||
}
|
||||
|
||||
class garage::webui::service {
|
||||
file { '/lib/systemd/system/garage-webui.service':
|
||||
mode => '0644',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
content => template('garage/garage-webui.service.erb'),
|
||||
}~>
|
||||
exec { 'garage-webui-systemd-reload':
|
||||
command => 'systemctl daemon-reload',
|
||||
path => [ '/usr/bin', '/bin', '/usr/sbin' ],
|
||||
refreshonly => true,
|
||||
}
|
||||
|
||||
service { 'garage-webui':
|
||||
ensure => running,
|
||||
enable => true,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue