From 970da0ef37d574d6c033728963ece8a5d8bc0a8e Mon Sep 17 00:00:00 2001 From: Andrew Vant Date: Fri, 3 Oct 2014 21:14:38 -0400 Subject: [PATCH] Added salt-cloud support for Rackspace OpenStack servers. --- pillar.example | 10 ++++++++++ salt/files/cloud.maps.d/rsos.conf | 2 ++ salt/files/cloud.profiles.d/rsos.conf | 7 +++++++ salt/files/cloud.providers.d/rsos.conf | 22 ++++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 salt/files/cloud.maps.d/rsos.conf create mode 100644 salt/files/cloud.profiles.d/rsos.conf create mode 100644 salt/files/cloud.providers.d/rsos.conf diff --git a/pillar.example b/pillar.example index 3374e12..0186cff 100644 --- a/pillar.example +++ b/pillar.example @@ -32,6 +32,16 @@ salt: aws_secret: AWSSECRETYkkDY1iQf9zRtl9+pW+Nm+aZY95 gce_project: test gce_service_account_email_address: 867543072364-orl4h2tpp8jcn1tr9ipj@developer.gserviceaccount.com + rsos_user: afeawofghob + rsos_tenant: tenant_id_number + rsos_apikey: WFJIOJEOIGHSOFHESO + rsos_regions: + - ORD + - DFW + - IAD + - SYD + - HKG + salt_cloud_certs: aws: pem: | diff --git a/salt/files/cloud.maps.d/rsos.conf b/salt/files/cloud.maps.d/rsos.conf new file mode 100644 index 0000000..974565e --- /dev/null +++ b/salt/files/cloud.maps.d/rsos.conf @@ -0,0 +1,2 @@ +# This file managed by Salt, do not edit by hand!! + diff --git a/salt/files/cloud.profiles.d/rsos.conf b/salt/files/cloud.profiles.d/rsos.conf new file mode 100644 index 0000000..279afc2 --- /dev/null +++ b/salt/files/cloud.profiles.d/rsos.conf @@ -0,0 +1,7 @@ +# This file managed by Salt, do not edit by hand!! +{% for region in salt['pillar.get']('salt:cloud:rsos_regions', []) %} +base_ubuntu_rsos_{{ region|lower }}: + image: Ubuntu 14.04 LTS (Trusty Tahr) + provider: rsos_{{ region|lower }} + size: 512MB Standard Instance +{% endfor %} diff --git a/salt/files/cloud.providers.d/rsos.conf b/salt/files/cloud.providers.d/rsos.conf new file mode 100644 index 0000000..bfb23cc --- /dev/null +++ b/salt/files/cloud.providers.d/rsos.conf @@ -0,0 +1,22 @@ +# This file managed by Salt, do not edit by hand!! +# Providers for openstack-based Rackspace cloud servers. + +{% set salt = pillar.get('salt', {}) -%} +{% set cloud = salt.get('cloud', {}) -%} +{% for region in cloud.get('rsos_regions', []) %} + +rsos_{{ region|lower }}: + minion: + master: {{ cloud['master'] }} + grains: + region: {{ region|lower }} + + identity_url: 'https://identity.api.rackspacecloud.com/v2.0/tokens' + compute_name: cloudServersOpenStack + protocol: ipv4 + compute_region: {{ region }} + provider: openstack + user: {{ cloud['rsos_user'] }} + tenant: {{ cloud['rsos_tenant'] }} + apikey: {{ cloud['rsos_apikey'] }} +{% endfor %}