Changeset View
Changeset View
Standalone View
Standalone View
site-modules/profile/manifests/netbox.pp
Show All 23 Lines | class profile::netbox { | ||||
$archive_url = "https://github.com/netbox-community/netbox/archive/v${version}.tar.gz" | $archive_url = "https://github.com/netbox-community/netbox/archive/v${version}.tar.gz" | ||||
$archive_path = "/opt/netbox-v${version}.tar.gz" | $archive_path = "/opt/netbox-v${version}.tar.gz" | ||||
$install_path = "/opt/netbox-${version}" | $install_path = "/opt/netbox-${version}" | ||||
$upgrade_flag_path = "${install_path}/.upgrade_done" | $upgrade_flag_path = "${install_path}/.upgrade_done" | ||||
ensure_packages ('python3-venv') | ensure_packages ('python3-venv') | ||||
include ::postgresql::server | |||||
::postgresql::server::db {$db_database: | |||||
user => $db_username, | |||||
password => postgresql::postgresql_password($db_username, $db_password), | |||||
require => [Class['Postgresql::Server']], | |||||
} | |||||
class { '::redis' : | class { '::redis' : | ||||
requirepass => $redis_password, | requirepass => $redis_password, | ||||
bind => '127.0.0.1', | bind => '127.0.0.1', | ||||
port => $redis_port, | port => $redis_port, | ||||
} | } | ||||
user {$netbox_user: | user {$netbox_user: | ||||
ensure => present, | ensure => present, | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | class profile::netbox { | ||||
exec { 'netbox-upgrade': | exec { 'netbox-upgrade': | ||||
command => "${install_path}/upgrade.sh", | command => "${install_path}/upgrade.sh", | ||||
cwd => $install_path, | cwd => $install_path, | ||||
creates => $upgrade_flag_path, | creates => $upgrade_flag_path, | ||||
require => [File['netbox-configuration'], | require => [File['netbox-configuration'], | ||||
File[$media_directory], | File[$media_directory], | ||||
Package['python3-venv'], | Package['python3-venv'], | ||||
Postgresql::Server::Db[$db_database], | |||||
], | ], | ||||
notify => Exec['netbox-flag-upgrade-done'], | notify => Exec['netbox-flag-upgrade-done'], | ||||
} | } | ||||
exec {'netbox-flag-upgrade-done': | exec {'netbox-flag-upgrade-done': | ||||
command => "touch ${upgrade_flag_path}", | command => "touch ${upgrade_flag_path}", | ||||
path => '/usr/bin', | path => '/usr/bin', | ||||
refreshonly => true, | refreshonly => true, | ||||
Show All 25 Lines |