Pillar glob matching weird behavior

164 views
Skip to first unread message

Will Platnick

unread,
Apr 10, 2013, 1:49:45 PM4/10/13
to salt-...@googlegroups.com
  1. My pillar glob matching is acting weird for one server in particular. Master and minion are both running 0.14.0 built from dev about a week and a half ago. I didn't see any issues or code changes in github that affected this since then. 
  2. glob matching on pillars seems to be working very funky. If I try to match on the glob, it's not working. If I type the hostname fully, the pillars get set but my renderer output is messed up when I run a highstate.
    Details below
    -------------

    pillar top.sls
  3. -------
  4. base:
  5.   '*':
  6.     - users
  7.     - production
  8.     - softlayer-dfw
  9.   'willtest*':
  10.     - development
  11.     - development
  12.   'staging*.youversion.com':
  13.     - staging
  14.     - solr-slave
  15.   'graphdb*':
  16.     - digitalocean-ny
  17.     - memcache01-dfw
  18.  
  19. production.sls assigns ENVIRONMENT = production (among other things)
  20. staging.sls assigns ENVIRONMENT = staging (among other things)
  21. development.sls assigns ENVIRONMENT = development (among other things)
  22.  
  23. # Refresh pillar
  24. root@salt:/srv/pillar# salt 'staging*' saltutil.refresh_pillar
  25.     True
  26.  
  27. # View pillar data for ENVIRONMENT
  28. root@salt:/srv/pillar# salt 'staging*' pillar.items ENVIRONMENT
  29.     production
  30.  
  31.  
  32. So, as we can see, it is not getting the staging pillar. I change the top.sls to no longer match on 'staging*.youversion.com', but to match the hostname exactly.
  33.  
  34. top.sls
  35. base:
  36.   '*':
  37.     - users
  38.     - production
  39.     - softlayer-dfw
  40.   'willtest*':
  41.     - development
  42.     - development
  43.     - staging
  44.     - solr-slave
  45.   'graphdb*':
  46.     - digitalocean-ny
  47.     - memcache01-dfw
  48.  
  49. # Refresh
  50. root@salt:/srv/pillar# salt 'staging*' saltutil.refresh_pillar
  51.     True
  52.  
  53. # BINGO!
  54. root@salt:/srv/pillar# salt 'staging*' pillar.items ENVIRONMENT
  55.     staging
  56.  
  57. BUUUTTTTT. Now that it gets pillar correctly, my RENDERER output is messed up when I run a highstate against it.
  58.  
  59. This is what returns now that my pillar matches correctly. Look at the funkiness in the apt_repository_|-neo4j_|-neo4j_|-present and __run_num__ appearing in the output.
  60.  
  61.     ----------
  62.     apt_repository_|-neo4j_|-neo4j_|-present:
  63.         ----------
  64.         __run_num__:
  65.             0
  66.         changes:
  67.             ----------
  68.         comment:
  69.             Appended 0 lines and unless executed successfully
  70.         name:
  71.             debian.neo4j.org-repo
  72.         result:
  73.             True
  74.  
  75. I then revert my top.sls back to the way it was at the top of the file, with the glob matching. ENVIRONMENT is back to production, but when I highstate, my renderer is no longer returning funky data, and a highstate now returns something with sane output:
  76.  
  77. ----------
  78.     State: - apt_repository
  79.     Name:      neo4j
  80.     Function:  present
  81.         Result:    True
  82.         Comment:   Appended 0 lines and unless executed successfully
  83.         Changes:
  84.  
  85.  
  86.  
  87. And just in case anybody wants to see them
  88.  
  89. production.sls
  90. ENVIRONMENT: production
  91. SOLR_MEMORY: 14336m
  92. SOLR_NEWRELIC: -javaagent:$SOLR_PATH/newrelic.jar -Dnewrelic.environment=production
  93. SOLR_ROLE: master
  94. IS_MONITORED: True
  95. POSTGRESQL_VERSION: 9.2
  96. PHPFPM_MAX_CHILDREN: 128
  97. PHPFPM_START_SERVERS: 32
  98. PHPFPM_MIN_SPARE_SERVERS: 8
  99. PHPFPM_MAX_SPARE_SERVERS: 32
  100. PHPFPM_MAX_REQUESTS: 9000
  101. MEMCACHED_SIZE: 95232
  102. MEMCACHED_PORT: 11211
  103. GEARMAN_3X_PROCS: 25
  104. GEARMAN_2X_PROCS: 5
  105. MYSQL_VERSION: 5.5
  106.  
  107. staging.sls
  108. ENVIRONMENT: staging
  109. SOLR_MEMORY: 2048m
  110. SOLR_NEWRELIC: -javaagent:/var/www/solr/youversion/newrelic.jar -Dnewrelic.environment=staging
  111. SOLR_ROLE: master
  112. IS_MONITORED: True
  113. POSTGRESQL_VERSION: 9.2
  114. PHPFPM_MAX_CHILDREN: 128
  115. PHPFPM_START_SERVERS: 32
  116. PHPFPM_MIN_SPARE_SERVERS: 8
  117. PHPFPM_MAX_SPARE_SERVERS: 32
  118. PHPFPM_MAX_REQUESTS: 9000
  119. MEMCACHED_SIZE: 8
  120. MEMCACHED_PORT: 11212
  121. GEARMAN_3X_PROCS: 5
  122. GEARMAN_2X_PROCS: 5
  123. MYSQL_VERSION: 5.5

Will Platnick

unread,
Apr 10, 2013, 2:00:29 PM4/10/13
to salt-...@googlegroups.com
To rule out any new code, I just built new packages for minion and master from current dev, and the issue is still occuring

Will Platnick

unread,
Apr 10, 2013, 2:17:47 PM4/10/13
to salt-...@googlegroups.com
It looks like the issue is going deeper than glob matching. It appears to be an inheritance problem as well. To make things simpler, consider the following setup:

root@salt:/srv/pillar# cat top.sls
base:
  '*':
    - master
    - override

root@salt:/srv/pillar# cat master.sls
WHATAMI: master

root@salt:/srv/pillar# cat override.sls
WHATAMI: overridden

root@salt:/srv/pillar# salt 'staging*' saltutil.refresh_pillar
    True

root@salt:/srv/pillar# salt 'staging*' pillar.items WHATAMI
    master



On Wednesday, April 10, 2013 1:49:45 PM UTC-4, Will Platnick wrote:

Thomas S Hatch

unread,
Apr 11, 2013, 2:41:12 PM4/11/13
to salt-...@googlegroups.com
This type of overriding does not work and is not part of pillar, is there some documentation that suggests this that we can correct?

Thomas S. Hatch  |  Founder, CTO


5272 South College Drive, Suite 301 | Murray, UT 84123


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Max Arnold

unread,
Apr 11, 2013, 9:09:40 PM4/11/13
to salt-...@googlegroups.com
On Thu, Apr 11, 2013 at 12:41:12PM -0600, Thomas S Hatch wrote:
> This type of overriding does not work and is not part of pillar, is there
> some documentation that suggests this that we can correct?

There is no recommended way to override pillar in the docs, so people turn to Google.
And google leads to several github issues:

https://github.com/saltstack/salt/pull/1287
https://github.com/saltstack/salt/issues/3991

An example of proper way to override/extend pillar with host-specific values would be
great addition to official documentation.
Reply all
Reply to author
Forward
0 new messages