Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom grain cannot override grain in /etc/salt/grains #50491

Closed
tomaxsas opened this issue Nov 13, 2018 · 3 comments
Closed

custom grain cannot override grain in /etc/salt/grains #50491

tomaxsas opened this issue Nov 13, 2018 · 3 comments
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged stale
Milestone

Comments

@tomaxsas
Copy link

Description of Issue/Question

custom grains in _grains directory does not override grains in /etc/salt/grains
new grains are shown fine, but override doe not work as expected and written in docs, custom grains does not override /etc/salt/grains but it can override, for example, os grain.

Setup

/etc/salt/grains content on minion:
xs_configured_ip: ip

/srv/salt/salt_env/_grains/test.py on master:

# -*- coding: utf-8 -*-
'''
test grain
'''

def custmember():
    grains = {}
    grains['xs_configured_ip'] = 'overriden'
    return grains

Steps to Reproduce Issue

after sync all:

minion:
    ----------
    beacons:
    clouds:
    engines:
    grains:
        - grains.mongo_cust
        - grains.test
    log_handlers:
    modules:
    output:
    proxymodules:
    renderers:
    returners:
    sdb:
    states:
    thorium:
    utils:

and listed grains:

[root@do3 ~]# salt '*minion*' grains.item xs_configured_ip
minion:
    ----------
    xs_configured_ip:
        ip

Versions Report

 salt --versions-report
Salt Version:
           Salt: 2018.3.3

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.5
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.28.2
           Mako: Not Installed
   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.5 (default, Sep 12 2018, 05:31:16)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: redhat 7.6 Maipo
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-957.el7.x86_64
         system: Linux
        version: Red Hat Enterprise Linux Server 7.6 Maipo
@Ch3LL
Copy link
Contributor

Ch3LL commented Nov 13, 2018

looks like i'm able to replicate this and the last time it was working was 2016.11.9. My bisect showed this commit: 3b95ef2

which is this PR: #41408

ping @s0undt3ch can you take a look here when you get a moment.

@Ch3LL Ch3LL added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Nov 13, 2018
@Ch3LL Ch3LL added this to the Blocked milestone Nov 13, 2018
@s0undt3ch
Copy link
Member

We might need to review the sort rules, but they should be sorted.

@stale
Copy link

stale bot commented Jan 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged stale
Projects
None yet
Development

No branches or pull requests

3 participants