File: engine.pp

package info (click to toggle)
puppet-module-mistral 25.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,004 kB
  • sloc: ruby: 2,093; python: 38; makefile: 11; sh: 10
file content (105 lines) | stat: -rw-r--r-- 3,900 bytes parent folder | download
1
2
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# == Class: mistral::engine
#
# Installs & configure the Mistral Engine service
#
# === Parameters
# [*package_ensure*]
#    (Optional) Ensure state for package.
#    Defaults to present
#
# [*enabled*]
#   (optional) Should the service be enabled.
#   Defaults to 'true'.
#
# [*manage_service*]
#   (optional) Whether the service should be managed by Puppet.
#   Defaults to 'true'.
#
# [*host*]
#   (Optional) Name of the engine node. This can be an opaque identifier.
#   It is not necessarily a hostname, FQDN, or IP address. (string value)
#   Defaults to $facts['os_service_default'].
#
# [*topic*]
#   (Optional) The message topic that the engine listens on.
#   Defaults to $facts['os_service_default'].
#
# [*version*]
#   (Optional) The version of the engine. (string value)
#   Defaults to $facts['os_service_default'].
#
# [*execution_field_size_limit_kb*]
#   (Optional) The default maximum size in KB of large text fields
#   of runtime execution objects. Use -1 for no limit.
#   Defaults to $facts['os_service_default'].
#
# [*execution_integrity_check_delay*]
#   (Optional) A number of seconds since the last update of a task execution
#   in RUNNING state after which Mistral will start checking its integrity.
#   Defaults to $facts['os_service_default'].
#
# [*execution_integrity_check_batch_size*]
#   (Optional) A number of task executions in RUNNING state that the execution
#   integrity checker can process in a single iteration.
#   Defaults to $facts['os_service_default'].
#
# [*action_definition_cache_time*]
#   (Optional) A number of seconds that indicates how long action definitions
#   should be stored in the local cache.
#   Defaults to $facts['os_service_default'].
#
# [*start_subworkflows_via_rpc*]
#   (Optional) Enables starting subworkflows via RPC.
#   Defaults to $facts['os_service_default'].
#
class mistral::engine (
  $package_ensure                       = present,
  Boolean $manage_service               = true,
  Boolean $enabled                      = true,
  $host                                 = $facts['os_service_default'],
  $topic                                = $facts['os_service_default'],
  $version                              = $facts['os_service_default'],
  $execution_field_size_limit_kb        = $facts['os_service_default'],
  $execution_integrity_check_delay      = $facts['os_service_default'],
  $execution_integrity_check_batch_size = $facts['os_service_default'],
  $action_definition_cache_time         = $facts['os_service_default'],
  $start_subworkflows_via_rpc           = $facts['os_service_default'],
) {

  include mistral::deps
  include mistral::params

  package { 'mistral-engine':
    ensure => $package_ensure,
    name   => $::mistral::params::engine_package_name,
    tag    => ['openstack', 'mistral-package'],
  }

  if $manage_service {
    if $enabled {
      $service_ensure = 'running'
    } else {
      $service_ensure = 'stopped'
    }

    service { 'mistral-engine':
      ensure     => $service_ensure,
      name       => $::mistral::params::engine_service_name,
      enable     => $enabled,
      hasstatus  => true,
      hasrestart => true,
      tag        => 'mistral-service',
    }
  }

  mistral_config {
    'engine/host':                                 value => $host;
    'engine/topic':                                value => $topic;
    'engine/version':                              value => $version;
    'engine/execution_field_size_limit_kb':        value => $execution_field_size_limit_kb;
    'engine/execution_integrity_check_delay':      value => $execution_integrity_check_delay;
    'engine/execution_integrity_check_batch_size': value => $execution_integrity_check_batch_size;
    'engine/action_definition_cache_time':         value => $action_definition_cache_time;
    'engine/start_subworkflows_via_rpc':           value => $start_subworkflows_via_rpc;
  }
}