Skip to content

Instantly share code, notes, and snippets.

@jedipunkz
Created November 27, 2014 09:22
Show Gist options
  • Save jedipunkz/9dd47ac08e9f9eb7e964 to your computer and use it in GitHub Desktop.
Save jedipunkz/9dd47ac08e9f9eb7e964 to your computer and use it in GitHub Desktop.
# add rules to security groups
app_sg_id = find_sg_id('sg-all-from-app-net')
$conn.create_security_group_rule(app_sg_id, 'tcp', '1', '65535', sg_cidr)
$conn.create_security_group_rule(app_sg_id, 'icmp', '-1', '-1', sg_cidr)
dbs_sg_id = find_sg_id('sg-all-from-dbs-net')
$conn.create_security_group_rule(dbs_sg_id, 'tcp', '1', '65535', sg_cidr)
$conn.create_security_group_rule(dbs_sg_id, 'icmp', '-1', '-1', sg_cidr)
$conn = nil
$conn = Fog::Compute.new({
:provider => 'openstack',
:openstack_auth_url => 'https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens',
:openstack_username => '',
:openstack_tenant => 'JOSUG',
:openstack_api_key => '',
:openstack_region => 'region-b.geo-1',
:connection_options => {}
})
# create web instance
Cloud.new().create('OpenStack', instance_lb, flavor_id, find_first($conn.images, image_name), 'hpwork01_key', 'web', 'web', 'az1')
Cloud.new().create('OpenStack', instance_web01, flavor_id, find_first($conn.images, image_name), 'hpwork01_key', 'web', 'web', 'az1')
Cloud.new().create('OpenStack', instance_web02, flavor_id, find_first($conn.images, image_name), 'hpwork01_key', 'web', 'web', 'az1')
Cloud.new().create('OpenStack', instance_app, flavor_id, find_first($conn.images, image_name), 'hpwork01_key', 'app', 'app', 'az1')
Cloud.new().create('OpenStack', instance_db, flavor_id, find_first($conn.images, image_name), 'hpwork01_key', 'db', 'db', 'az1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment