Skip to content

Instantly share code, notes, and snippets.

View tamirko's full-sized avatar

Tamir Korem tamirko

  • www.whitesourcesoftware.com
View GitHub Profile
@tamirko
tamirko / install_cfy_Composer331_ubuntu1404.sh
Created April 10, 2016 12:26
install_cfy_Composer331_ubuntu1404.sh
#!/bin/bash
sudo apt-get -y purge python-pip
sudo apt-get -y install python-pip
sudo pip install virtualenv
sudo apt-get install -y wget
sudo pip install --upgrade pip
wget https://raw.githubusercontent.com/cloudify-cosmo/get-cloudify.py/master/get-cloudify-composer.py
sudo python get-cloudify-composer.py
nohup sudo /opt/cloudify-composer/nodejs/bin/node /opt/cloudify-composer/blueprint-composer/package/server.js &
@tamirko
tamirko / install_ravello_open_vpn.sh
Last active April 4, 2016 08:27
install ravello open_vpn
#!/bin/bash
which openvpn
if [ $? -ne 0 ]; then
# Install openvpn
which yum
if [ $? -ne 0 ]; then
# Install on Ubuntu
sudo apt-get install -y openvpn
else
# Install on CentOs
@tamirko
tamirko / install_ravello_open_vpn.sh
Created March 30, 2016 07:06
install ravello open_vpn
#!/bin/sh
@tamirko
tamirko / wagon_desc.yaml
Last active March 25, 2016 12:55
Create and use a wagon for the azure plugin
# In plugin.yaml (under the cloudify-azure-plugin root folder in your local laptop), set the following instead of what's written there :
plugins:
microsoft:
executor: central_deployment_agent
package_name: cloudify-azure-plugin
package_version: '1.3.2'
# Activate your virtualenv : source PATH_TO_YOU_VIRTUALENV_FOLDER/bin/activate
# Got to the cloudify-azure-plugin root folder in your local laptop and install the plugin :
# pip install -e .
# Create a wagon of the azure plugin as described in : http://docs.getcloudify.org/3.3.1/plugins/packaging-your-plugin/
@tamirko
tamirko / two_prefixes_azure.yaml
Last active March 24, 2016 21:21
Two different VMs prefixes in an azure blueprint
# Add another input to your inputs file, so you will have vm_prefix (it's already in your inputs file) for the mongo vm
# and also add vm_prefix2 for the nodejs vm.
# Then Change or add the following in your blueprint (azure-healing-blueprint.yaml ? ) :
...
inputs:
vm_prefix:
type: string
default: 'mongovm'
vm_prefix2:
type: string
@tamirko
tamirko / aws_error.log
Created March 23, 2016 10:17
aws_error
Hi Tamir,
From AWS console I am able to provision RedhatVM but not thru blueprint. ami-775e4f16 is available in my account under us-west-2b Region. I supplied both the values from Blueprint manager input file.
Thru blueprint I am getting the below Error. Traceback (most recent call last):
File "/home/ubuntu/cloudify-plugins-common/cloudify/decorators.py", line 122, in wrapper
result = func(*args, **kwargs)
File "/home/ubuntu/cloudify_env/local/lib/python2.7/site-packages/ec2/instance.py", line 49, in creation_validation
@tamirko
tamirko / Create_a_new_Windows_vm.yaml
Last active March 23, 2016 08:45
Create a new Windows vm
node_templates:
....
my_windows_vm:
type: cloudify.nodes.Compute
interfaces:
cloudify.interfaces.lifecycle:
install:
# In my_create_windows_vm.py, you need to invoke the ARM create_vm call.
# Then get its private IP address and assign it to the 'ip' runtime attribute
# of the current node instance:
@tamirko
tamirko / Windows_Compute.yaml
Created March 22, 2016 15:38
Windows_Compute
node_templates:
....
my_vm:
type: cloudify.nodes.Compute
properties:
ip: REAPLCE_THIS_WITH_THE_VM_IP_ADDRESS
agent_config:
# one of none, remote, init_script, provided
install_method: remote
user: Administrator
@tamirko
tamirko / restart_Via_Cfy_Wf.py
Created March 21, 2016 06:29
Restart via CFY Workflow
@workflow
def my_restart_task(current_node_id, my_input **kwargs):
node = ctx.get_node(current_node_id)
for instance in node.instances:
# According to you , I need to schedule this. - But how ?
instance.execute_operation("myRestartOperation_mapped_to_a_restarting_script",kwargs={'process': {'args': [my_input]}})
# Now wait for the restart to complete (by another operation (mapped to a script)
instance.execute_operation("myWait4_VM_to_start_mapped_a_script",kwargs={'process': {'args': [my_input]}})
@tamirko
tamirko / installComposer331.sh
Last active March 14, 2016 13:13
installComposer331.sh
#!/bin/bash
sudo rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
sudo yum install -y -q update
sudo yum -y install python-pip
sudo pip install virtualenv
sudo yum install -y wget
wget https://raw.githubusercontent.com/cloudify-cosmo/get-cloudify.py/master/get-cloudify-composer.py
sudo python get-cloudify-composer.py
nohup sudo /opt/cloudify-composer/nodejs/bin/node /opt/cloudify-composer/blueprint-composer/package/server.js &