Cannot merge grains in salt-cloud deploy
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description of Issue/Question
If grains settings are placed in /etc/salt/cloud, they are overwritten by grains settings in any provider config. This is unfortunate, as it prevents placing global grains in a single location.
Setup
/etc/salt/cloud:
# Global server grains.
grains:
server:
env: production
type: cloud
group: video
/etc/salt/cloud.providers.d/linode.conf:
linode:
driver: linode
apikey: foo
password: bar
grains:
server:
provider: linode
/etc/salt/cloud.profiles.d/linode.conf:
linode-test:
provider: linode
image: Debian 8
location: Dallas, TX, USA
size: Linode 1024
/etc/salt/grains of created minion:
server:
provider: linode
Steps to Reproduce Issue
- Create the above
/etc/salt/cloud,/etc/salt/cloud.providers.d/linode.conf, and/etc/salt/cloud.profiles.d/linode.conffiles on a master - Run
salt-cloud -p linode-test test - Observe that
/etc/salt/grainson the createdtestminion does not contain the grains as provided in/etc/salt/cloud.
Versions Report
Salt Version:
Salt: 2017.7.2
Dependency Versions:
cffi: 0.8.6
cherrypy: Not Installed
dateutil: 2.2
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.9.4
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.2
mysql-python: 1.2.3
pycparser: 2.10
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 14.4.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
System Versions:
dist: debian 8.10
locale: UTF-8
machine: x86_64
release: 3.16.0-4-amd64
system: Linux
version: debian 8.10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the salt-cloud deployment path invoked by salt-cloud -p linode-test test, then trace how /etc/salt/cloud and provider configuration files are loaded and combined. Done means the created minion retains both the global server grains and the provider-specific provider: linode grain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100