Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2014-06-20

| Channels | #salt index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 alekibango_ joined #salt
00:06 yomilk joined #salt
00:07 dccc joined #salt
00:08 alekibango_ joined #salt
00:13 MatthewsFace joined #salt
00:16 alekibango_ joined #salt
00:25 alekibango_ joined #salt
00:27 jonbrefe joined #salt
00:33 alekibango_ joined #salt
00:34 Guest90210 joined #salt
00:35 dsolsona joined #salt
00:41 alekibango_ joined #salt
00:43 alanpearce joined #salt
00:46 Guest84057 joined #salt
00:47 MatthewsFace joined #salt
00:48 yomilk joined #salt
00:48 Guest84057 joined #salt
00:49 alekibango_ joined #salt
00:50 Shenril joined #salt
00:55 otter768 joined #salt
00:57 azylman_ joined #salt
00:57 alekibango_ joined #salt
00:59 Guest84057 joined #salt
01:05 alekibango_ joined #salt
01:09 mgw joined #salt
01:15 Ryan_Lane is state ordering not ensured if you use jinja for loops for states?
01:16 alekibango joined #salt
01:17 bemehow joined #salt
01:18 bemehow joined #salt
01:21 manfred Ryan_Lane: if you are iterating over stuff in ordered dictionaries, it should be.
01:22 manfred unless you let it do the deterministic thingy, where it does it in lexigraphical order and something else
01:22 manfred http://docs.saltstack.com/en/latest/ref/states/ordering.html
01:22 manfred http://docs.saltstack.com/en/latest/topics/tutorials/states_ordering.html
01:22 Ryan_Lane manfred: I have a set of states, then a set of states wrapped in a jinja loop, and some of the stuff in the for loop is executing before the stuff above it
01:23 manfred it may be doing the lexigraphical thingy
01:25 Ryan_Lane that doesn't seem to be the case
01:25 Ryan_Lane it just seems to be screwing up the ordering
01:26 alekibango joined #salt
01:31 Ryan_Lane hm. I think it's possibly due to requisites
01:36 mateoconfeugo joined #salt
01:48 mgw joined #salt
01:49 allanparsons joined #salt
01:50 mgw joined #salt
01:53 mgw joined #salt
01:58 MatthewsFace joined #salt
02:00 logix812 joined #salt
02:04 otter768 joined #salt
02:04 aaditya joined #salt
02:11 aw110f can execution module return the exit code of the terminal command that salt actually runs?
02:12 manfred aw110f: cmd.retcode
02:12 manfred they should
02:14 xinkeT joined #salt
02:15 aw110f manfred: i have this in my state file
02:15 aw110f http://pastebin.com/6CkqrmG1
02:16 aw110f but as you can see running the state returns True, when I know the directory I'm checking doesn;t exist
02:17 dimeshake the state will return true because you're ensuring absent, no?
02:17 aw110f http://pastebin.com/Ln3xAGYe running the execution module from command line returns false correctly
02:18 aw110f execution module hadoop.dfs_absent only checks (stat) the presence of the file
02:19 TyrfingMjolnir joined #salt
02:20 aw110f i guess when salt tries to enforce the state, it is able to run hadoop.dfs_absent and returns true but doesn't actually evaluate the actual exit code of the command that ran
02:22 dimeshake which is 0 - true in bash
02:22 dimeshake for exit code, no error
02:22 manfred aw110f: running it through a state module won't return a non zero ret code
02:23 manfred because the salt command didn't fail
02:23 mgw joined #salt
02:23 aw110f is there a module.retcode 8-)
02:23 aw110f ?
02:24 manfred it still wouldn't return a non zero ifthe state shit runs correctly
02:24 manfred it would display a false for you
02:25 manfred aw110f: you can do --out json, and then evaluate the return from that for a false
02:27 aw110f How can i do that in the state file?
02:28 manfred do what?
02:28 manfred run salt \* state.highstate --out json
02:28 yetAnotherZero joined #salt
02:28 manfred and then run through the output of that
02:29 aw110f http://pastebin.com/NNESbWuy
02:29 manfred yes
02:29 manfred but it won't return a retcode back to the command line
02:29 aw110f the --out json, can i do it in the state file
02:29 manfred what exactly are you trying to do
02:30 aw110f http://pastebin.com/P9rK5mJm
02:31 aw110f I want to do a cmd.run if the module.run fails
02:31 manfred aw110f: you know
02:31 manfred aw110f: you can just run a command
02:32 manfred in the onlyif
02:32 manfred aw110f: test -d /tmp_salt
02:32 aw110f yea i was going to go that route and actually put the command instead of using module.run
02:32 manfred it is just passed through bash
02:32 manfred don't do module.run
02:32 manfred that isn't what it is for
02:32 manfred it is for running cmd.retcode
02:33 yomilk joined #salt
02:33 manfred aw110f: https://github.com/saltstack/salt/pull/13032https://github.com/saltstack/salt/pull/13032
02:34 manfred aw110f: https://github.com/saltstack/salt/blob/develop/salt/state.py#L624
02:35 manfred just use the /usr/bin/test
02:39 aw110f ok thanks manfred: , cmd.retcode it is then.  I still think a module.retcode would be nice to evaluate in a state, but then all modules would need to be modified to return exit code as well...
02:40 aw110f *execution modules
02:41 manfred if you want to go through and modify states to do other things, you just have to provide a module_run_check function to them
02:41 TyrfingMjolnir joined #salt
02:41 aaditya Is it customary to include orchestration SLSes under the environment of the minions you wish to target? How else would I get pillar data into an orchestration file?
02:41 manfred or add it to that, but it currently doesn't do what you were trying to do
02:45 alanpearce joined #salt
02:52 sroegner joined #salt
02:53 speed145a joined #salt
02:58 pass_by_value joined #salt
03:00 anuvrat joined #salt
03:03 geekmush joined #salt
03:05 davet joined #salt
03:08 xinkeT joined #salt
03:09 davet1 joined #salt
03:13 catpiggest joined #salt
03:16 will joined #salt
03:20 Guest84057 joined #salt
03:21 Guest84057 joined #salt
03:26 Guest84057 joined #salt
03:28 Guest84057 joined #salt
03:31 Guest84057 joined #salt
03:39 yomilk joined #salt
03:45 will joined #salt
03:52 Guest84057 joined #salt
04:00 BrendanGilmore joined #salt
04:01 joehillen joined #salt
04:07 monokrome joined #salt
04:10 jchen so i'm having some trouble runnign state.highstate for some reason: https://gist.github.com/fly/6256bdb4640a60ad375c
04:10 jchen google says check if master & minion are running same versoin, confirmed same version
04:22 bhosmer joined #salt
04:23 ipalreadytaken joined #salt
04:24 jchen oh, derp. this minion dosn't have grains['role'], and my pillar was expecting that to be a thing
04:24 jchen i wish it spit out a trace
04:44 smcquay joined #salt
04:46 alanpearce joined #salt
04:57 n8n joined #salt
05:00 mikber joined #salt
05:16 trevorj joined #salt
05:20 mosen joined #salt
05:24 MK_FG joined #salt
05:26 wangxh joined #salt
05:26 sroegner joined #salt
05:33 jalbretsen joined #salt
05:37 stephanbuys joined #salt
05:38 ndrei joined #salt
05:42 anuvrat joined #salt
05:49 n8n joined #salt
06:16 aw110f joined #salt
06:16 happytux_ joined #salt
06:18 ramteid joined #salt
06:19 aw110f_ joined #salt
06:22 felskrone joined #salt
06:27 kiorky joined #salt
06:32 picker joined #salt
06:43 allanhung joined #salt
06:48 alanpearce joined #salt
06:54 wangxh joined #salt
07:03 jhauser joined #salt
07:05 [vaelen] joined #salt
07:06 greyhatpython joined #salt
07:06 greyhatpython joined #salt
07:09 monokrome joined #salt
07:11 chiui joined #salt
07:13 alanpearce joined #salt
07:15 sroegner joined #salt
07:17 ipalreadytaken joined #salt
07:20 jdmf joined #salt
07:29 Katafalkas joined #salt
07:30 joehillen joined #salt
07:49 thayne joined #salt
07:52 jalaziz joined #salt
07:54 aw110f_ joined #salt
07:56 CeBe joined #salt
07:56 JeffHR joined #salt
07:57 JeffHR Is this a valid jinja check?:   {% if salt['pkg.version']('rsyslog') != "" %}
07:57 JeffHR documentation says that pkg.version returns an empty string if a package is not installed, but the check doesnt seem to work
08:05 ndrei joined #salt
08:06 nliadm joined #salt
08:13 linjan joined #salt
08:17 babilen JeffHR: I would write that as "{% if salt['pkg.version']('rsyslog') %}"
08:17 stephanbuys joined #salt
08:17 babilen (well, I'd try that)
08:18 MrTango joined #salt
08:19 JeffHR thanks will try that!
08:19 JeffHR looks cleaner too
08:19 JeffHR but i think i found the problem.  the server i tested the state on doesnt have rsyslog installed, and i assumed it did
08:20 JeffHR :)
08:22 babilen Yeah, assumptions are bad :)
08:23 davet joined #salt
08:30 babilen Hmm, would GitFS work fine with submodules? It would make it *much* easier to deal with formulas as I wouldn't have to have one repository for each place that I want to use a formula
08:39 NV joined #salt
08:44 chiui joined #salt
08:49 Vinay__ joined #salt
08:49 Vinay__ Hi
08:50 Vinay__ I would like to know how Salt works with respect to configuration management
08:53 babilen It works great! Is there something specific you'd like to know?
08:58 andrej joined #salt
09:03 darkelda joined #salt
09:04 babilen Vinay__: That's all you wanted to know?
09:04 sroegner joined #salt
09:04 Vinay__ how do we go about changing configuration for windows machine
09:04 Vinay__ i needed help in the installation and how to use SALT
09:05 Vinay__ but I could not find any documents on the website
09:05 babilen I have no experience with Windows minions at all, sorry
09:05 babilen http://docs.saltstack.com/en/latest/topics/installation/windows.html
09:06 Vinay__ got that
09:06 Vinay__ thank you
09:07 babilen http://docs.saltstack.com/en/latest/topics/windows/windows-package-manager.html is probably of interest to you too
09:08 Vinay__ ok
09:13 giantlock joined #salt
09:15 babilen Do I have to write an external module if I want to run specific commands (with arguments) on a minion? (I want to execute "new-certificate NAMEOFMINION" on a different host and require that state in an overstate run)
09:16 babilen Or is there an easier way to achieve that?
09:30 thehaven joined #salt
09:35 sroegner joined #salt
09:38 chiui joined #salt
09:39 gothix joined #salt
09:39 derito joined #salt
09:39 derito Sorry if it sounds stupid, but I can't seem to find the answer. Do you know the length of the key used by Salt for AES encryption or where I could find it?
09:44 ndrei joined #salt
09:48 Lomithrani joined #salt
09:50 jcsp joined #salt
09:54 ashb Okay so what the *hell* is going on with the quality of salt over the last three months?
09:55 ggoZ joined #salt
09:56 xt ashb: did you start using it three months ago?
09:57 babilen ashb: Anything in particualr?
10:00 zircote joined #salt
10:00 elfixit joined #salt
10:01 ashb babilen: right now: `iptables --help` gets run like 40 times during a highstate run and the output goes to std out
10:02 ashb and things like https://github.com/saltstack/salt/pull/11728/files doens't inspire confidence
10:02 ashb xt: started using it 6 months ago
10:03 xt ashb: I can assure you it was always like this
10:03 xt as long as I used salt
10:03 xt since late 2012 :)
10:05 babilen ashb: That pull request is ... yeah
10:06 ggoZ Guys, how many of you use ssh transport? Any blog posts evaluating its properties ?
10:06 elfixit joined #salt
10:11 Gareth joined #salt
10:15 dpac|away joined #salt
10:25 babilen How does GitFS behave if the configured repository contains git submodules?
10:25 babilen I guess I have to check the code
10:27 Nexpro joined #salt
10:38 zloidemon joined #salt
10:38 malinoff joined #salt
10:43 toddnni joined #salt
10:45 picker joined #salt
10:52 CeBe joined #salt
10:52 wangxh joined #salt
10:53 bhosmer joined #salt
10:56 _ale_1 hi guys
10:56 _ale_1 is there a salt client that i could use to connect and exec stuff from my machine, rather than the salt master ?
10:58 babilen I'm not aware of a local client, no
10:59 malinoff _ale_1, salt-api (http rest api) is merged into the main repo, so it will be available soon
11:00 n8n_ joined #salt
11:04 _ale_1 malinoff: cool
11:07 shaggy_surfer joined #salt
11:16 keekz joined #salt
11:22 Lomithrani1 joined #salt
11:22 ScrumpyJack joined #salt
11:24 jrdx joined #salt
11:25 _ale_1 babilen: i think the syndic is kind of doing that... i'll take a deeper look :)
11:25 _ale_1 i fail to find how to setup "slave-masters" if i want local masters in local DCs .... anyone able to point me at the doc ?
11:26 _ale_1 i know i read it somewhere
11:27 logix812 joined #salt
11:28 viq joined #salt
11:29 babilen _ale_1: That is what syndic does and documentation is at http://docs.saltstack.com/en/latest/topics/topology/syndic.html
11:30 TheThing joined #salt
11:39 sdfsw2g2h joined #salt
11:42 dsolsona joined #salt
11:42 Kraln joined #salt
11:43 JoeHazzers joined #salt
11:44 JoeHazzers maybe i'm missing something, but why does the command: salt 'testbed[1-5].tld' test.ping
11:44 JoeHazzers not match a single minion, despite salt showing up states for minions of testbed1.tld all the way through to testbed5?
11:46 malinoff JoeHazzers, to match a single minion, don't use any globbing - salt 'testbed1.tld' test.ping
11:46 JoeHazzers ah, never mind
11:46 JoeHazzers for some reason, globs won't match leading zeroes?
11:46 JoeHazzers for example, testbed [01-10]
11:46 babilen no, surely not
11:47 malinoff JoeHazzers, https://docs.python.org/2/library/fnmatch.html
11:47 JoeHazzers that's a bit disappointing.
11:47 babilen But you did not have anything like that in your example
11:47 babilen testbed[1-5].tld should match testbed1.tld ... to testbed5.tld just fine
11:47 JoeHazzers that's true, and it turns out it does
11:47 JoeHazzers but how should i go about matching machines with leading zeroes?
11:47 babilen testbed0[1-5].tld
11:48 malinoff JoeHazzers, you can use a regex
11:48 babilen IO would pro ... ^^^
11:48 babilen http://docs.saltstack.com/en/latest/topics/targeting/globbing.html#regular-expressions
11:48 JoeHazzers in hindsight i might just go ahead and rename the machines
11:51 TheThing hindsight is 20/20
11:51 cuba1862 joined #salt
11:52 JoeHazzers hindsight is great when your infrastructure is not dependent on static canonical names :)
11:53 TheThing :D
11:54 bhosmer joined #salt
11:55 xinkeT joined #salt
11:55 cuba1862 left #salt
11:56 JeroenH_ joined #salt
12:01 dsaard joined #salt
12:04 stephanbuys joined #salt
12:09 sdfsw2g234sva joined #salt
12:10 babilen I have a problem for which I probably have to use the reactor system to solve it (distributing certificates from a central box to minions on-demand) ... I'm just not sure how I would deal with errors in that process
12:11 babilen Essentially some services require certificates to run and I would normally just have a file.managed state that I require ... But that would make it necessary to painfully maintain all certificates manually in the pillar
12:12 babilen The *only* way to run a command on another box to generate a new certificate for, say, newminion.tld is to use either the reactor or peer communication
12:13 babilen As I want to make sure that other minions can't see those certificates I can't use MinionFS, but have to use the reactor .. but then I am unsure how to express the "certificate generation and copying worked correctly" state that was triggered by events. Do you have any ideas?
12:15 babilen I mean the only thing I can come up with is to require a file.present state for that file that will be copied from the CA to the minion
12:17 toddnni joined #salt
12:18 vbabiy_ joined #salt
12:19 Sypher_ joined #salt
12:19 to_json joined #salt
12:22 vbabiy joined #salt
12:22 yomilk joined #salt
12:22 Sypher_ joined #salt
12:23 alanpearce joined #salt
12:24 to_json joined #salt
12:26 ipmb joined #salt
12:34 diegows joined #salt
12:35 zircote joined #salt
12:36 elfixit joined #salt
12:40 giantlock joined #salt
12:40 vbabiy joined #salt
12:42 JoeHazzers I'm trying to manage ini-style configuration. What's the best way to have all ini.set_options for a specific file be watched by a service?
12:43 cekz joined #salt
12:43 Guest84057 joined #salt
12:45 TyrfingMjolnir joined #salt
12:46 babilen JoeHazzers: There is no module to write ini configuration files yet. You could try if you can render a file.managed with "template: py" and then use ConfigParser in there to generate it from a suitable pillar.
12:46 babilen (or I haven't seen it)
12:47 JoeHazzers there seems to be one on the way http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.ini_manage.html
12:53 ggoZ joined #salt
12:55 dsaard joined #salt
12:56 yomilk joined #salt
12:59 babilen Can I manage reactor files in/with GitFS?
13:00 timoguin I don't think so, since they're master-specific
13:01 vbabiy joined #salt
13:02 jslatts joined #salt
13:02 babilen So I would manage them in an additional repository (and not, say, _reactor or so) and would perform a manual checkout?
13:02 timoguin yea
13:02 babilen So far everything (states, extmods, external grains, ...) are in one repository. Pity
13:03 timoguin https://github.com/saltstack/salt/issues/12827
13:03 babilen .oO( If only I had some system to automate that! )
13:04 babilen And that is exactly my issue, thanks for linking it
13:04 timoguin ah looks like you can put them in file_roots, so gitfs should work
13:04 timoguin just have to use the full path to them in the master config
13:05 babilen yeah, I just read that. It is, after all, simply a git checkout that lives somewhere on disk
13:10 ggoZ joined #salt
13:10 jrb28 joined #salt
13:14 Fa1lure babilen: interesting to hear what you discover
13:15 Fa1lure with regards to submodules, but I might have missed backlog :/
13:15 jrdxusa joined #salt
13:15 bhosmer_ joined #salt
13:18 racooper joined #salt
13:19 _ale_1 babilen: ah, perfect :) thanks!
13:19 _ale_1 (syndic link)
13:19 babilen I'll go with the /var/cache/salt/master/gitfs/... idea for now, but don't particularly like it. Would like to simply be able to reference reactor files in _reactor directly in the reactor: ... block.
13:19 babilen _ale_1: You are welcome, have fun!
13:20 babilen Fa1lure: I will have to test that.
13:20 _ale_1 thanks - i was just thinking, once could "mis-"use that to use it like a "salt" client and the syndic actually being the one really doing the work :)
13:20 timoguin babilen: yea i'm curious to hear how that works out
13:21 _ale_1 s/once/one
13:21 babilen Fa1lure: It is just that we use formulas in different setups and I would like to have all formulas in one place *and* make sure that pushing changes to them doesn't break something in a completely unrelated setup.
13:21 _ale_1 s/"//
13:21 timoguin especially because the salt master doesn't actually checkout the git repo locally
13:21 JoeHazzers how can i only run a command if a certain file *does not* exist?
13:22 timoguin {% if salt['file.exists']('/path/to/file') %} do stuff {% endif %}
13:23 mcm0245 joined #salt
13:23 timoguin errr.... 'file.file_exists' that is
13:23 Guest97219 joined #salt
13:24 mcm0245 Hey all. I have a pillar that holds the name of a monitoring group. On my salt master, I would like to write out a file for each minion that contains that group. I have a salt mine.get iterating through the minions, but I'm stuck on printing out the pillar data, since it is not the master's pillar that I want to record, but the individual minion's.
13:25 tinuva joined #salt
13:25 timoguin JoeHazzers: another correction... if not
13:25 JoeHazzers ;)
13:25 mcm0245 I feel like there should be a simpler way than setting a mine_function for each pillar.get and having to walk the entire mine.get array again, just to pull a pillar.
13:25 timoguin three tries!
13:25 cuba1862 joined #salt
13:26 mcm0245 And it appears that jinja does not allow complex substition such as: salt['mine.get']('{{ each_minion }}', 'pillar.get'). That gives me an empty array, but I can replace the '{{ each_minion }}' with '*' and get the entire array.
13:28 babilen timoguin: yeah, it is indeed a problem with the incomplete checkouts.
13:29 mcm0245 So is there a way, once inside mine.get for loop for each minion, to do a pillar lookup from the minion's prospective? Or is it possible to do another mine.get and filter to just the current minion from the outside loop?
13:29 Lomithrani1 Hi  guys : salt '*' mine.get '*' network.interfaces  returns me "App01:    ----------" is it normal ?
13:31 mcm0245 Lomithrani1: Have you set mine_functions to allow network.interfaces?
13:31 Lomithrani1 http://pastebin.com/6RTZucRe
13:32 Lomithrani1 thats my minion file in salt
13:32 Lomithrani1 mcm0245: is there something more to do ?
13:33 monokrome joined #salt
13:33 bastion1704 joined #salt
13:33 Lomithrani1 by minion file I mean /salt/minion
13:33 _ale_1 ummm but you do network.interfaces not network.ip_addr ?
13:33 mcm0245 Lomithrani1: Looks like you have network.ip_addrs in your function
13:33 mcm0245 _ale_1: Aye
13:33 bastion1704 Good morning, is it possible to target netgroups in a if inside a state ?
13:34 babilen timoguin: Thanks for commenting
13:34 timoguin np
13:34 timoguin i've been watching that one
13:34 Lomithrani1 can I just allow all network functions ?
13:35 Lomithrani1 like mine_functions :  network
13:35 _ale_1 did you try network.* ?
13:35 _ale_1 sorry am guessing :)
13:35 babilen timoguin: My current plan is to use the salt formula and use salt.states.git.latest to ensure that I have a local checkout
13:35 Lomithrani1 _ale_1 going to try that
13:36 babilen timoguin: I will then restart the master if that leads to changes. I really don't want to do that manually
13:36 Guest97219 joined #salt
13:36 Teknix joined #salt
13:37 mcm0245 Is it possible to have a mine.get which iterates thorugh all minions, then another mine.get inside of it which pulls a value for that specific minion?
13:37 mcm0245 I cannot seem to get anything like salt['mine.get']('{{ each_minion }}', 'pillar.get') to return properly
13:37 babilen I guess I will endup doing the same for submodules with "submodules: True" if GitFS doesn't work with those.
13:38 JoeHazzers timoguin: how do i make said command contained in an if block restart a service? :3
13:39 JoeHazzers oh, watch_in
13:39 Guest97219 joined #salt
13:40 timoguin JoeHazzers: you can either use the service state and watch whatever you want to trigger your reload or you can use module.run to manually call the service.restart module
13:41 pass_by_value joined #salt
13:42 vejdmn joined #salt
13:43 aquinas_ joined #salt
13:44 _ale_1 mcm0245: maybe if you explain what you're trying to do it'd help with context and if what you're asking doesnt work, find a different way ?
13:45 rojem joined #salt
13:45 mcm0245 _ale_1: I have a pillar for monitoring-group defined for various hosts. I would like to have the salt-master write a file that contains this value for each host.
13:46 Teknix joined #salt
13:46 mcm0245 So I have a state on the master that does a for each_minion in mine.get on grains.item and inside that loop writes a file per minion containing some of those grain values
13:47 babilen mcm0245: So your master is *also* a minion (which you use to manage that file) and you want to be able to access the pillar values of *other* minions from that particular one?
13:48 mcm0245 babilen: Yes. I have exported the pillar.get of my monitoring-group in the mine, so I can look it up from the master
13:48 babilen mcm0245: So you simply have to lookup the respective value in the salt-mine?
13:48 mcm0245 but jinja does not appear to allow me to next variables in that mine.get. For example: salt['mine.get']('{{ each_minion }}', 'pillar.get') returns an empty array
13:49 mcm0245 that {{ each_minion }} nested inside does not seem to get evaluated
13:49 babilen mcm0245: What is {{ each_minion }} there?
13:49 mcm0245 If I replace it with '*' I get the values of all minions, so I can see that it is capable of working
13:49 babilen mcm0245: Could you paste the complete example to, say, http://paste.debian.net ?
13:50 babilen Sounds to be a problem with your jinja rather than anything else
13:50 aquinas_ joined #salt
13:51 Hazelesque joined #salt
13:51 debian112 anyone know where I can get an old version of packages for ubuntu: 2014.1.1: http://ppa.launchpad.net/saltstack/salt/ubuntu/pool/main/s/salt/
13:51 debian112 I guess one was never made
13:52 mcm0245 babilen: http://pastebin.com/t9U8NM3v
13:52 Hazelesque Hi! :)
13:52 timoguin debian112: that's a restriction of the PPAs. they don't let you keep multiple version
13:52 mcm0245 So inside of a for each_minion in salt['mine.get'.... I am trying to perform another mine.get, but only for the current value of each_minion
13:52 timoguin debian112: you might be able to try  debian.saltstack.com
13:52 babilen mcm0245: Do me a favour and use a less shitty pastebin in the future. http://refheap.com, http://paste.debian.net or http://pastie.org are all much nicer to look at and use than pastebin.com
13:53 to_json joined #salt
13:53 mcm0245 babilen: Can do!
13:53 Hazelesque So... I was wondering... I understand that the Salt "states" system is built on top of the remote execution framework etc...
13:53 Hazelesque we already use CFEngine here
13:53 babilen mcm0245: Yeah, you cannot nest like that
13:54 debian112 timoguin: yeah I have that version for my debian systems
13:54 Hazelesque can I use Salt just for remote execution, and ignore the "states" stuff?
13:54 mcm0245 babilen: :( Any ideas?
13:54 timoguin Hazelesque: yea sure can
13:54 timoguin That's what I did for about a year
13:54 Hazelesque specifically, "OMG let's throw out CFEngine" is going to be a hard sell
13:54 mcm0245 babilen: Do I just need to walk the entire mine.get '*' array again for my specific minion?
13:54 Hazelesque but "Hey, let's use Salt to do our remote execution and reporting and stuff rather than writing something from scratch" is going to be an easier sell
13:54 babilen mcm0245: I would write that in Python or pydsl rather than fight jinja ...
13:55 Hazelesque given we're a Python shop, and we'd end up writing something in Python
13:55 Hazelesque and our existing remote execution stuff that we cooked up is a bit... meh
13:55 babilen mcm0245: But let me think for a second
13:55 timoguin if you have python devs smart enough to be able to write Fabric scripts then they should be able to write Salt modules pretty easily as well
13:56 babilen mcm0245: I don't think that you get around it. You essentially want to evaluate jinja in two stages, which does not seem to work. I am no jinja guru, but you can't rely on the fact that nested expressions are evaluated earlier ..
13:57 Hazelesque our "clbappmaint" code started out as a script to take a bunch of servers, and for each server: 1. remove server from (specified) load balancer pool, 2. run (specified) list of commands and raise an exception if anything fails, 3. use python-requests library to do a GET on a health check endpoint and raise an exception if that fails, 4. put server back in load balancer pool and move on to next one
13:57 babilen mcm0245: Should be pretty straightforward to write that in Python though. See http://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.py.html (not entirely sure how to access the saltmine in there)
13:57 Hazelesque and it's kind of... grown into a horrid "one command to run anything anywhere"
13:57 debian112 timoguin: man that sucks then. Not looking to upgrade my master yet to 2014.1.5
13:57 babilen mcm0245: http://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.pydsl.html might be worth a look too if py is too verbose for you
13:59 mcm0245 I was just looking at pydsl, but it too doesn't mention mine functions
13:59 timoguin debian112: maybe you can build a .deb from the 2014.1.1 sources
13:59 timoguin but, yea, it's a pretty crappy limitation of launchpad
13:59 babilen debian112: You can only have a single version in an APT repository (that is by design) -- If you need old versions you have to make them available in another one or in a local cache (e.g. /var/cache/apt/archives/)
13:59 mcm0245 I feel like this is a pretty cutting edge question, but I wouldn't have expected it to be :(
13:59 babilen timoguin: It is by design, repositories that offer more than one version of a package are broken
14:00 ajprog_laptop joined #salt
14:00 mcm0245 Is there a good way to record pillar data in a grain?
14:00 debian112 babilen: I don't have we are building in ubuntu support now, so this will be our first ubuntu minion
14:00 timoguin yea i'd just run my own local package repo and only pull new packages into a dev environment
14:00 mcm0245 I've already got the mine.get walking grain data. If I could export my monitoring-group pillar into a grain, it would just be available
14:00 babilen mcm0245: I wouldn't be too surprised if you can actually access the mine in there quite easily, but that that simply hasn't been documented yet
14:01 alanpearce joined #salt
14:01 timoguin Hazelesque: that all sounds like it'd work very well as salt modules.
14:01 Hazelesque timoguin: we use the Rackspace Cloud for most of our stuff
14:02 babilen debian112, timoguin: That is exactly the right approach. One might even adopt the whole "stable", "testing", "unstable" approach in Debian (or just "test" vs. "prod" or whatnot)
14:02 timoguin salt-cloud has good support for openstack, so you could manage the entire VM life cycle
14:02 Hazelesque so we have a home-grown tool called "ovensafe" (it's "made of pyrax" ahem) that provisions servers for us and stuff atm
14:03 quickdry21 joined #salt
14:03 Hazelesque looking to add cloud-init support to it so we don't have so much "paramiko sftp.putfo(StringIO(CFENGINE_COMMUNITY_GPG_KEY)) ..." style magic in the bootstrap process, heh
14:04 Hazelesque using paramiko and sftp.stat() to check for a flag file on a remote host is funnnn ;)
14:05 Hazelesque (which is how we know when CFEngine has done a complete run for the first time >_>)
14:05 timoguin salt-cloud handles bootstrapping new VMs very well. it'll create the VM, copy over the generated keys, run the salt bootstrap script, and run any states you specify
14:05 Hazelesque cool :)
14:05 Hazelesque can it pass a cloud-config file in as metadata and let cloud-init do the work for it?
14:06 * Hazelesque finds https://github.com/number5/cloud-init/blob/master/doc/examples/cloud-config-salt-minion.txt
14:08 babilen mcm0245: Can't find the mine in salt/renderers/{py,pydsl}.py .. sorry
14:08 timoguin Hazelesque: there's an open issue for that: https://github.com/saltstack/salt-cloud/issues/625
14:08 timoguin now that salt-cloud has been merged into salt i'm not sure the status of that though
14:09 Hazelesque interesting :)
14:10 babilen mcm0245: Same for jinja.py btw
14:10 Guest97219 joined #salt
14:11 kermit joined #salt
14:12 jalbretsen joined #salt
14:12 babilen mcm0245: __salt__['mine.get'](...) might work
14:12 babilen mcm0245: cf. http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.mine.html#module-salt.modules.mine
14:18 tkharju1 joined #salt
14:19 mgw joined #salt
14:19 baniir joined #salt
14:24 Lomithrani1 do I have to do something special to use salt.mine in jinja (assuming I already did mine.sent on the function I us in jinja) ? I only use state , no pillar
14:25 Lomithrani1 http://pastebin.com/L4AVyJFe
14:26 timoguin that should be enough
14:27 Lomithrani1 oh it might be pcre intead of grains
14:28 Lomithrani1 yeps that was it thanks @timoguin
14:29 Guest97219 joined #salt
14:34 _mel_ joined #salt
14:44 tedski ugh... The salt-api project has been merged into the main Salt repository as of Salt's Helium release.
14:44 tedski that's great... except Helium isn't released.  which means, there is no current documentation for salt-api
14:45 tedski http://salt.readthedocs.org/en/latest/search.html?q=api&check_keywords=yes&area=default
14:46 will joined #salt
14:50 tkharju joined #salt
14:50 debian112 timoguin: debian packages works just fine on ubuntu : I don't like ubuntu - but this new product uses it
14:50 rallytime joined #salt
14:52 ipmb joined #salt
14:53 yomilk joined #salt
14:56 kivihtin joined #salt
14:57 Guest97219 joined #salt
15:05 thedodd joined #salt
15:05 stephanbuys joined #salt
15:06 bluenemo joined #salt
15:06 bluenemo hi guys. I want to execute some bash with cmd.wait. I want to run that cmd.wait when a few files are missing. what would be the mosty easy, best practice way to do so? As I see a number of ways to do so I though I'd ask. It has to be multiple files (that change or are absent to trigger the cmd.wait)
15:07 tkharju joined #salt
15:07 worstadmin joined #salt
15:08 _mel_ Hi. can i somehow exlude some states? i have a "core" state who includes for example apt, exim4, bacula and so on. but i like to have a mailserver who don't have exim4 client. can i exclude this somehow?
15:08 mateoconfeugo joined #salt
15:09 Eugene Jinja templating is supported in the statefile definitions, including if blocks
15:10 timoguin _mel_: you could also break up your core.sls and apply the states individually with the top file
15:11 timoguin or like Eugene said you could template your core.sls and only include the exim state if the minion matches whatever your requirements are
15:11 _mel_ yeah, but i'd like to something like '*': - core and 'someserver': - !core or so. because splitting means to not combine states
15:12 timoguin well there's no exclude functionality.
15:12 _mel_ can i write a state called exim4.server who makes sure that exim4.client don't get applied?
15:13 _mel_ so i could include exim4.client into core and just add exim4.server on that one server
15:13 Eugene You could have exim4 include logic to apply a client- or a server- style functionality
15:15 pdayton joined #salt
15:15 _mel_ both are server in the same net. but i like to have one relay. how can i separate them?
15:15 mgw joined #salt
15:16 _mel_ maybe with a name-scheme?
15:16 peters-tx joined #salt
15:16 timoguin that's one way. you could also set a pillar or grain that defines the server's role
15:17 timoguin and match based on that
15:17 xinkeT joined #salt
15:18 _mel_ pillar like i can set some sort of attribute? Sorry, i didn't get the pillar concept yet.
15:18 kermit joined #salt
15:18 Guest97219 joined #salt
15:19 Joseph__ joined #salt
15:19 thayne joined #salt
15:19 whiteinge tedski: the salt-api docs are now in the mainline docs. thanks for the mention though. i'll add a direct link
15:20 timoguin _mel_: yea kinda like that. pillar let's you apply key-value pairs to minions for arbitrary filtering or for giving minions access to sensitive data
15:21 timoguin i have things like 'role: web' defined in mine
15:21 timoguin as well as anything i might use to dynamically configure my states
15:21 gmoro joined #salt
15:23 tedski whiteinge: i can't find them there, though
15:23 pressureman joined #salt
15:23 tedski whiteinge: when i search the mainline docs for api, nothing relevant to salt-api is in the results
15:24 whiteinge tedski: pushed the links
15:24 whiteinge tedski: hm. looks like one of the docs servers is out of sync. running a rebuild...
15:24 tedski whiteinge: thanks
15:25 whiteinge hit refresh a few times if you get a 404 and the loadbalancer will send you to the good server :-P
15:25 tedski hahaha
15:25 whiteinge i'm working on retiring those old servers today
15:27 Guest97219 joined #salt
15:27 toastedpenguin joined #salt
15:27 wendall911 joined #salt
15:28 patarr hello all. I'm having trouble with a cmd.run state directive that breaks when salt runs it, but runs fine when manually run. I have the state file directive and the error output in this paste: http://pastebin.com/kqG96USa
15:28 racooper can jinja in pillars do "or" conditionals? trying two things and neither seem to work, and can't find any documentation on this (maybe don't know where to look and google-fu is failing). https://gist.github.com/racooper/75f4ce1a9cff9e911a64
15:28 scoates joined #salt
15:29 patarr racooper: that is invalid
15:29 patarr It's like writing python, or needs to have a boolean expression on the left, and on the right.
15:29 patarr expression1 or expression2
15:29 patarr If you look at your Jinja, you wrote 'servmon' or 'conf....
15:30 patarr So 'servmon' is evaluated as a boolean expression. And in languages like python, a string is a truthy value so that is evaluated to "true"
15:30 patarr An empty string like "" is false. But 'servmon' is true. So you have "true" or ... which will obviously always evaluate true..
15:31 racooper so.... {% if 'servmon' in grains['roles'] or 'configmaster' in grains['roles'] %} would be correct?
15:31 will joined #salt
15:36 bemehow joined #salt
15:40 Outlander joined #salt
15:42 Guest97219 joined #salt
15:47 Joseph__ is utahdave around
15:48 rojem joined #salt
15:50 Guest97219 joined #salt
15:50 tkharju joined #salt
15:52 tligda joined #salt
15:53 stevednd whiteinge: I believe helium has some additions coming like 'only_if' for all states, right?
15:54 whiteinge stevednd: yessir! unless and onlyif are now state globals
15:54 whiteinge there's a few new requistes too like onchanegs and onfail
15:54 stevednd are they exclusive?
15:54 stevednd like can I have unless: {{sometest}} onlyif: {{someother}}
15:55 whiteinge yeah, that works (afaik)
15:55 whiteinge Joseph__: not until late today
15:56 stevednd I know it seems wonky, but basically my unless would be executing a command test, and the onlyif would be determining if it should even do the state at all
15:56 troyready joined #salt
15:56 kula I'm successfully using jinja imports to pull in macros from other sls files, but I'm failing to pull in a variable set at the top level of the imported file. Anyone have any hints on that?
15:56 Joseph__ whiteinge: boo i thought he was an android and thus never needed sleep since he always seemed to be around :)
15:56 kula Background: https://gist.github.com/tlk2126/7f4bba239b6038a8eba4
15:56 Joseph__ kula: you must be a wizard of the dark arts to be using macros in salt state files :)
15:57 whiteinge stevednd: doesn't sound unreasonable
15:57 kula I'm something of the dark arts, I'll grant you that. Wizard or not, who can tell?
15:57 Joseph__ kula: what's the variable you are trying to import? That jetty string/
15:57 Joseph__ ?
15:58 timoguin Joseph__: https://github.com/makinacorpus/makina-states
15:58 timoguin that has the most macros i've seen
15:58 kula The 'jetty.imports' in line 11, which is set in the imported file on line 3
15:58 Joseph__ timoguin: are yo utrying to blind me!!?
15:58 kivihtin joined #salt
15:58 anuvrat joined #salt
15:59 timoguin Joseph__: yep! the top.sls will blow up your head
15:59 TheThing joined #salt
15:59 Joseph__ timoguin: i am dying....ascii art!
15:59 Joseph__ kula: i am lookign at your file..just a sec
16:00 whiteinge it's the .extend() call
16:00 whiteinge kula: .extend() returns None so you can't use it in a for-loop
16:00 Joseph__ kula: you need to use jetty. not java.
16:00 Joseph__ i think
16:01 jonbrefe joined #salt
16:01 Joseph__ kula: on line 11
16:01 kula Ah, I wasn't even thinking of the .extend being the thing that's messing stuff up.
16:01 kballou joined #salt
16:02 Guest97219 joined #salt
16:02 whiteinge kula: there's a jinja extension which adds a ``do`` tag for this sort of thing: {% do thing.extend(otherthing) %}
16:02 whiteinge the extension is enabled in salt
16:03 allanparsons joined #salt
16:04 kula I can then use {% for item in do thing.extend(otherthing)%} ...?
16:06 bemehow_ joined #salt
16:06 kula Or not. I'll get this at some point.
16:07 whiteinge tedski: docs servers seem to be tamed for the time being. btw, the salt-api docs are linked from the homepage (look for "external API" or "netapi")
16:07 _mel_ Thx
16:08 whiteinge kula: you'll need two separate statements. {% do thing.extend(otherthing) %} {% for i in thing %}...{% endfor %}
16:08 matrix3000 joined #salt
16:09 kula Yep, I'm just discovering that, which is workable. I must have something else weird now, because I'm tripping salt's global exception handler.
16:10 tedski whiteinge: thanks again
16:11 stevednd whiteinge:  cmd.run's unless can't take an array of arguments correct?
16:11 patarr racooper: sorry, i went afk. Yeah that is correct.
16:11 whiteinge stevednd: no, you'll have to separate via semicolons or &&'s instead
16:11 stevednd right now I have a condition tests a mysql db for some records, and want to also test against a boolean jinja value
16:11 patarr Anyone? Could anyone let me know why salt is having trouble running this command? http://pastebin.com/kqG96USa
16:11 whiteinge stevednd: i'll bet yaml's multiline string syntax works there though if you want to make it readable at least :)
16:12 racooper it's ok. figured it out.  thanks for the pointers patarr
16:12 joehillen joined #salt
16:12 stevednd whiteinge: I'll have to convert jinja's boolean to be shell friendly, right?
16:12 KyleG joined #salt
16:12 KyleG joined #salt
16:12 mFacenet joined #salt
16:13 pdayton joined #salt
16:13 jonbrefe Does anybody knows which could be the values for "transport" in the cloud in the next release? it's not documented yet :)
16:14 chiui joined #salt
16:14 icarus joined #salt
16:15 whiteinge stevednd: think of the contents of those as self-contained shell scripts. you can use jinja but just remember jinja runs as separate step, then the yaml step to make the data structure, then finally salt starts evaluating that data structure step-by-step
16:15 ckao joined #salt
16:17 Guest84010 joined #salt
16:17 Joseph__ jonbrefe: what do you mean by "Transport"?
16:18 will joined #salt
16:19 jonbrefe 2014-06-20 09:57:54,849 [salt.cloud       ][ERROR   ] Failed to create VM tacotestsalt. Configuration value 'transport' needs to be set
16:19 kula For those of you playing along at home, https://gist.github.com/tlk2126/7f4bba239b6038a8eba4 now works.
16:19 kula Thanks Joseph__ and whiteinge for the hints.
16:19 jonbrefe Joseph_ i am using the vsphere.py from helium release
16:19 davet joined #salt
16:20 racooper I know there has to be a way to make this prettier/cleaner.... any resources? https://gist.github.com/racooper/9fa0e92bd83f5ef0df3b
16:20 jonbrefe This is in the code
16:20 jonbrefe salt.utils.cloud.fire_event(
16:20 jonbrefe 'event',
16:20 jonbrefe 'starting create',
16:20 jonbrefe 'salt/cloud/{0}/creating'.format(vm_['name']),
16:20 jonbrefe {
16:20 will left #salt
16:20 jonbrefe 'name': vm_['name'],
16:20 jonbrefe 'profile': vm_['profile'],
16:20 jonbrefe 'provider': vm_['provider'],
16:20 jonbrefe },
16:20 jonbrefe transport=__opts__['transport']
16:20 jonbrefe )
16:20 racooper pastebin jonbrefe !!!!
16:20 jonbrefe sorry
16:20 Joseph__ lol
16:21 Joseph__ racooper: you have a couple options
16:21 patarr why is salt's PATH modified? This is the error I get "which: no java in (/sbin:/usr/sbin:/bin:/usr/bin)" but root's PATH is which: no java in (/sbin:/usr/sbin:/bin:/usr/bin)
16:21 Joseph__ racooper: instead of driving pillar assignment by grain why don't you just use a role?
16:21 jslatts joined #salt
16:21 patarr i mean /sbin:/bin:/usr/sbin:/usr/bin:/usr/java/default/bin
16:21 Joseph__ jonbrefe: what cloud provider are you using/
16:21 patarr Salt can't call scripts that use java because its PATH is fubarred. Does anyone have any experience with this?
16:22 jonbrefe vsphere Joseph_
16:22 TheThing racooper: https://gist.github.com/anonymous/99f38e4def0419a1909f
16:22 Joseph__ jonbrefe: ah i believe that's VERY new and i woudl expect bugs in it
16:22 Joseph__ in either the code or the documentation
16:22 TheThing Also, please use pillar to do this
16:22 Joseph__ jonbrefe: and yes i know that's not very helpful sorry
16:23 jonbrefe Joseph_ I think I will end reading the code and try to figure it by myself
16:23 Joseph__ TheThing: yea that's def improvement but i still say a simple if condition for a role is even better
16:23 Joseph__ jonbrefe: and then make a PR :)
16:23 whiteinge jonbrefe: transport in that context is referring to the new raet system. there's a recent salt-air episode about it. docs are still in the works (there are light docs in the repo already)
16:24 jonbrefe Joseph_: Problem Record?
16:24 Joseph__ pull request
16:24 racooper thanks TheThing. and Joseph__  I thought roles were simply defined as grains? maybe I missed something...
16:24 Joseph__ whiteinge: is RAET something i can actually turn on now in 2014.1.5?
16:25 Joseph__ racooper: roles are whatever you want them to be. They don't really exist in salt. They are just a generic conccept that is useful to leverage.
16:25 whiteinge no. it's in helium
16:25 TheThing I want helium :<
16:25 TheThing so many cool stuff in helium
16:25 jonbrefe We all want helium :D
16:25 Joseph__ racooper: i personally preferring drivign role assignment through pillar myself actually
16:25 TheThing jonbrefe o/\o
16:26 racooper yeah I haven't gotten that far yet. my custom grains/roles are staticly assigned. but I only have 20 hosts to deal with right now so it's not too bad.
16:26 Joseph__ I am really interested in RAET but have had no time to look at it
16:27 Joseph__ racooper: yea but imagine dealing with role assign with a hundred or a thousand. Becomes a maintenance nightmare IMHO. That's why i use pillars because the role assignment is set in one place and its controlled by the master.
16:27 Joseph__ racooper: so i don't need to worry about a rogue custom grain on minion 500 out of a 1,000 node deployment
16:27 racooper I'll get there eventually. right now I'm just trying to get stuff standardized across what I do have. it's still a mess.
16:28 Joseph__ racooper: what do you have now? I mean pre salt as it were
16:28 matrix3000 left #salt
16:29 racooper 20 or so servers that were set up as needed, or inherited from other groups for support. been mostly using salt's remote execution but trying to get states normalized as I have time to work on them.
16:29 Joseph__ whiteinge: this returns forbidden ? http://www.saltstack.com/blog/
16:29 Joseph__ racooper: gotcha
16:29 Joseph__ racooper: word of warning...jinja is easy to use incorrectly. You can make things work but then it becomes a maintenance nightmare
16:29 jimklo joined #salt
16:30 Joseph__ racooper: jinja is great for very specific usages but it can make state files unreadable very quickly
16:31 racooper that's why I'm trying to keep it out of states as much as possible.  I have a few config templates for stuff like denyhosts with jinja but that's about it so far, this is my first real approach into doing conditional stuff.
16:34 happytux joined #salt
16:34 Guest90210 joined #salt
16:37 whiteinge Joseph__: temporary hiccup maybe? looks like it's back
16:38 Joseph__ whiteinge: yep and the search is different?
16:38 matrix3000 joined #salt
16:38 shaggy_surfer joined #salt
16:38 Joseph__ kinda html5 cool looking maybe?
16:38 matrix3000 salt "S@$host" state.high "{eth0.1: { network.managed: [{enabled: True}, {ipaddr: $newIP}, {netmask: 255.255.0.0}]}}"
16:38 rlarkin joined #salt
16:39 matrix3000 is that something i could do in salt to set the net interface for a host
16:39 matrix3000 in puppet i was able to do something similar, but not sure with salt
16:40 thayne joined #salt
16:41 aaditya joined #salt
16:41 jimklo joined #salt
16:43 belak joined #salt
16:43 patarr matrix3000: there's a network module, perhaps it can
16:43 Joseph__ matrix3000: just be aware that salt doesn't do incremental updates. It replaces whatever was originall there. This also has only really be battle tested on centos. I think debian/ubuntu support was only just recently added. No idea about windows
16:44 Joseph__ matrix3000: salt can configure network itnerfaces but if you want to do something like specify the network hostname (e.g. Centos /etc/sysconfig/network) then that i don't know about
16:44 smcquay joined #salt
16:45 Ryan_Lane joined #salt
16:46 patarr what version of salt is helium? I'm so let down the docs talked about cmd - creates and then mentions it's for helium towards the end :(
16:46 Eugene 2014.2
16:46 forrest joined #salt
16:46 Eugene And yes, the "live" docs are for the dev branch on git
16:46 schmutz joined #salt
16:46 Joseph__ patarr: lol i know...i see soemthing really cool in the docs and i say oh i want to use that and then i realize its for helium and i do a "doht!"
16:46 timoguin the version isn't determined yet. it'll be based on whatever month the RC is cut during
16:47 timoguin 2014.6.1 if it's this month
16:47 Eugene Ah, I thought the Y was release-of-year
16:47 Eugene Ubuntu style, eh
16:47 Joseph__ timoguin: its a little thing but i really do appreciate a sane versioning scheme that actually is connected to reality
16:47 Eugene Even less meaningful numbers, but at least they're incrementing!
16:47 Eugene (seriously, what's wrong with Semantic Versioning?)
16:47 * timoguin shrugs
16:48 timoguin there's good arguments for both
16:48 Eugene Semantic has the advantage of being based in how software works
16:48 Joseph__ is there an actual page that lists all the major features that are goign to be made available in helium
16:48 timoguin i think the idea was that 0.17, for example, didn't really reflect that stability of the project
16:48 bhosmer joined #salt
16:48 timoguin Joseph__: that'll get compiled
16:49 Joseph__ timoguin: pardon..not sure i follow?
16:49 bhosmer_ joined #salt
16:49 Gareth morning
16:49 timoguin Joseph__: generally the release notes get editted all the way up until the release is actually cut
16:49 Joseph__ timoguin: oh hahaha
16:49 Joseph__ timoguin: gotcha
16:50 Joseph__ timoguin: there are so many tantalizing tid bits about helium out there though. I question whether the salt developers are getting any sleep.
16:50 whiteinge ^^ no
16:51 whiteinge Joseph__: i don't think we've got a single page yet that summarizes helium-isms
16:51 Ahlee whiteinge: oi.  Is there a way to get the JID back from libpepper?  I see a todo to add that a la salt-cli, so i'm guessing not (since looking at the returns, it doesn't appear to be requesting)
16:52 Joseph__ whiteinge: sounds like you just need a one liner. With this release, you now have a ring of power.
16:52 Joseph__ etc
16:53 ipalreadytaken joined #salt
16:53 whiteinge Ahlee: yes via the local_async client. so you can only get the jid or the job result in a single HTTP response. (that issue is to add both to the same response)
16:53 whiteinge Joseph__: haha
16:53 patarr Is there a way of implementing -creates without actually using it?
16:54 Joseph__ whiteinge: i am personally interested in any new cloud controller functionality. I want to put a stake in openstack and leave it in an unmarked grave.
16:55 Ahlee whiteinge: that's what i thought, and what i meant
16:55 Ahlee whiteinge: thanks.
16:56 whiteinge Joseph__: seems to be a common sentiment :)
16:56 thayne joined #salt
16:56 Joseph__ salt is almost there i can almost taste it.
16:57 n8n joined #salt
16:57 Guest90210 joined #salt
16:57 Joseph__ i am in the process of working through the salt controller documentation
16:57 Joseph__ which is uh maybe not as detailed as one would hope...
16:57 whiteinge Ahlee: how soon do you need that? it's been on my bucket list for a good while...
16:57 MatthewsFace joined #salt
16:58 Ahlee whiteinge: oh i didn't notice salt-api merged in
16:58 schimmy1 joined #salt
16:58 Ahlee is a congrats in order? if so, congrats, if not, ignore this
16:58 whiteinge indeed!
16:58 whiteinge :D
16:58 whiteinge yesterday was a good (but long) day
16:58 jalaziz joined #salt
16:59 belak left #salt
16:59 Ahlee eh, not sure on a tiem frame.  Need to look into if i actually think me doing a local_async then polling periodically would actually be better than what i'm replacing
17:00 Ahlee as right now that's what we do, and it's flakey
17:00 Ahlee but, now i rememberwhy we did it.
17:00 Ahlee i suppose a better use case would be actually getting a subscription to the events/ listener
17:01 whiteinge yeah, things are really moving in that direction. the reason LocalClient().cmd() is currently rubbish is because it's not listening to events like cmd_cli() is
17:01 patarr What does this mean? Service elasticsearch is already enabled, and is dead
17:01 scoates joined #salt
17:02 Ahlee rather than returning both, i'd rather see you put time into a local_async call with subscription to the /events listening for updates on the JID returned :)
17:02 whiteinge Ahlee: i need to update that method. it's making salt-api work bad :(   honestly the CLI and salt-api should be using the same code paths. i'm a little grumpy they're not
17:03 Ahlee but, that'd just be you doing my work for me
17:03 Ahlee whiteinge: /events ?
17:03 whiteinge no, LocalClient().cmd() vs LocalClient().cmd_cli().
17:03 Ahlee ah!
17:04 whiteinge salt's CLI use to use LocalClient().cmd() but when it switched, that method started languishing
17:04 Ahlee i see
17:04 whiteinge think i'll take a stab at that this weekend. would be a wonder fix to get in for helium
17:05 scoates_ joined #salt
17:05 whiteinge *ful
17:06 Guest90210 joined #salt
17:06 whiteinge that will (should) also single-handedly fix pepper too
17:07 whiteinge well, i should say: bring in line with salt's CLI
17:07 Ahlee woo
17:07 Ahlee but yeah
17:08 whiteinge Ahlee: one of the super exciting things about raet is we'll have honest-to-god acks from the minions. no more "educated" guessing.
17:08 Ahlee thanks again for both :)
17:08 Ahlee whiteinge: oh nice.
17:08 Ahlee will raet also assist in the "this state will momentarily sever the network connectivity"?
17:09 whiteinge yes it will
17:09 Ahlee as this "schedule to run via atd and then run a state to verify" is getting taxing
17:09 Ahlee nice
17:09 Ahlee bring on raet!
17:09 whiteinge it's *completely* async. it's like a job queue on both ends
17:09 Ahlee ah
17:09 Ahlee then the master presumably has some internal arbitrage logic?
17:10 whiteinge yeah, i'm fuzzy on the precise details but it associates messages with a given job
17:10 Ahlee makes sense
17:10 whiteinge which allows those messages to come in at arbitrary times
17:11 Ahlee yay yet another job queue in our environment ;)
17:11 whiteinge and get reassembled
17:11 Ahlee at least i can play dumb
17:11 whiteinge haha
17:11 bhosmer joined #salt
17:11 Ahlee anyway, thanks for your time
17:11 whiteinge ttyl
17:15 Guest90210 joined #salt
17:19 Joseph__ whiteinge: would you say that in order to use the cloud controller successfully, a prereq is that a user is going to have to understand linux bridging and how that works with KVM?
17:20 aw110f joined #salt
17:21 Guest90210 joined #salt
17:22 kermit joined #salt
17:22 Guest90210 joined #salt
17:23 shaggy_surfer joined #salt
17:24 travisp joined #salt
17:24 Guest84025 joined #salt
17:25 whiteinge Joseph__: i haven't gone through that process from end to end yet so i'm not sure how much of the bridging is done for you
17:25 travisp Is it possible to create a random string in salt? I need to create a password but I don't care what it is as long as it's random, it's fine even if it's random every time I apply the state.
17:26 Joseph__ whiteinge: well it depends on how you set it up which ties into how you configure the hypervisor. I was just following the salt state example and i ended up bricking the machine's networking :)
17:26 whiteinge !modules.grains.get_or_set_hash | travisp
17:26 wm-bot4 travisp: http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.grains.html#salt.modules.grains.get_or_set_hash
17:26 Joseph__ whiteinge: do you know the go to person for cloud controller questions?
17:27 forrest wm-bot4, WHO ARE YOU??!?
17:27 forrest :P
17:27 travisp thanks whiteinge
17:27 picker joined #salt
17:28 anuvrat joined #salt
17:28 ajolo joined #salt
17:29 penguin_dan joined #salt
17:31 matrix3000 Joseph__: really, that's a bummer
17:31 Guest84025 joined #salt
17:31 Joseph__ matrix3000: what is?
17:31 forrest Corey, man you are being really mean to the puppet guys lately
17:31 matrix3000 Joseph__: that it doesn't do the sysconf/network
17:32 jimklo joined #salt
17:32 Joseph__ matrix3000: well it might...i just haven't found that anywhere. You should be able to handle that easily enough with file.managed i would think
17:32 matrix3000 not really
17:32 matrix3000 unfortuanltely it changes often every release
17:32 matrix3000 hence the salt.high
17:33 matrix3000 ill figure it out i guess
17:34 Joseph joined #salt
17:34 Joseph matrix3000: try http://salt.readthedocs.org/en/v2014.1.1/ref/states/all/salt.states.network.html?highlight=network#salt.states.network.system
17:35 Joseph thats supposed to handle global network setttings
17:35 Joseph and i saw hostname in the example
17:35 whiteinge Joseph__: tom was the primary. dave might be the go-to secondary. (i need to play with it so i can at least answer questions about it too)
17:35 Joseph whiteinge: Tom as in the founder of saltstack?
17:36 matrix3000 is that syntax from earlier correct
17:36 Joseph matrix3000: is that to me?
17:36 matrix3000 yea
17:36 matrix3000 salt "S@$host" state.high "{eth0.1: { network.managed: [{enabled: True}, {ipaddr: $newIP}, {netmask: 255.255.0.0}]}}"
17:36 Joseph matrix3000: i don't think so. You were setting information for a specific NIC. This is a separate function
17:37 whiteinge Joseph: yeah
17:37 Joseph matrix3000: you would need network.system function
17:37 Joseph whiteinge: oh lol okay. is he like the most technical CTO on the planet or something?
17:37 matrix3000 got any examples out there since the syntax is different from command line than from script
17:37 matrix3000 i ment states
17:37 scoates_ joined #salt
17:38 Joseph matrix3000: in the link i gave you go to the top of the file. There's an example there
17:38 whiteinge Joseph: he's a sys admin and an engineer by experience and training. if he didn't break away from the CTO thing to sling code a few times a week i think he'd go insane :)
17:39 matrix3000 Joseph: looks like it's just for a state file, I mean a single line command salt "server" the rest
17:39 Joseph whiteinge: i thought madness was a key job requirement of a sys admin?
17:39 whiteinge haha
17:39 Joseph matrix3000: oh you are looking for the execution commadn alt
17:39 Joseph just a sec
17:39 matrix3000 Joseph: yep, haha. np
17:39 Joseph matrix3000: salt.modules.network.mod_hostname(hostname)
17:40 Joseph try that out
17:40 patarr What's a good way of letting salt configure a bunch of different variables in a config file you're managing?
17:40 Joseph patarr: might need to be more specific on that one.
17:41 matrix3000 Joseph, what about manging that specific interface
17:41 matrix3000 the eth0.1
17:41 Joseph whiteinge: yea i just need to get a better understanding of what expectations tom and company have for people in terms of what they need to know and do with the networking prior to using the cloud controlelr
17:41 patarr Joseph: I have a config file with different settings that depend on the host I'm deploying it too. I don't want to make a ton of file.blockreplace stanzas in my salt state. Perhaps there's a more elegant way of doing it.
17:41 matrix3000 would that be salt.modules.network.eth0.1?
17:41 Joseph patarr: have you looked at jinja?
17:41 patarr Joseph: I'm using Jinja.
17:42 Joseph patarr: and its too ugly and big i take it?
17:42 kermit joined #salt
17:42 patarr Joseph: not necessarily. I'm just not sure how it will help me in this scenario. I need to edit a remote file on the system on random different lines.
17:42 Joseph matrix3000: i doubt it.
17:42 Joseph patarr: oh i see
17:42 druonysus joined #salt
17:42 druonysus joined #salt
17:42 Joseph patarr: yea i dont' think jinja templating is what you want there
17:43 matrix3000 Joseph: cause I can't find the stucture for that anywhere in the documentation and I need to be able to do that as well
17:43 Joseph patarr: will these values be updated frequently or are they usually static?
17:43 Joseph matrix3000: if you can't find it, its probably because its not supported thoguh i could be mistaken
17:44 patarr Joseph: oh wait! file.managed with template:jinja looks PERFECT
17:44 or1gb1u3 joined #salt
17:44 jimklo joined #salt
17:45 Joseph patarr: ...oh yea sorry i forgot about that :(
17:45 patarr Joseph: you led me on the right path. jinja would make total sense. I was just to constrained to thinking it only belongs in my sls files
17:45 dlam joined #salt
17:46 dlam in a state is there to "sleep" for a number of seconds befor continuing?
17:46 Joseph patarr: glad to be of help. though i hate jinja's face as a general rule it does have its uses
17:46 patarr i love jinja :)
17:47 Joseph patarr: i am sure jinja is wonderful for html templating. I can't stand ltos of it in my state files. It makes it hard to read!
17:47 Joseph patarr: which is the whole point of YAML or so i thought
17:47 Guest84025 joined #salt
17:47 patarr but beats writing state files in pure code! ;)\
17:48 Joseph patarr: in many cases i'd rather write a custom state module then have jinja barf in my YAML
17:48 chrisjones joined #salt
17:48 Joseph but that's just wheel house i guess
17:48 Joseph my
17:48 Guest84025 joined #salt
17:48 Joseph dlam: not really. You can however make it dependent on other states or conditions on the system. Are you familiar with requisites in salt?
17:49 Joseph patarr: my favorite is when someone has a blood if else if else jinja condition where each line is for one of their minions.
17:49 Joseph So 500 minions OVER 500 lines of jinja template code
17:49 patarr hehe
17:49 patarr you know what i hate? When i accidentally rm -rf my state directory.
17:50 Joseph patarr: hahahah....version control is a wonderful thing
17:50 Joseph i'd never have a prod system without gitfs
17:50 dlam Joseph: doh, yeah i guess i sorta understate requisites
17:50 scoates joined #salt
17:50 lionel__ joined #salt
17:50 dlam *understand,  e.g. - require:
17:51 dlam i got a number of application servers, which i would like to 'apache restart', but not all at the same time :D
17:51 Joseph dlam: salt's state management functionality is driven by states and changes to those states. The idea is that the ordering of the states can be controlled by requisites but it doesn't really "do" arbitrary sleeps
17:51 dlam (in a deploy thing im using Salt for)
17:51 Joseph though i suppose you could create a state module to do that
17:51 dlam ohhhh
17:51 Joseph dlam: have you looked at overstate?
17:51 dlam noooo neva heard of it
17:52 Joseph dlam: http://docs.saltstack.com/en/latest/topics/tutorials/states_pt5.html#states-overstate
17:52 Joseph dlam: it allows you to control the order in which states are executed across nodes
17:52 patarr Joseph: are the state files stored anywhere on the salt minions?
17:52 Joseph patarr: after you do highstate yea...they are in the minion's cache
17:53 patarr Joseph: I may have a chance then... i need to find this cache >:
17:53 Joseph dlam: so with overstate you can say FIRST this apache web server is started on node X THEN enforce this state on node Y
17:53 Joseph etc
17:53 Joseph patarr: omg you actually did that?
17:53 Joseph patarr: sorry...that sucks
17:53 patarr Joseph: yeah, live and learn.
17:53 Joseph patarr: there's cache on the master which might have it
17:53 Networkn3rd joined #salt
17:53 Joseph cd /var/cache/salt/master
17:55 patarr Joseph: luckily I still had the state file opened in vim and i could write out its buffer
17:56 dlam ohhhh cool, that looks like what i want :D
17:56 Joseph patarr: trust me been there. Except i did /usr
17:56 patarr LOL
17:56 Joseph dlam: for the record when you set up HDFS and HDFS isn't set up correctly, you end doing local file operations. :)
17:57 Guest84025 joined #salt
17:59 Guest84025 joined #salt
18:00 zartoosh joined #salt
18:00 zircote joined #salt
18:01 zartoosh Hi I am a newbie and need a question, I am doing a file.blockreplace but want the block to the end of file. What do I set the marker_end to?  EOF?
18:08 will joined #salt
18:09 forrest zartoosh, did you try just ""
18:09 Guest84025 joined #salt
18:09 forrest I've never used blockreplace to replace to the end of the file, usually in that case I just use a managed file.
18:09 forrest since it's expecting some sort of specific string, I don't know if the end of the file was ever thought of
18:09 redondos joined #salt
18:09 redondos joined #salt
18:10 zartoosh forset thx
18:10 forrest yea np, can you let me know if "" works? Then I'll update the doc.
18:11 zartoosh forrest,  it failed it matches the first blank line.
18:11 forrest zartoosh, ahh that's a bummer then, can you tell me what you're trying to accomplish? Maybe we can come up with a good solution
18:12 zartoosh forrest, let me  paste bin it one sec.
18:12 forrest zartoosh, ok, I have a quick meeting so I might not respond for a few.
18:13 baniir joined #salt
18:14 Guest84025 joined #salt
18:14 linuxlewis joined #salt
18:15 zartoosh forrest, thanks anyway
18:15 happytux joined #salt
18:17 forrest zartoosh, yea of course, are you going to pastebin that?
18:17 linuxlewis Having trouble upgrading salt-master installed from salt-bootstrap. For whatever reason it seems to be stuck on 2014.1.0rc3. The script appears to be installing the correct version but salt --version returns rc3
18:19 vbabiy joined #salt
18:19 aw110f Hi, I'm on 2014.1.4, when running state in cron, I get this http://pastebin.com/Y0rp9iTp where it's not able to run lspci and dmidecode
18:19 aw110f although lspci and dmidecode are installed
18:20 Guest84025 joined #salt
18:20 cekz aw110f: I am a newbie, but it seems like a permission issue with the tools
18:21 forrest aw110f, while cekz is probably right, that's not usually a big deal
18:21 forrest unless something is failing, it's just a warning
18:21 vbabiy_ joined #salt
18:21 forrest linuxlewis, did the package install when you ran the bootstrap?
18:21 linuxlewis yeah, we can see the package on the server
18:21 linuxlewis 2014.1.5
18:22 aw110f I'm running salt-minion as root as well as when i run the state in cron
18:23 aw110f I'm would run schedule states to run using the native scheduler instead of cron, but I can't get it to run
18:24 forrest linuxlewis, can you see which salt you're referencing path wise?
18:25 cekz aw110f: when you run manually it works, only when used with cron your issue arises. is this statement right ?
18:25 forrest aw110f, yea I've seen that error popping up for a few people in cron or otherwise, but it still isn't really a problem that keeps things from working from what I've seen.
18:25 linuxlewis which salt returns /usr/bin/salt
18:26 forrest can you run /usr/bin/salt --versions-report against it?
18:26 zartoosh forrest,  here is the pastebin if you have any hint greatly appreciated : http://paste.ubuntu.com/7676020/
18:27 aw110f cekz: yes correct, I'm going to try setting a different shell in cron, unless you have a different proposition
18:27 rihannon joined #salt
18:27 forrest zartoosh, ok, so let me first ask, why can you not manage the entire file with salt?
18:27 Katafalkas joined #salt
18:28 linuxlewis heres the output: http://pastebin.com/nyrtgL0w
18:28 forrest aw110f, I don't, I haven't seen a solution at this point, and haven't dug into it deeply because I am not encountering it
18:28 forrest linuxlewis, what do you get with a dpkg -l | grep salt?
18:29 vbabiy_ joined #salt
18:29 linuxlewis dkpg output: http://pastebin.com/rVWtzVp8
18:30 zartoosh forrest, good question, this has started from another developer, I do not have complete context, so that is your recommendation?
18:31 forrest zartoosh, well, to me it seems easier. Unless there is a specific reason why you aren't ok with managing the entire file with salt, that is what I would do.
18:31 Guest11010 joined #salt
18:31 rihannon HI, I upgraded salt on my Ubuntu boxes, and not my redhat family boxes are spewing errors about not being able to iterate over a bool.  Does anyone know how to get around this problem short of downgrading the server?
18:31 forrest rihannon, which releases?
18:31 vbabiy joined #salt
18:31 forrest rihannon, usually that's just a version mismatch, you want to have the same version on all minions/master systems
18:32 rihannon forrest: Yeah, it's a version mis-match for sure.
18:32 cekz aw110f: sounds like a fair attempt. tried simply running /sbin/lspci in cron with nothing modified. and it works fine.
18:32 rihannon forrest: Kind of a bummer that the changes aren't backwards compatible.
18:33 Katafalkas joined #salt
18:34 forrest linuxlewis, yea I'm really not sure then without diving in, I'd suggest to collect as much info as you can, and make a post on the mailing list
18:34 forrest someone might have a better suggestion related to that upgrade path
18:34 forrest rihannon, sometimes they are, it depends on the release. But yes it is a bummer. A lot of it has to do with zmq as the transport layer.
18:34 rihannon forrest: Just for completeness, I've got 2014.1.4 (clients) not talking to 2014.1.5 (server).
18:35 forrest rihannon, gotcha
18:35 rihannon forrest: As best as I can tell, it's because the clients are trying to access "external_nodes" data which was yanked from 2014.1.5
18:35 forrest rihannon, ahh right the deprecation
18:35 forrest I forgot about that
18:36 forrest I think it was external nodes at least
18:36 rihannon It doesn't help that I'm running reclass, so I have to spend forever digging into the issue to figure out if it's related to salt or reclass.  It looks like salt at the moment.
18:37 forrest yea we are running reclass as well
18:37 forrest can't stand it
18:37 forrest honestly I'd really suggest to downgrade, then run against a subset, or test set of systems if you have that environment
18:39 rihannon Well, if grain data could be pushed down from the master (not via a lame hack like coping a file into /etc/salt/minion), and if I didn't have two top.sls files to maintain, I'd consider not using reclass.
18:39 forrest rihannon, yea you won't hear an argument from me
18:39 forrest we use it because we need it
18:39 rihannon I'll try downgrading all my ubuntu hosts (ug!).
18:40 rihannon forrest: Thanks.
18:41 linuxlew_ joined #salt
18:42 linuxle__ joined #salt
18:44 aw110f setting a different shell in cron still shows the warning when running state. I'll keep digging, thanks forrest: cekz:
18:45 vbabiy_ joined #salt
18:45 aw110f forrest: cekz: spoke too soon, it did work
18:47 bhosmer joined #salt
18:48 cekz aw110f: cool
18:48 forrest aw110f, great
18:49 forrest rihannon, yea sorry I don't have a better solution for you
18:51 smcquay joined #salt
18:53 bhosmer joined #salt
18:54 aaditya What is the recommended way to inject pillar data into an orchestration function run via state.orch. saltenv doesn't seem to work
18:56 or1gb1u3 left #salt
19:01 KyleG joined #salt
19:01 KyleG joined #salt
19:03 Guest11010 joined #salt
19:03 matrix3000 in the salt command structure is it possible to provide a parameter to a salt state
19:05 matrix3000 salt "server" state.setintip {interface: eth0.1, ipadd: 192.168.10.20, netmask: 255.255.0.0 }
19:05 matrix3000 something like that
19:06 bhosmer joined #salt
19:06 Guest84057 joined #salt
19:06 bhosmer_ joined #salt
19:08 zircote joined #salt
19:08 aaditya matrix3000, kwargs should be passed to salt cli as KEY=VALUE. Hence, salt "server" state.setintip interface=eth0.1 ETC. should work
19:08 vbabiy joined #salt
19:09 Guest84057 joined #salt
19:09 sandbenderca joined #salt
19:12 matrix3000 aaditya: looks like salt has some built in ability for setting the ip, but the syntax is like eth0: network.managed: etc i take it i should use that instead
19:13 matrix3000 is there a manual anywhere to convert salt state into a salt command
19:13 matrix3000 or using salt modules in a salt command
19:15 vbabiy_ joined #salt
19:15 jalaziz joined #salt
19:17 vbabiy joined #salt
19:19 matrix3000 anyone haha
19:21 aaditya matrix3000, if this is what you're talking about, http://docs.saltstack.com/en/latest/ref/states/all/salt.states.network.html, then that is a state module and should be called via a state.sls call
19:22 Joseph joined #salt
19:22 aaditya kwargs should continue to be passed as KEY=VALUE as needed
19:22 aaditya from the command line
19:22 Joseph is anyone an expert in how to use salt ot set up a network bridge on a minion?
19:22 Joseph I am flunking the test on this
19:25 aaditya Also if you simply want to look up how to use a particular module from command line: salt <TARGET> sys.doc <MODULE> should do it
19:29 vbabiy_ joined #salt
19:30 aaditya Anyone had luck passing kwarg to salt.function for a state.orch call on latest develop version? My arg: setting is being read but not my kwarg:
19:31 kermit joined #salt
19:34 rlarkin I am stumped wrt to saltenv=''  , in one subnet I can have source: salt://path/file?saltenv=ops and the file root becomes ops, but not having that and append saltenv=ops to my salt will always fail.
19:34 ifnull joined #salt
19:34 rlarkin in another subnet the opposite always happens
19:36 rlarkin I can't seem to find a definitive answer in docs, and my experiments confuse ( then we're stupid and we'll die )
19:36 xzarth joined #salt
19:36 rlarkin sorry just rewatched bladerunner
19:39 peters-tx You've seen things
19:40 Guest84057 joined #salt
19:43 Guest84057 joined #salt
19:43 whiteinge minions on fire off a VPC in us_east
19:45 Guest84057 joined #salt
19:46 stevednd whiteinge: when using pydsl, is it similar to jinja in that the entire file is first compiled, and then all of the states are run?
19:47 whiteinge stevednd: yes. renderers only create the data structure, then they pass that off to salt's state compiler, which begins iterating over that data structure and running the state functions
19:47 stevednd whiteinge: I just saw this after writing that message: http://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.pydsl.html#render-time-state-execution
19:48 stevednd it seems to imply that you can run the states mid-render/compilation?
19:49 stevednd if I did that though, I wouldn't be able to use the immediately executed states for subsequent requires, could I?
19:49 whiteinge i *think* what it's talking about there is the same thing you get with jinja in that you can directly call salt functions during the compilation phase, but that's a different phase than the handing-off-to-the-state-compiler phase.
19:51 mgarfias there anyway to add a default route at install time, and before highstate runs?
19:51 whiteinge stevednd: yeah, 98% sure that what they mean. sounds like the same thing as calling {% salt['state.single'](...) %} from jinja
19:52 stevednd I have a stupid chicken/egg problem of sorts
19:52 whiteinge let's hear it :)
19:53 whiteinge mgarfias: what do you mean by route?
19:55 Guest84057 joined #salt
19:55 stevednd I want to copy a git repo checkout to another directory using a format such as <object>_<hash>. I need to know what this directory name should be for subsequent states, but I can't know what is in the git repo until after the state fetches the latest data. Also on initial rollout there would be no way to access the remote git repo as the states to create the user and set the rsa key won't have been run yet
19:56 mgarfias winteinge: route add default gw 192.168.3.1
19:56 Katafalkas joined #salt
19:56 stevednd whiteinge: I had thought about creating a custom module function to pull all that, but the stuff in the final sentence prevents that from being a possibility.
19:57 Guest84057 joined #salt
20:00 whiteinge stevednd: one way to do that might be with multiple sls files and the event system:  state to set the user/key, state to do the initial git clone which fires an event containing the dir name, state to do something with that dir name.  how long do you need to retain that directory name?
20:01 stevednd the only way I can think of to do this is to further separate my state file, and run the setup stuff completely separate to the state file that then fetches/copies the git dir
20:01 whiteinge mgarfias: i would create an sls file that only sets that route, then you can make sure that sls file is run before a highstate in a variety of ways (startup states, orchestrate runner, etc)
20:02 stevednd so pretty much what you said, though I was going to use orchestration and requires
20:02 linuxlewis joined #salt
20:02 Guest84057 joined #salt
20:02 mgarfias whiteinge: problem is, i can't get to the master until that route is created
20:02 stevednd can I pass data into the events system, or create data in event handling and pass that to the next state file I would call?
20:02 mgarfias I suppose I could bake the route into the image.
20:03 aaditya Anyone had luck passing kwarg to salt.function for a state.orch call on latest develop version? My arg: parameter is being read but not my kwarg: parameters. This is incredibly annoying
20:03 whiteinge stevednd: you can pass data into an event, then use the reactor to pass that data along to the next state that is called
20:04 whiteinge mgarfias: how are you bootstrapping your minions?
20:04 mgarfias salt-cloud
20:04 Guest84025 joined #salt
20:06 Guest84025 joined #salt
20:06 whiteinge you can ask salt-cloud to run a custom bootstrap script. i'm not sure if you'd have to replace/customize the whole script or if there are additional hooks there
20:07 pass_by_value joined #salt
20:07 stevednd whiteinge: dealing with these situations is probably my biggest frustration with salt. Though I know it's probably not directly salt's fault. I just didn't want to have my process blown out over so many files. Originally I had hoped to do everything in a single file. That turned out to be a no go, so I added orchestration. Now it's looking like adding event handling for another step
20:08 stevednd it really comes down to the templating, and being nothing you can really do, since it has to render it all first. It would be great to be able to at times go at it programatically. Like pydsl, except actually interact with those states that are run immediately
20:08 whiteinge mgarfias: http://docs.saltstack.com/en/latest/topics/cloud/misc.html#deploy-script-arguments
20:08 jalaziz joined #salt
20:09 mgarfias K.  I might do this for pass 2, for this one I think I'll bake routes into the image
20:10 whiteinge stevednd: it would be useful to be able to pass data returned from one state to a subsequent state. Ryan_Lane was interested in something similar for his aws states
20:11 whiteinge i'm not sure what that will look like, off the top of my head, but i see the utility in it
20:12 pass_by_value joined #salt
20:13 stevednd yeah, I can't imagine how that would work really. some kind of salt global dictionary for a state run or something. Even then you would need to know how to determine that the value for a subsequent state should be read from that dictionary instead of taken literally as is done now.
20:13 jimklo joined #salt
20:14 stevednd whiteinge: do you know if he created a ticket for it?
20:15 shaggy_surfer joined #salt
20:15 whiteinge i think there is, looking....
20:15 whiteinge as luck would have it, salt's state compiler keeps a global dictionary of state returns :)
20:16 stevednd I would like to be able to stick random data into that dictionary if possible
20:17 stevednd like create a custom module that would be run that would set state_dict['some'] = 'thing' state_dict['whatever'] = 'bob'
20:17 bemehow joined #salt
20:20 smcquay joined #salt
20:25 debian112 hello anyone using group management
20:25 debian112 cheese:   group.present:     - gid: 7648     - system: False     - addusers:       - user1
20:25 Guest84025 joined #salt
20:25 debian112 not adding user1 to the cheese group?
20:26 matrix3000 aaditya: so salt 'server' state.sls network.managed eth0.1, eth, enabled=True, ipaddr=192.168.1.23, netmask=255.255.255.0
20:26 thedodd joined #salt
20:27 bemehow_ joined #salt
20:29 linuxlewis joined #salt
20:30 babilen debian112: No, that adds user1 as additional user to that group
20:31 aaditya matrix3000: well no, i meant put that entire 'network.managed' block as regular YAML into an .sls file in your environment. Then call salt server state.sls <your_sls_name>.
20:31 babilen debian112: You are aware of https://github.com/saltstack-formulas/users-formula too, aren't you?
20:32 debian112 babielen: that is what I am trying to do is add an additional user
20:32 debian112 no I did'nt know about that
20:32 matrix3000 joined #salt
20:34 babilen debian112: So, what happens if you try?
20:37 debian112 babilen: nothing: I see it run, and it creates the new group:  salt-call state.show_sls  but when I check the user additional groups the user is not in that group
20:38 babilen debian112: Mind showing the output along with that of "getent passwd user1" and "getent group cheese" on http://paste.debian.net ?
20:38 thedodd joined #salt
20:39 babilen (executed on the minion naturally)
20:42 debian112 babilen: http://paste.debian.net/106078/
20:43 babilen debian112: And the result of the state run?
20:43 babilen s/state/highstate/
20:45 debian112 babilen: http://paste.debian.net/106080/
20:46 Katafalkas joined #salt
20:46 linuxlewis joined #salt
20:46 babilen debian112: Which command is that the output of?
20:47 debian112 babilen: salt-call state.show_sls users.admins saltenv='base_staging'
20:48 babilen debian112: state.show_sls doesn't actually execute the state now, does it?
20:48 babilen SLS rather
20:48 debian112 salt-call state.sls users.admins saltenv='base_staging'
20:49 debian112 babilen: http://paste.debian.net/106082/
20:49 debian112 users.groups has the group in it
20:49 babilen yeah, that's fine I just want to see the run in which you actually execute it
20:51 debian112 salt-call state.sls users.admins saltenv='base_staging'
20:51 debian112 is what I am using for testing
20:51 Katafalkas joined #salt
20:52 babilen debian112: And the output of that is http://paste.debian.net/106082/ ? (I would be very surprised)
20:52 mgw1 joined #salt
20:56 mgw joined #salt
20:57 debian112 babilen: http://paste.debian.net/106080 is the output: of that section, I will need scrub the output for the full
20:58 debian112 http://paste.debian.net/106083/   : babilen
20:58 mgw1 joined #salt
21:00 jonbrefe joined #salt
21:01 babilen I don't immediately see something wrong, sorry.
21:01 mgw joined #salt
21:02 babilen My expectation would have been that http://paste.debian.net/106084/ adds a new system group "cheese" with gid 7648 and adds "user1" to it (in addition to all other members)
21:03 babilen Can't see your actual state, nor state run, but I guess that you've executed it and use a similar state declaration
21:05 JeroenH_ joined #salt
21:05 Chrisje joined #salt
21:09 stevednd whiteinge: any luck finding that issue?
21:12 whiteinge stevednd: sorry, was pulled afk. couldn't find it. i have a branch where i was experimenting with the concept but i don't think we have an issue for it after all
21:13 mgw1 joined #salt
21:14 stevednd is there one central place where salt handles all incoming state argument values?
21:14 stevednd or is it in each individual module
21:14 debian112 babilen: Thanks
21:15 stevednd whiteinge:  if it's done in one central place before handing off to the individual state methods, then I was thinking it could potentially be easy to implement
21:15 stevednd getting data into a central dict should be easy, just expose another dict like __grains__ and such
21:16 whiteinge stevednd: i *think* this is it: https://github.com/saltstack/salt/blob/develop/salt/state.py#L1455
21:17 whiteinge the central dict is here: https://github.com/saltstack/salt/blob/develop/salt/state.py#L1462
21:17 whiteinge (__running__ is probably the one you're looking for)
21:18 stevednd if the values are all process through one central place, then define a specific format to be checked for in a value. name: @@saltdict['someval']@@
21:18 stevednd or something like that
21:19 mgw joined #salt
21:19 stevednd whiteinge: don't know if that would work, would it? running is made immutable before passing along?
21:20 matrix3000 joined #salt
21:22 whiteinge stevednd: yes, it's a read-only var from a state module's perspective. whatever is returned from a state module is placed into the non-read-only version of this var, however. meaning you can see the return from a previous state and previous states add values to it in their regular function return
21:23 matrix3000 joined #salt
21:23 whiteinge that was a tad rambling
21:23 bhosmer joined #salt
21:24 whiteinge rephrased: you wouldn't write to it directly, you'd just return as normal from State1, then State2 would have read-only access to State1's return
21:26 jonbrefe joined #salt
21:28 patarr is there a way to clear salt's cache? I specify in my salt state that a jinja contex variable is "true" and not "True" as it was previously. But every time I highstate, it's always "True"!
21:29 patarr It's driving me insane.
21:29 baniir joined #salt
21:29 jonbrefe1 joined #salt
21:29 whiteinge !modules.saltutil.clear_cache | patarr
21:29 wm-bot4 patarr: http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.saltutil.html#salt.modules.saltutil.clear_cache
21:30 Theo-SLC joined #salt
21:30 patarr whiteinge: it says saltutil.clear_cache is not available
21:30 patarr or do I have to salt call that or something on the minions?
21:30 rihannon forrest: Well, I downgraded everything (hey! you can use salt to remove and reinstall salt!  who knew!), and it's back to working.
21:31 jimklo joined #salt
21:32 whiteinge patarr: dang. looks like it's a new addition. i'll fix the docs
21:32 patarr not exactly sure why salt docs are for dev version...
21:33 whiteinge patarr: in the meantime, shutdown the minion daemno and nuke /var/cache/salt/minion
21:33 patarr whiteinge: thank you!
21:33 whiteinge patarr: we're switching docs over to the current release with helium
21:35 patarr whiteinge: i cleared the minion caches and its the same trouble. It doesn't want to differentiate True from true. Is it safe to clear the master cache? /var/cache/salt/master?
21:36 icebourg joined #salt
21:36 patarr ooor I need to specify "true" instead of value: true in the jinja context
21:37 patarr That did the trick. heh
21:37 forrest rihannon, cool
21:40 mgw1 joined #salt
21:42 matrix3000 joined #salt
21:43 alekibango joined #salt
21:43 whiteinge stevednd: btw, if you want to pass data between state modules at the python-level, grep the states source for __context__
21:44 whiteinge the thing i was talking about was doing that at the sls-level
21:47 shaggy_surfer joined #salt
21:47 miqui joined #salt
21:48 chrisjones joined #salt
21:51 matrix3000 joined #salt
21:51 tkharju joined #salt
21:52 jcsp1 joined #salt
21:54 matrix30001 joined #salt
21:55 bemehow joined #salt
21:56 icebourg joined #salt
21:58 bemehow_ joined #salt
22:02 diegows joined #salt
22:03 DaveQB joined #salt
22:03 kermit joined #salt
22:03 icebourg joined #salt
22:05 baniir joined #salt
22:06 aaditya Anyone had luck passing kwarg to salt.function for a state.orch call on latest develop version? My arg: parameter is being read but not my kwarg: parameters. This is incredibly annoying
22:11 shaggy_surfer joined #salt
22:11 jimklo joined #salt
22:12 CeBe joined #salt
22:12 matrix3000 joined #salt
22:14 aaditya Where on earth do I specify my halite password for eauth? The tutorial here only mentions adding a username to /etc/salt/master under external_auth.  http://docs.saltstack.com/en/latest/topics/tutorials/halite.html
22:14 aaditya How do I know my password?
22:15 Guest84025 joined #salt
22:15 Ryan_Lane joined #salt
22:16 aaditya Scratch that stupid q didn't realize it just used OS users
22:18 nickg why can't you have two include: lines in a init.sls?
22:19 viq nickg: you can include multiple things in one include though
22:19 baniir joined #salt
22:19 jonbrefe joined #salt
22:19 nickg viq yes but i have to include one, perform other items, then include another.
22:20 viq uhm, why? Can't you just fix ordering with proper require statements?
22:20 viq require or require_in
22:20 aaditya nickg: Can you describe your exact use case?
22:20 aaditya Agree with viq should be easily accomplished with require statements
22:21 nickg viq i suppose a require would work, but it seems bass ackwards to have to include things through requires instead of just defining what you want
22:21 Guest84025 joined #salt
22:22 nickg aaditya: i've pinned myself into a corner but a simple one is auser.. i want to create the user, attach it folders, then add packages which will be configured to use those folders.  a require could work in that scenario
22:22 viq Maybe... Though I kinda get that the top level IDs (so here: include) need to be unique
22:23 nickg multiple platforms will need that user, so ive segmented the code to create the user into its own sls
22:23 nickg we have nodes for service A, nodes for service B, nodes for service C.
22:23 nickg so i've extract code that can be utilize for all of the nodes into their own sls files
22:23 nickg then i want to align everything they need into their own init.sls.
22:24 nickg i guess if i moved everything into its own sls and the init.sls just did nothign but include it could also work
22:24 jslatts joined #salt
22:26 nickg can you do this?     my_name:  sls.include: - custom.our_user - custom.logging_directory etc?
22:27 forrest nickg, why aren't you just designing them in such a fashion where init is the basic that everything gets, then other things include that?
22:28 nickg well, some stuff may go in A and B, others may go in B and C, or A and C, or A B C
22:28 yetAnotherZero joined #salt
22:28 forrest ...
22:28 forrest what
22:29 forrest why are you not specifying that in your top file or somewhere?
22:29 nickg i was trying to make a light top file instead of having large amounts of code in there
22:29 jimklo joined #salt
22:30 nickg i come from the mvc world so im used to tons of files with little code in them :)
22:30 forrest https://gist.github.com/gravyboat/0a8e43e158417dd9be4b
22:30 nickg i'll go back to the drawing board and try to make everything more salty
22:31 forrest yea, if you need a starting place, you can watch the talk I did on a similar subject: https://www.youtube.com/watch?v=OCbtD2r7bPo
22:31 forrest for you a map file might be an idea of where to go
22:32 nickg ok i'll watch that first
22:32 forrest I feel like you are overcomplicating the problem :D
22:32 forrest or maybe I don't understand the problem fully from what I read
22:32 d3vz3r0 joined #salt
22:34 nickg before i go, can you do math in salt state files?  I need to tell memcached to use the majority of RAM on the machine for the memcached only servers
22:35 forrest nickg, yea absolutely, take a look at jinja math http://jinja.pocoo.org/docs/templates/#math
22:35 nickg perfect thanks
22:36 forrest nickg, so you can do something like memcached_ram: {{ grains.get['memory'] / 4 }}
22:36 forrest thought the syntax might be a bit off on that
22:36 forrest it's close
22:36 nickg the salt documentation is.. unique.. there's tons of tutorials but it's really difficult to find syntax references
22:37 aaditya Anyone had luck passing kwarg to salt.function for a state.orch call on latest develop version? My arg: parameter is being read but not my kwarg: parameters. This is incredibly annoying
22:38 forrest nickg, yea we're trying to improve that
22:39 mgw joined #salt
22:39 forrest nickg, http://docs.saltstack.com/en/latest/ref/states/vars.html
22:39 forrest some of it is well documented, just hard to find
22:39 tkharju1 joined #salt
22:40 forrest Ryan_Lane, are you around?
22:40 Ryan_Lane yep
22:40 forrest do you remember what happened to that doc that just had a list of all the grains where you didn't have to dive into the source code? Or am I just remembering wrong
22:40 forrest a few google searches of 'grains list saltstack', and 'grains saltstack', and variations on that didn't find it
22:41 forrest I thought there was a big list at some point
22:41 forrest but it's not linked
22:41 Ryan_Lane list of grains?
22:41 Ryan_Lane hm. I don't remember one
22:41 forrest ok
22:41 forrest I'll make an issue about it then
22:43 forrest Ryan_Lane, https://github.com/saltstack/salt/issues/13613
22:43 forrest can you think of anything else you'd want to see on such a page?
22:43 forrest I know how much you love jinja
22:43 forrest so your input would be good
22:48 Guest17812 joined #salt
22:54 Guest17812 joined #salt
22:55 patarr can I do something like /usr/dir: file.directory and just leave it at that? Do I need to put a : at the end of directory and then put nothing beneath it? I basically just want the directory and nothing else specified.
22:55 bhosmer joined #salt
22:58 tkharju1 joined #salt
22:59 Guest17812 joined #salt
23:01 jonbrefe joined #salt
23:11 TheThing joined #salt
23:12 mgw joined #salt
23:18 forrest patarr, yea that works fine
23:18 patarr forrest: does it need that appending : ?
23:18 tkharju joined #salt
23:18 forrest patarr, https://gist.github.com/gravyboat/bc446b18f947dd7deb7a
23:19 patarr forrest: btw where can i submit feature requests? I would love if "archive" had some sort of makedirs option
23:19 forrest patarr, https://github.com/saltstack/salt/issues?state=open, then click the 'new issue' button in the upper right
23:19 patarr forrest: but is there a way to simplify to that to two lines like "/usr/dir: \n file.directory" ?
23:19 forrest if you want to dive into the code to make the change that would be awesome as well
23:19 forrest patarr I believe that would work
23:20 forrest I never use it in that fashion
23:20 forrest as I don't like using IDs as the name of a path/file (in the event it is super long)
23:20 forrest but it hsould
23:20 forrest *should
23:20 jimklo joined #salt
23:20 patarr thank you!
23:20 patarr And I may give implementing makedirs a try
23:20 forrest yea np
23:21 forrest patarr, yea you might even be able to look at file.directory: http://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.directory
23:21 forrest it has a 'makedirs' option
23:21 forrest so maybe you could steal that
23:21 forrest either way I'd file an issue
23:21 patarr yup! I definitely will glance at the existing implementation
23:21 forrest so it's on the radar (unless someone already did :P)
23:21 patarr forrest: where is that? Do you have a JIRA?
23:22 forrest patarr, for what?
23:22 forrest issues?
23:22 patarr yeah. Or is that github issues?
23:22 forrest just the github issues
23:22 forrest a cursory search didn't find anything for me, but then again the github search sucks
23:22 forrest so who knows
23:23 Katafalkas joined #salt
23:24 tkharju joined #salt
23:28 tkharju joined #salt
23:30 tkharju joined #salt
23:30 shaggy_surfer joined #salt
23:30 elfixit joined #salt
23:35 MatthewsFace joined #salt
23:40 jimklo joined #salt
23:42 n8n joined #salt
23:52 nickg forrest: the presentation and documentation all work around a single implementation of all of the states. nothing really adds the complexity of managing multiple types of nodes.  some may require memcached with settings that are different than others, some may not require memcached at all.  would you just handle that in the top file and pillars?
23:53 jonbrefe joined #salt
23:54 bemehow joined #salt
23:54 ldlework pillar's match to grain is like the most amazing CM thing ever
23:55 ldlework I can't understand how anyone uses any other CM
23:58 forrest nickg, yea for sure. I mean to me it makes more sense to break that up via the top and pillars
23:58 forrest instead of trying to do some crazy grain logic which could be broken by modifying some value on the box

| Channels | #salt index | Today | | Search | Google Search | Plain-Text | summary