Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pe-pan committed Nov 21, 2017
2 parents 52ccce5 + 771c2bb commit 6a24566
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,13 @@ flow:

- upload_init_config_file:
do:
remote.remote_secure_copy:
ssh.ssh_flow:
- host
- username: 'root'
- password: ${root_password}
- source_path
- destination_host: ${host}
- destination_path: '/etc/init.d/tomcat'
- destination_username: 'root'
- destination_password: ${root_password}
- destination_path: '/etc/init.d/tomcat/'
- command: ${'ln -s ' + source_path + '/* ' + destination_path}
publish:
- return_result
- return_code
Expand Down
127 changes: 127 additions & 0 deletions content/io/cloudslang/demo/deploy_tomcat.sl
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
########################################################################################################################
#!!
#! @description: Generated flow description
#! @result FAILURE: Failure occurred during execution.
#! @result SUCCESS: Flow completed successfully.
#!!#
########################################################################################################################
namespace: io.cloudslang.demo
imports:
base: io.cloudslang.base
vm: io.cloudslang.vmware.vcenter.virtual_machines
flow:
name: deploy_tomcat
inputs:
- hostname
- username
- password
- image: "Ubuntu"
- folder: "Partners"
workflow:
- uuid_generator:
do:
base.utils.uuid_generator:
publish:
- uuid: '${new_uuid}'
navigate:
- SUCCESS: trim
- trim:
do:
base.strings.substring:
- origin_string: '${"petr-"+uuid}'
- end_index: '13'
publish:
- id: '${new_string}'
navigate:
- FAILURE: FAILURE
- SUCCESS: clone_vm
- clone_vm:
do:
vm.clone_virtual_machine:
- host: '${hostname}'
- hostname: 'trnesxi3.swsc.hpe.com'
- username: '${username}'
- password: '${password}'
- data_center_name: 'CAPA1 Datacenter'
- is_template: 'false'
- virtual_machine_name: '${image}'
- clone_name: '${id}'
- folder_name: '${folder}'
navigate:
- FAILURE: FAILURE
- SUCCESS: power_on
- power_on:
do:
vm.power_on_virtual_machine:
- host: '${hostname}'
- username: '${username}'
- password: '${password}'
- virtual_machine_name: '${id}'
navigate:
- FAILURE: FAILURE
- SUCCESS: sleep
- sleep:
do:
base.utils.sleep:
- seconds: '10'
navigate:
- FAILURE: FAILURE
- SUCCESS: get_details
- get_details:
do:
vm.get_virtual_machine_details:
- host: '${hostname}'
- username: '${username}'
- password: '${password}'
- hostname: 'trnesxi3.swsc.hpe.com'
- virtual_machine_name: '${id}'
publish:
- details : '${return_result}'
navigate:
- FAILURE: FAILURE
- SUCCESS: get_ip
- get_ip:
do:
base.json.get_value:
- json_input: '${details}'
- json_path: 'ipAddress'
publish:
- ip: '${return_result}'
navigate:
- FAILURE: FAILURE
- SUCCESS: deploy_tomcat
- deploy_tomcat:
do:
base.os.linux.samples.deploy_tomcat_on_ubuntu:
- host: '${ip}'
- root_password: 'admin@123'
- user_password: 'admin@123'
- java_version: "openjdk-7-jdk"
- download_url: "http://www-us.apache.org/dist/tomcat/tomcat-8/v8.0.44/bin/apache-tomcat-8.0.44.tar.gz"
- file_name: "apache-tomcat-8.0.44.tar.gz"
- source_path: "/opt/apache-tomcat/bin"
- script_file_name: "startup.sh"
publish:
- tomcat_url: '${"http://" + host + ":8080"}'
navigate:
- SUCCESS: SUCCESS
- INSTALL_JAVA_FAILURE: FAILURE
- SSH_VERIFY_GROUP_EXIST_FAILURE: FAILURE
- CHECK_GROUP_FAILURE: FAILURE
- ADD_GROUP_FAILURE: FAILURE
- ADD_USER_FAILURE: FAILURE
- CREATE_DOWNLOADING_FOLDER_FAILURE: FAILURE
- DOWNLOAD_TOMCAT_APPLICATION_FAILURE: FAILURE
- UNTAR_TOMCAT_APPLICATION_FAILURE: FAILURE
- CREATE_SYMLINK_FAILURE: FAILURE
- INSTALL_TOMCAT_APPLICATION_FAILURE: FAILURE
- CHANGE_TOMCAT_FOLDER_OWNERSHIP_FAILURE: FAILURE
- CHANGE_DOWNLOAD_TOMCAT_FOLDER_OWNERSHIP_FAILURE: FAILURE
- CREATE_INITIALIZATION_FOLDER_FAILURE: FAILURE
- UPLOAD_INIT_CONFIG_FILE_FAILURE: FAILURE
- CHANGE_PERMISSIONS_FAILURE: FAILURE
- START_TOMCAT_APPLICATION_FAILURE: FAILURE

results:
- FAILURE
- SUCCESS
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.guest.CustomizeLinuxGuest
method_name: customizeLinuxGuest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ operation:
private: true

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.guest.CustomizeWindowsGuest
method_name: customizeWindowsGuest

Expand Down
2 changes: 1 addition & 1 deletion content/io/cloudslang/vmware/vcenter/guest/mount_tools.sl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.guest.MountTools
method_name: mountTools

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.utils.GetOSDescriptors
method_name: getOsDescriptors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.CloneVM
method_name: cloneVM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ operation:
private: true

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.CreateVM
method_name: createVM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.DeleteVM
method_name: deleteVM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.GetVMDetails
method_name: getVMDetails

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.ListVMsAndTemplates
method_name: listVMsAndTemplates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.PowerOffVM
method_name: powerOffVM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ operation:
required: false

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.PowerOnVM
method_name: powerOnVM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ operation:
private: true

java_action:
gav: 'io.cloudslang.content:score-vmware:0.0.4'
gav: 'io.cloudslang.content:score-vmware:0.0.5'
class_name: io.cloudslang.content.vmware.actions.vm.UpdateVM
method_name: updateVM

Expand Down

0 comments on commit 6a24566

Please sign in to comment.