9d1090b3c28d0c05f2a6bfc1ddda40b3272ed663
[mirror/dsa-puppet.git] / 3rdparty / modules / cinder / manifests / backend / hp3par_iscsi.pp
1 # == Define: cinder::backend::hp3par_iscsi
2 #
3 # Configures Cinder volume HP 3par ISCSI driver.
4 # Parameters are particular to each volume driver.
5 #
6 # === Parameters
7 #
8 # [*hp3par_api_url*]
9 #    (required) url for api access to 3par - example https://10.x.x.x:8080/api/v1
10 #
11 # [*hp3par_username*]
12 #    (required) Username for HP3par admin user
13 #
14 # [*hp3par_password*]
15 #    (required) Password for hp3par_username
16 #
17 # [*san_ip*]
18 #   (required) IP address of HP 3par service processor.
19 #
20 # [*san_login*]
21 #   (required) Username for HP 3par account.
22 #
23 # [*san_password*]
24 #   (required) Password for HP 3par account.
25 #
26 # [*hp3par_iscsi_ips*]
27 #   (required) iscsi IP addresses for the HP 3par array
28 #   This is a list of IPs with ports in a string, for example:
29 #   '1.2.3.4:3261, 5.6.7.8:3261'
30 #
31 # [*volume_backend_name*]
32 #   (optional) Allows for the volume_backend_name to be separate of $name.
33 #   Defaults to: $name
34 #
35 # [*volume_driver*]
36 #   (optional) Setup cinder-volume to use HP 3par volume driver.
37 #   Defaults to 'cinder.volume.drivers.san.hp.hp_3par_iscsi.HP3PARISCSIDriver'
38 #
39 # [*hp3par_iscsi_chap_enabled
40 #   (required) setting to false by default
41 #
42 # [*hp3par_snap_cpg*]
43 #   (optional) set to hp3par_cfg by default in the cinder driver
44 #
45 # [*hp3par_snapshot_retention*]
46 #   (required) Time in hours for snapshot retention. Must be less
47 #   than hp3par_snapshot_expiration.
48 #   Defaults to 48.
49 #
50 # [*hp3par_snapshot_expiration*]
51 #   (required) Time in hours until a snapshot expires. Must be more
52 #   than hp3par_snapshot_retention.
53 #   Defaults to 72.
54
55 define cinder::backend::hp3par_iscsi(
56   $hp3par_api_url,
57   $hp3par_username,
58   $hp3par_password,
59   $san_ip,
60   $san_login,
61   $san_password,
62   $hp3par_iscsi_ips,
63   $volume_backend_name        = $name,
64   $volume_driver              = 'cinder.volume.drivers.san.hp.hp_3par_iscsi.HP3PARISCSIDriver',
65   $hp3par_iscsi_chap_enabled  = false,
66   $hp3par_snap_cpg            = 'OpenstackCPG',
67   $hp3par_snapshot_retention  = 48,
68   $hp3par_snapshot_expiration = 72,
69 ) {
70
71   if ($hp3par_snapshot_expiration <= $hp3par_snapshot_retention) {
72     fail ('hp3par_snapshot_expiration must be greater than hp3par_snapshot_retention')
73   }
74
75   cinder_config {
76     "${name}/volume_backend_name":        value => $volume_backend_name;
77     "${name}/volume_driver":              value => $volume_driver;
78     "${name}/hp3par_username":            value => $hp3par_username;
79     "${name}/hp3par_password":            value => $hp3par_password, secret => true;
80     "${name}/san_ip":                     value => $san_ip;
81     "${name}/san_login":                  value => $san_login;
82     "${name}/san_password":               value => $san_password, secret => true;
83     "${name}/hp3par_iscsi_ips":           value => $hp3par_iscsi_ips;
84     "${name}/hp3par_api_url":             value => $hp3par_api_url;
85     "${name}/hp3par_iscsi_chap_enabled":  value => $hp3par_iscsi_chap_enabled;
86     "${name}/hp3par_snap_cpg":            value => $hp3par_snap_cpg;
87     "${name}/hp3par_snapshot_retention":  value => $hp3par_snapshot_retention;
88     "${name}/hp3par_snapshot_expiration": value => $hp3par_snapshot_expiration;
89   }
90 }