Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Module Named Flask #333

Closed
ghost opened this issue Aug 13, 2021 · 1 comment
Closed

No Module Named Flask #333

ghost opened this issue Aug 13, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 13, 2021

Navigating to the /pboard site is throwing a 504 error.

image

from the /var/httpd/server_error.log

[Fri Aug 13 00:23:12.448767 2021] [wsgi:error] [pid 41290] [remote redacted:63040] mod_wsgi (pid=41290): Failed to exec Python script file '/srv/puppetboard/puppetboard/wsgi.py'.
[Fri Aug 13 00:23:12.448814 2021] [wsgi:error] [pid 41290] [remote redacted:63040] mod_wsgi (pid=41290): Exception occurred processing WSGI script '/srv/puppetboard/puppetboard/wsgi.py'.
[Fri Aug 13 00:23:12.448893 2021] [wsgi:error] [pid 41290] [remote redacted:63040] Traceback (most recent call last):
[Fri Aug 13 00:23:12.448916 2021] [wsgi:error] [pid 41290] [remote redacted:63040]   File "/srv/puppetboard/puppetboard/wsgi.py", line 14, in <module>
[Fri Aug 13 00:23:12.448921 2021] [wsgi:error] [pid 41290] [remote redacted:63040]     from puppetboard.app import app as application
[Fri Aug 13 00:23:12.448928 2021] [wsgi:error] [pid 41290] [remote redacted:63040]   File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 14, in <module>
[Fri Aug 13 00:23:12.448932 2021] [wsgi:error] [pid 41290] [remote redacted63040]     from flask import (
[Fri Aug 13 00:23:12.448946 2021] [wsgi:error] [pid 41290] [remote redacted:63040] ModuleNotFoundError: No module named 'flask'

my puppetfile. I've tried the examples in the module, and the example in the docs. Below is what someone with the same error I had posted saying it worked.

mod 'puppet-puppetboard',                  '7.0.2'
mod 'puppetlabs-apache',                   '6.4.0'
mod 'puppet-python',                       '5.0.0'

my profile

class profile::puppet::puppetboard {

  $puppetboard_certname = $trusted['certname']
  $ssl_dir = '/etc/httpd/ssl'

  class {'apache':
    default_vhost    => false,
    server_signature => 'Off',
    server_tokens    => 'Prod',
    trace_enable     => 'Off',
  }

  #Configure Apache on this server
  class { 'apache::mod::wsgi':
    wsgi_socket_prefix => '/var/run/wsgi',
  }

  #Configure Puppetboard
  class { 'puppetboard':
    default_environment => '*',
    manage_git          => true,
    manage_virtualenv   => true,
    groups              => 'root',
    manage_selinux      => true,
    puppetdb_host       => 'puppetdb.remote.com',
    puppetdb_port       => 8081,
    puppetdb_key        => "${ssl_dir}/private_keys/${puppetboard_certname}.pem",
    puppetdb_ssl_verify => "${ssl_dir}/certs/ca.pem",
    puppetdb_cert       => "${ssl_dir}/certs/${puppetboard_certname}.pem",
    reports_count       => 50
  }
  -> python::pip { 'Flask':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
  }
  -> python::pip { 'Flask-WTF':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
  }
  -> python::pip { 'WTForms':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
  }
  -> python::pip { 'pypuppetdb':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
  }

  #Configure Access Puppetboard
  class { 'puppetboard::apache::vhost':
    vhost_name => $facts['ipaddress'],
    port       => 80,
  }
}

Let me know if I need to give anymore information.

Thanks!

@ghost
Copy link
Author

ghost commented Aug 16, 2021

I just decided to use the container version, and host it in fargate.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants