[英]Salt Stack Configuration for Rackspace/Cloud Providers
我正在尝试为云提供商配置 Salt Stack 2014.1.0……特别是为 Rackspace。 我发现了一篇非常好的文章http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html ,它比云提供商的 Salt Stack 站点更新(Rackspace one on SaltStack site pre-openstack )。 但即使是这个外部指南也是 2013 年的旧版本。
在http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html和 Salt 2014.1.0 之后,我需要手动创建 /etc/salt/cloud.providers.d/ 因为它不存在. 但是如何使盐指向它/使用它? 我在 /etc/cloud/cloud.cfg 中没有看到指向它的指令。
默认情况下,Salt-cloud 被编译为在五个目录中查找各种配置文件:
放置在这些目录中的每个 *.conf 文件都与相应的单个文件位置( /etc/salt/cloud
、 /etc/salt/cloud.profiles
、 /etc/salt/cloud.providers
等)一起处理
如果您的 salt master 是带有 SaltStack PPA 的 Ubuntu,只需apt-get install salt-cloud
它将为您创建所有这些目录。
使事情顺利进行至少需要一个提供商和一个配置文件。 把它放在/etc/salt/cloud.providers.d/rackspace.conf
:
openstack-rackspace:
minion:
master: <YOUR-SALT-MASTER>
provider: openstack
compute_name: cloudServersOpenStack
identity_url: 'https://identity.api.rackspacecloud.com/v2.0/tokens'
#identity_url: 'https://lon.identity.api.rackspacecloud.com/v2.0/tokens'
protocol: ipv4
# Rackspace regions:
# DFW (Dallas), ORD (Chicago), IAD (Virginia), SYD (Sydney), HKG (Hong Kong)
# LON (London) requires a separate Rackspace UK account and different URL above.
compute_region: ORD
# Rackspace username, apikey and account number
user: <YOUR-RACKSPACE-USERNAME>
apikey: <YOUR-RACKSPACE-API-KEY
tenant: <YOUR-RACKSPACE-ACCOUNT-NUMBER>
然后将以下内容放入/etc/salt/cloud.profiles.d/myprofile.conf
#Std: [1GB,2GB,4GB,8GB,15GB,30GB] Standard Instance
#P1: performance1-[1,2,4,8]
#P2: performance2-[15,30,60,90,120]
#2GB, 1vCPU, 40GB HD, 120Mbit
my-standard_2gb:
provider: openstack-rackspace
size: 2GB Standard Instance
image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
#2GB, 2vCPU, 40GB SSD, 400Mbit
web_2gb:
provider: openstack-rackspace
size: performance1-2
image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
grains:
role: web
blah: production
列出所有可用的图像: salt-cloud --list-images openstack-rackspace
列出所有可用的大小: salt-cloud --list-sizes openstack-rackspace
使用以下命令创建一个新实例: salt-cloud -p web_2gb unique.machine.name
但您需要自己处理 DNS。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.