Puppet Class: sshkeymanager::webapp::configuration

Defined in:
manifests/webapp/configuration.pp

Overview



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'manifests/webapp/configuration.pp', line 3

class sshkeymanager::webapp::configuration {
  $django_secret_key = $sshkeymanager::webapp::django_secret_key
  $puppetdb          = $sshkeymanager::webapp::puppetdb
  $database_driver   = $sshkeymanager::webapp::database_driver
  $api_keys          = $sshkeymanager::webapp::api_keys
  $allowed_hosts     = $sshkeymanager::webapp::allowed_hosts

  $config = "${sshkeymanager::webapp::install_dir}/sshkeymanager/keymanager/settings.py"
  file { $config:
    ensure  => present,
    owner   => $sshkeymanager::webapp::user,
    group   => $sshkeymanager::webapp::group,
    mode    => '0640',
    content => template('sshkeymanager/settings.py.erb'),
    notify  => Exec['manage_migrate'],
  }

  $application_path = "${sshkeymanager::webapp::install_dir}/sshkeymanager"
  file { $sshkeymanager::webapp::wgsi_path:
    ensure  => present,
    owner   => $sshkeymanager::webapp::user,
    group   => $sshkeymanager::webapp::group,
    mode    => '0644',
    content => template('sshkeymanager/skm-django.wsgi.erb'),
  }

  $migrate_command = "${application_path}/manage.py migrate"
  exec { 'manage_migrate':
    refreshonly => true,
    user        => $sshkeymanager::webapp::user,
    cwd         => $application_path,
    command     => $migrate_command,
  }
}