This file is indexed.

/usr/share/puppet/modules.available/oslo/manifests/db.pp is in puppet-module-oslo 9.4.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# == Define: oslo::db
#
# Configure oslo_db options
#
# This resource configures Oslo database configs for an OpenStack service.
# It will manage the [database] section in the given config resource.
#
# === Parameters:
#
# [*sqlite_db*]
#   (Optional) The file name to use with SQLite.
#   Defaults to $::os_service_default
#
# [*sqlite_synchronous*]
#   (Optional) If True, SQLite uses synchronous mode (boolean value).
#   Defaults to $::os_service_default
#
# [*backend*]
#   (Optional) The back end to use for the database.
#   Defaults to $::os_service_default
#
# [*connection*]
#   (Optional) The SQLAlchemy connection string to use to connect to the database.
#   Defaults to $::os_service_default
#
# [*slave_connection*]
#   (Optional) The SQLAlchemy connection string to use to connect to the slave database.
#   Defaults to $::os_service_default
#
# [*mysql_sql_mode*]
#   (Optional) The SQL mode to be used for MySQL sessions.
#   Defaults to $::os_service_default
#
# [*idle_timeout*]
#   (Optional) Timeout before idle SQL connections are reaped.
#   Defaults to $::os_service_default
#
# [*min_pool_size*]
#   (Optional) Minimum number of SQL connections to keep open in a pool.
#   Defaults to $::os_service_default
#
# [*max_pool_size*]
#   (Optional) Maximum number of SQL connections to keep open in a pool.
#   Defaults to $::os_service_default
#
# [*max_retries*]
#   (Optional) Maximum number of database connection retries during startup.
#   Set to -1 to specify an infinite retry count.
#   Defaults to $::os_service_default
#
# [*retry_interval*]
#   (Optional) Interval between retries of opening a SQL connection.
#   Defaults to $::os_service_default
#
# [*max_overflow*]
#   (Optional) If set, use this value for max_overflow with SQLALchemy.
#   Defaults to $::os_service_default
#
# [*connection_debug*]
#   (Optional) Verbosity of SQL debugging information: 0=None, 100=Everything.
#   Defaults to $::os_service_default
#
# [*connection_trace*]
#   (Optional) Add Python stack traces to SQL as comment strings (boolean value).
#   Defaults to $::os_service_default
#
# [*pool_timeout*]
#   (Optional) If set, use this value for pool_timeout with SQLAlchemy.
#   Defaults to $::os_service_default
#
# [*use_db_reconnect*]
#   (Optional) Enable the experimental use of database reconnect on connection lost (boolean value)
#   Defaults to $::os_service_default
#
# [*db_retry_interval*]
#   (Optional) Seconds between retries of a database transaction.
#   Defaults to $::os_service_default
#
# [*db_inc_retry_interval*]
#   (Optional) If True, increases the interval between retries of
#   a database operation up to db_max_retry_interval.
#   Defaults to $::os_service_default
#
# [*db_max_retry_interval*]
#   (Optional) If db_inc_retry_interval is set, the maximum seconds between
#   retries of adatabase operation.
#   Defaults to $::os_service_default
#
# [*db_max_retries*]
#   (Optional) Maximum retries in case of connection error or deadlock error
#   before error is raised. Set to -1 to specify an infinite retry count.
#   Defaults to $::os_service_default
#
# [*use_tpool*]
#   (Optional) Enable the experimental use of thread pooling for all DB API calls (boolean value)
#   Defaults to $::os_service_default
#
define oslo::db(
  $sqlite_db             = $::os_service_default,
  $sqlite_synchronous    = $::os_service_default,
  $backend               = $::os_service_default,
  $connection            = $::os_service_default,
  $slave_connection      = $::os_service_default,
  $mysql_sql_mode        = $::os_service_default,
  $idle_timeout          = $::os_service_default,
  $min_pool_size         = $::os_service_default,
  $max_pool_size         = $::os_service_default,
  $max_retries           = $::os_service_default,
  $retry_interval        = $::os_service_default,
  $max_overflow          = $::os_service_default,
  $connection_debug      = $::os_service_default,
  $connection_trace      = $::os_service_default,
  $pool_timeout          = $::os_service_default,
  $use_db_reconnect      = $::os_service_default,
  $db_retry_interval     = $::os_service_default,
  $db_inc_retry_interval = $::os_service_default,
  $db_max_retry_interval = $::os_service_default,
  $db_max_retries        = $::os_service_default,
  $use_tpool             = $::os_service_default,
){

  include ::oslo::params

  if !is_service_default($connection) {

    validate_re($connection,
      '^(sqlite|mysql(\+pymysql)?|postgresql|mongodb):\/\/(\S+:\S+@\S+\/\S+)?')

    case $connection {
      /^mysql(\+pymysql)?:\/\//: {
        require '::mysql::bindings'
        require '::mysql::bindings::python'
        if $connection =~ /^mysql\+pymysql/ {
          $backend_package = $::oslo::params::pymysql_package_name
        } else {
          $backend_package = false
        }
      }
      /^postgresql:\/\//: {
        $backend_package = false
        require '::postgresql::lib::python'
      }
      /^mongodb:\/\//: {
        $backend_package = $::oslo::params::pymongo_package_name
      }
      /^sqlite:\/\//: {
        $backend_package = $::oslo::params::sqlite_package_name
      }
      default: {
        fail('Unsupported backend configured')
      }
    }

    if $backend_package and !defined(Package[$backend_package]) {
      package { 'db_backend_package':
        ensure => present,
        name   => $backend_package,
        tag    => 'openstack',
      }
    }
  }

  $database_options = {
    'database/sqlite_db'             => { value => $sqlite_db },
    'database/sqlite_synchronous'    => { value => $sqlite_synchronous },
    'database/backend'               => { value => $backend },
    'database/connection'            => { value => $connection, secret => true },
    'database/slave_connection'      => { value => $slave_connection, secret => true },
    'database/mysql_sql_mode'        => { value => $mysql_sql_mode },
    'database/idle_timeout'          => { value => $idle_timeout },
    'database/min_pool_size'         => { value => $min_pool_size },
    'database/max_pool_size'         => { value => $max_pool_size },
    'database/max_retries'           => { value => $max_retries },
    'database/retry_interval'        => { value => $retry_interval },
    'database/max_overflow'          => { value => $max_overflow },
    'database/connection_debug'      => { value => $connection_debug },
    'database/connection_trace'      => { value => $connection_trace },
    'database/pool_timeout'          => { value => $pool_timeout },
    'database/use_db_reconnect'      => { value => $use_db_reconnect },
    'database/db_retry_interval'     => { value => $db_retry_interval },
    'database/db_inc_retry_interval' => { value => $db_inc_retry_interval },
    'database/db_max_retry_interval' => { value => $db_max_retry_interval },
    'database/db_max_retries'        => { value => $db_max_retries },
    'database/use_tpool'             => { value => $use_tpool },
  }

  create_resources($name, $database_options)

}