A knife-openstack wrapper with support for YAML profiles
Add this line to your Chef repository's Gemfile:
gem 'knife-openstack_launcher',
:git => '[email protected]:greenalto/knife-openstack_launcher.git'
And then execute:
$ bundle
Create a config/openstack.yml file in your Chef repository. Here's an example:
profiles:
instance:
security_groups:
- "default"
run_list:
- "role[base]"
flavor: "t1.micro"
image: "ami-f5998981"
distro: "chef-full"
To bootstrap an "instance" server with the right security group, flavor and image, launch from your Chef repository:
knife openstack server from profile instance.example.com --profile=instance
You can specify the path to a YAML config file:
knife openstack server from profile instance.example.com --profile=instance \
--yaml-config=/path/to/config.yml
You can override anything that can be set when bootstrapping a node using knife-openstack using the YAML profiles. See ec2_base and ec2_server_create for a complete reference.
You can also add any command-line switch from knife ec2 server create --help
.
For example, if you want to create a more powerful SVN server in another region
as a one-time action:
knife openstack server from profile svn_us.example.com --profile=svn \
--region=us-west-1 --flavor=m1.small
If you don't specify something in the profile, it is going to be taken from
your .chef/knife.rb
or the defaults from the knife-ec2 plugin. For example:
knife[:flavor] = 'm1.small'
knife[:ssh_user] = 'ubuntu'
At the time of this writing:
aws_access_key_id
aws_secret_key_id
region
flavor
image
security_groups
security_group_ids
associate_eip
tags
availability_zone
chef_node_name
ssh_key_name
ssh_user
ssh_password
ssh_port
ssh_gateway
identity_file
prerelease
bootstrap_version
distro
template_file
ebs_size
ebs_optimized
ebs_no_delete_on_term
run_list
json_attributes
subnet_id
private_ip_address
host_key_verify
bootstrap_protocol
fqdn
aws_user_data
hint
ephemeral
server_connect_attribute
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request