heat_template_version: 2014-10-16
description: >
Mount iSCSI Drives to Controller Nodes, Create domains file for keystone
# Note extra parameters can be defined, then passed data via the
# environment parameter_defaults, without modifying the parent template
parameters:
server:
type: string
resources:
AttachIscsiDrive:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/sh
export _HOSTNAME=$(hostname -s) (1)
/sbin/iscsiadm -m discovery -t sendtargets -p 192.168.254.235 (2)
/sbin/iscsiadm -m node -T iqn.2010-01.org.example.hostname:$_HOSTNAME --login (3)
AttachIscsiDriveDeployment:
type: OS::Heat::SoftwareDeployment
properties:
name: AttachIscsiDriveDeployment
config: {get_resource: AttachIscsiDrive}
actions: ['CREATE'] # Only do this on CREATE
server: {get_param: server}
WipeIscsiDisks:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/sh
/usr/bin/dd if=/dev/zero of=/dev/sdb bs=128K count=100
WipeIscsiDiskDeployment:
type: OS::Heat::SoftwareDeployment
properties:
name: WipeIscsiDiskDeployment
server: {get_param: server}
config: {get_resource: WipeIscsiDisks}
actions: ['DELETE'] # Only do this on DELETE
outputs:
deploy_stderr:
description: Captured stderr from the configuration execution
value: {get_attr: [AttachIscsiDriveDeployment, deploy_stderr]}
deploy_stdout:
description: Captured stdout from the configuration execution
value: {get_attr: [AttachIscsiDriveDeployment, deploy_stdout]}