{"action":"created","issue":{"url":"https://api.github.com/repos/madduck/reclass/issues/47","labels_url":"https://api.github.com/repos/madduck/reclass/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/madduck/reclass/issues/47/comments","events_url":"https://api.github.com/repos/madduck/reclass/issues/47/events","html_url":"https://github.com/madduck/reclass/issues/47","id":97146845,"number":47,"title":"Implementing \"Membership information\" from to-do list.","user":{"login":"whatevsz","id":3748696,"avatar_url":"https://avatars.githubusercontent.com/u/3748696?v=3","gravatar_id":"","url":"https://api.github.com/users/whatevsz","html_url":"https://github.com/whatevsz","followers_url":"https://api.github.com/users/whatevsz/followers","following_url":"https://api.github.com/users/whatevsz/following{/other_user}","gists_url":"https://api.github.com/users/whatevsz/gists{/gist_id}","starred_url":"https://api.github.com/users/whatevsz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatevsz/subscriptions","organizations_url":"https://api.github.com/users/whatevsz/orgs","repos_url":"https://api.github.com/users/whatevsz/repos","events_url":"https://api.github.com/users/whatevsz/events{/privacy}","received_events_url":"https://api.github.com/users/whatevsz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-24T21:04:14Z","updated_at":"2015-07-25T11:43:59Z","closed_at":null,"body":"I'm currently using reclass as a ENC for salt, and to avoid duplication of data I am really interested in some kind of \"smart lookup\" feature, that is already listed here: http://reclass.pantsfullofunix.net/todo.html#membership-information\r\n\r\nAm I right that the idea is to extract certain information about other hosts and make I available as node configuration data? For example, get all hosts that use the current host as the monitoring master?\r\n\r\nI thought about implementing this myself, but wanted to ask whether there was some consensus on the best way to go about it. I thought about making functions available in `${...}` blocks (or special `$[]` blocks as mentioned in the to-do list), and then implement a function `aggregate()` that would get a filter and the data to extract as arguments, if this makes any sense. This could be used like this:\r\n\r\n`monitoring_clients: $[aggregate(lambda host: host.nagios.master == this, lambda host: host.ip}`\r\n\r\nAny thoughts/ideas?"},"comment":{"url":"https://api.github.com/repos/madduck/reclass/issues/comments/124836468","html_url":"https://github.com/madduck/reclass/issues/47#issuecomment-124836468","issue_url":"https://api.github.com/repos/madduck/reclass/issues/47","id":124836468,"user":{"login":"madduck","id":195073,"avatar_url":"https://avatars.githubusercontent.com/u/195073?v=3","gravatar_id":"","url":"https://api.github.com/users/madduck","html_url":"https://github.com/madduck","followers_url":"https://api.github.com/users/madduck/followers","following_url":"https://api.github.com/users/madduck/following{/other_user}","gists_url":"https://api.github.com/users/madduck/gists{/gist_id}","starred_url":"https://api.github.com/users/madduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madduck/subscriptions","organizations_url":"https://api.github.com/users/madduck/orgs","repos_url":"https://api.github.com/users/madduck/repos","events_url":"https://api.github.com/users/madduck/events{/privacy}","received_events_url":"https://api.github.com/users/madduck/received_events","type":"User","site_admin":false},"created_at":"2015-07-25T11:43:59Z","updated_at":"2015-07-25T11:43:59Z","body":"Yeah, I know about the need to run over the entire inventory even when querying a single node, when such functions are in use. Not sure there's anything you can do to prevent it. At some point, maybe reclass will cache stuff in memory and thus provide for faster queries.\r\n\r\nI understand your approach with `aggregate()` and I think it's very flexible and good."}}