File: auth_file.pp

package info (click to toggle)
puppet-module-swift 9.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,248 kB
  • ctags: 95
  • sloc: ruby: 5,804; python: 35; makefile: 17; sh: 15
file content (43 lines) | stat: -rw-r--r-- 952 bytes parent folder | download | duplicates (2)
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
# == Class: swift::auth_file
#
# Create a RC credentials file for Swift v1 authentication
#
# === Parameters:
#
# [*admin_tenant*]
#   (required) The name of the tenant used to authenticate
#
# [*admin_user*]
#   (optional) The name of the user to create in keystone for use by the ironic services
#   Defaults to 'admin'
#
# [*auth_url*]
#   (optional) The authentication URL
#   Defaults to 'http://127.0.0.1:5000/v2.0/'
#
# [*admin_password*]
#   (required) The password for the swift user
#
class swift::auth_file (
  $admin_tenant,
  $admin_password,
  $admin_user      = 'admin',
  $auth_url        = 'http://127.0.0.1:5000/v2.0/'
) {

  include ::swift::deps

  file { '/root/swiftrc':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0600',
    tag     => 'swift-file',
    content =>
  "
  export ST_USER=${admin_tenant}:${admin_user}
  export ST_KEY=${admin_password}
  export ST_AUTH=${auth_url}
  ",
  }
}