Skip to content

Commit

Permalink
Feature clean up manifests (#19)
Browse files Browse the repository at this point in the history
* clean up install.pp and also change pip and wheel to be ensure present

* clean up firewalld.pp

* clean up packages.pp

* clean up postgresql.pp

* clean up service.pp
  • Loading branch information
jortencio authored Jul 26, 2023
1 parent 1eee80b commit a4ca78f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 31 deletions.
3 changes: 1 addition & 2 deletions manifests/firewalld.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
zone => 'public',
port => $superset::port,
protocol => 'tcp',
}

}
}
37 changes: 14 additions & 23 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# @api private
#
class superset::install {

group { $superset::user :
ensure => present
ensure => present,
}

user { $superset::user:
Expand All @@ -24,7 +23,7 @@
owner => $superset::user,
group => $superset::user,
mode => '0755',
content => epp('superset/superset.sh.epp',{ superset_dir => $superset_venv_dir}),
content => epp('superset/superset.sh.epp', { superset_dir => $superset_venv_dir }),
}

# Create external fact for the install directory
Expand Down Expand Up @@ -53,25 +52,25 @@
venv_dir => $superset_venv_dir,
systempkgs => false,
}

# Update pip before install
python::pip { 'pip':
ensure => 'latest',
pkgname => 'pip',
virtualenv => $superset_venv_dir,
owner => $superset::user,
group => $superset::user,
ensure => 'present',
pkgname => 'pip',
virtualenv => $superset_venv_dir,
owner => $superset::user,
group => $superset::user,
}

# Update wheel before install
python::pip { 'wheel':
ensure => 'latest',
pkgname => 'wheel',
virtualenv => $superset_venv_dir,
owner => $superset::user,
group => $superset::user,
ensure => 'present',
pkgname => 'wheel',
virtualenv => $superset_venv_dir,
owner => $superset::user,
group => $superset::user,
}

# Install apache superset
python::pip { 'apache-superset':
ensure => $superset::version,
Expand All @@ -81,14 +80,6 @@
group => $superset::user,
}

# Lock version of MarkupSafe due later versions breaking Superset https://github.com/apache/superset/issues/19150
# python::pip { 'MarkupSafe':
# ensure => '2.0.1',
# pkgname => 'MarkupSafe',
# virtualenv => $superset_venv_dir,
# owner => $superset::user,
# group => $superset::user,
# }
$superset::additional_python_lib.each | String $pkgname | {
python::pip { $pkgname:
ensure => 'present',
Expand Down
1 change: 0 additions & 1 deletion manifests/packages.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
class superset::packages {
assert_private()


$package_dependencies = lookup('superset::package_dependencies', Array)

package { $package_dependencies:
Expand Down
1 change: 0 additions & 1 deletion manifests/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# @api private
#
class superset::postgresql {

if $superset::manage_db {
class { 'postgresql::server':
}
Expand Down
9 changes: 5 additions & 4 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
assert_private()

if $superset::manage_webserver {

file { '/bin/superset.gunicorn':
ensure => file,
owner => $superset::user,
Expand All @@ -25,10 +24,12 @@
content => epp('superset/superset.service.epp', { user => $superset::user }),
}

service {'superset':
service { 'superset':
ensure => 'running',
subscribe => [File['/bin/superset.gunicorn'],
File['/usr/lib/systemd/system/superset.service']]
subscribe => [
File['/bin/superset.gunicorn'],
File['/usr/lib/systemd/system/superset.service'],
],
}
}
}

0 comments on commit a4ca78f

Please sign in to comment.