【问题标题】:Cloud execution module - Profile is not defined Salt Stack云执行模块 - 未定义配置文件 Salt Stack
【发布时间】:2018-03-29 05:53:58
【问题描述】:

我正在尝试设置云执行模块,每次尝试使用“salt-cloud -p ec2_east_nano_prod saltcloud_nano_test”调出一个测试实例时,都会出现错误:

    [DEBUG   ] Reading configuration from /etc/salt/cloud
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG   ] Including configuration from '/etc/salt/cloud.providers.d/abc.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.providers.d/abc.conf
[INFO    ] There's at least one cloud driver under the '-east-2-public' cloud provider alias which does not have the required 'driver' setting. Removing it from the available providers listing.
[DEBUG   ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/ec2_us_west-2.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/ec2_us_west-2.conf
[DEBUG   ] Configuration file path: /etc/salt/cloud
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO    ] salt-cloud starting
[DEBUG   ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG   ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG   ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG   ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[DEBUG   ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available.
[DEBUG   ] LazyLoaded openstack.list_locations
[DEBUG   ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available.
[ERROR   ] Profile ec2 is not defined
[DEBUG   ] LazyLoaded nested.output
Error:
    Profile ec2 is not defined

设置

/etc/salt/cloud.profiles.d/ec2_us_west-2.conf

ec2:
  provider: ec2-us-east-2-public
  image: ami-41e7cb24
  size: t2.micro
  ssh_username: ubuntu
  tag: {'Environment': 'production'}
  sync_after_install: grains
  minion:
        master: 172.31.17.185

这里是 provider.d 文件:

ec2-us-east-2-public:
  minion:
    master: master
  id: '**********'
  key: '******+******'
  private_key: /etc/salt/***.pem
  keyname: ***
  ssh_interface: public_ips
  securitygroup: default
  location: us-west-2
  availability_zone: us-west-2a
  provider: ec2
  del_root_vol_on_destroy: True
  del_all_vols_on_destroy: True
  rename_on_destroy: True

版本报告

盐版:

           Salt: 2017.7.4

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.3
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.12 (default, Dec  4 2017, 14:50:18)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: Ubuntu 16.04 xenial
         locale: UTF-8
        machine: x86_64
        release: 4.4.0-1038-aws
         system: Linux
        version: Ubuntu 16.04 xenial

我不确定是否需要定义“provider:pillar['cloud'][etc]”。

【问题讨论】:

  • salt-cloud --list-providerssalt-cloud --list-profiles 怎么样。如需进一步帮助,请阅读this
  • 错误:列出配置文件时出错:没有配置云配置文件。错误:列出提供商时出错:没有配置云提供商。
  • 我也将我的 salt-cloud 升级到 salt-cloud 2017.7.4(氮气)。 salt-cloud 2016.11.9 (Carbon) 上一切正常。
  • @dahrens 你在吗

标签: devops salt salt-stack salt-cloud


【解决方案1】:

在您的provider.d 文件中,尝试使用“驱动程序”而不是“提供程序”,类似于salt-cloud quick start

This page notes that this field was changed some years ago.

在 2015.8.0 版本中更改。

云提供商定义中的 provider 参数已重命名为 司机。进行此更改是为了避免与提供者混淆 云配置文件定义中使用的参数。云提供商 定义现在使用驱动程序来引用盐云模块 提供连接到云主机的底层功能, 而云配置文件继续使用提供者来指代提供者 您定义的配置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-08
    • 1970-01-01
    • 1970-01-01
    • 2011-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多