Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eliasp
eliasp / ITEMS.md
Last active August 29, 2015 14:01
Updating/improving Saltstack's 'grains'

Listing available grains

  • How does 'grains.ls' build its list?
    • It looks, like it currently simply executes all grain methods and then returns the keys of the resulting dictionary. Simply building the list could be probably done way better, e.g. similar to states/modules returning their virtual name. This would also allow grains to return multiple names for backwards compatibility

Keybase proof

I hereby claim:

  • I am eliasp on github.
  • I am eliasp (https://keybase.io/eliasp) on keybase.
  • I have a public key whose fingerprint is 86A4 F67E 9B33 DD00 E11B F737 82C5 1282 6511 BADB

To claim this, I am signing this object:

{% for key in ['foo', 'bar', 'blah', 'blub'] %}
{% if pillar['yourpillar']['config'][key] %}
{{ key }} = {{ pillar['yourpillar']['config'][key] }}
{% endif %}
{% endfor %}
[ERROR ] An un-handled exception was caught by salt's global exception handler:
LookupError: unknown encoding: -----BEGIN PGP SIGNATURE-----
Traceback (most recent call last):
File "/usr/bin/salt-run", line 10, in <module>
salt_run()
File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 144, in salt_run
client.run()
File "/usr/lib/python2.7/dist-packages/salt/cli/__init__.py", line 462, in run
runner.run()
File "/usr/lib/python2.7/dist-packages/salt/runner.py", line 238, in run
MN1221-C0010:
The minion function caused an exception: Traceback (most recent call last):
File "salt/minion.py", line 1019, in _thread_return
File "salt/modules/saltutil.py", line 384, in sync_all
File "salt/modules/saltutil.py", line 250, in sync_modules
File "salt/modules/saltutil.py", line 77, in _sync
File "salt/modules/saltutil.py", line 58, in _get_top_file_envs
File "salt/state.py", line 2924, in __init__
File "salt/state.py", line 564, in __init__
File "salt/state.py", line 688, in load_modules
@eliasp
eliasp / mysqld-systemd-conversation.md
Last active August 29, 2015 14:27
eMail conversation with MySQL team wrt native systemd support

Hi Thayumanavar,

thanks for your response. Some further comments from my side inline below.

best Elias

On 07/30/2015 12:15 PM, thayumanavar wrote:

Hello Elias,

# systemctl restart openvp*** Error in `systemctl': double free or corruption (fasttop): 0x00005560b7796010 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x72cdf)[0x7f9f2b0f3cdf]
/lib64/libc.so.6(+0x7812e)[0x7f9f2b0f912e]
/lib64/libc.so.6(+0x78e66)[0x7f9f2b0f9e66]
systemctl(+0x4df45)[0x5560b75bbf45]
systemctl(+0x4df69)[0x5560b75bbf69]
systemctl(+0xcd5d)[0x5560b757ad5d]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f9f2b0a2b55]
systemctl(+0xe86c)[0x5560b757c86c]
diff --git a/spec/unit/macaddress_spec.rb b/spec/unit/macaddress_spec.rb
index 638ef2a..8bc26b1 100755
--- a/spec/unit/macaddress_spec.rb
+++ b/spec/unit/macaddress_spec.rb
@@ -49,6 +49,15 @@ describe "macaddress fact" do
proc { Facter.value(:macaddress) }.should_not raise_error
Facter.value(:macaddress).should be_nil
end
+
+ # when ifconfig isn't installed, nil is returned which should be handled gracefully without any
Facter.add(:macaddress) do
confine :kernel => 'Linux'
has_weight 10 # about an order of magnitude faster
setcode do
begin
result = nil
Dir.glob('/sys/class/net/*').each do |path|
mac = File.read(path + "/address").chomp
unless /^(?:00:)+00$|^\s*/.match(mac)
result = mac
@eliasp
eliasp / ldap.py
Last active December 25, 2015 11:19
# -*- coding: utf-8 -*-
'''
Provide authentication using simple LDAP binds
:depends: - ldap Python module
'''
# Import python libs
from __future__ import absolute_import
import logging