Skip to content

Instantly share code, notes, and snippets.

@schasi

schasi/test.sls Secret

Last active September 5, 2017 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schasi/795b5c334d633f58fb0d893b871ed95d to your computer and use it in GitHub Desktop.
Save schasi/795b5c334d633f58fb0d893b871ed95d to your computer and use it in GitHub Desktop.
Trying to get data from my orchestration state to my salt-cloud provider module - Version 2
# the orchestration file
test-vm:
salt.runner:
- name: cloud.profile
- prof: freebsd
- provider: ovirt
- instances:
- Test-1
- pillar:
- mac: "f0:0b:aa:f0:0b:aa"
- network: "somenet"
# With that, the following command will be run:
# salt-run state.orch orch.test saltenv=prod -l debug
# Which will produce the following exception:
ID: test-vm
Function: salt.runner
Name: cloud.profile
Result: False
Comment: Exception occurred in runner cloud.profile: Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/salt/client/mixins.py", line 392, in _low
data['return'] = self.functions[fun](*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/salt/runners/cloud.py", line 117, in profile
info = client.profile(prof, instances, **_filter_kwargs(kwargs))
File "/usr/local/lib/python2.7/site-packages/salt/cloud/__init__.py", line 344, in profile
mapper = salt.cloud.Map(self._opts_defaults(**kwargs))
File "/usr/local/lib/python2.7/site-packages/salt/cloud/__init__.py", line 1674, in __init__
Cloud.__init__(self, opts)
File "/usr/local/lib/python2.7/site-packages/salt/cloud/__init__.py", line 510, in __init__
self.clouds = salt.loader.clouds(self.opts)
File "/usr/local/lib/python2.7/site-packages/salt/loader.py", line 921, in clouds
pack={'__utils__': salt.loader.utils(opts),
File "/usr/local/lib/python2.7/site-packages/salt/loader.py", line 341, in utils
pack={'__context__': context, '__proxy__': proxy or {}},
File "/usr/local/lib/python2.7/site-packages/salt/loader.py", line 1068, in __init__
self.opts = self.__prep_mod_opts(opts)
File "/usr/local/lib/python2.7/site-packages/salt/loader.py", line 1284, in __prep_mod_opts
self.pack['__pillar__'] = salt.utils.context.NamespacedDictWrapper(self.context_dict, 'pillar', override_name='pillar')
File "/usr/local/lib/python2.7/site-packages/salt/utils/context.py", line 209, in __init__
super(NamespacedDictWrapper, self).__init__(self._dict())
ValueError: dictionary update sequence element #0 has length 1; 2 is required
# provider and profile conf
cat /usr/local/etc/salt/cloud.providers.d/ovirt.conf
ovirt-config:
url: https://ovirthost/ovirt-engine/api
username: admin@internal
password: somepass
ca_file: ca_file.pem
driver: ovirt
cat /usr/local/etc/salt/cloud.profiles.d/ovirt.conf
freebsd:
provider: ovirt-config
user: root
ssh_keyfile: /usr/local/etc/salt/pki/id_rsa
template: Default-2017
memory: 4294967296
cores: 2
minion:
master: prod-saltmaster-1.ocn.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment