Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2014-04-03

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

All times shown according to UTC.

Time Nick Message
00:02 eliasp tried to work around it manually for now (cp.get_url https://github.com/facelessuser/Pywin32/raw/master/lib/x64/win32/win32print.pyd 'C:\salt\salt-2014.1.1.win-amd64\win32print.pyd') but the minion says on startup for "import win32print": DLL load failed: The specified module could not be found.
00:14 bemehow joined #salt
00:22 eliasp utahcon: got it now working using a copy from pywin32-218.win-amd64-py2.7.exe … In case I get my printer module working using win32print, I'll create an issue to request inclusion of win32print.pyd in the next build
00:23 TheRealBill_here joined #salt
00:24 Outlander joined #salt
00:25 Outlander anyone using saltstack with aws autoscale groups, if so, how have you done it?
00:26 LBJ_6 joined #salt
00:29 fllr joined #salt
00:29 kickerdog I have ami's that are configured to check-in with the master when they come online, and the master auto-accepts them.
00:32 TyrfingMjolnir joined #salt
00:33 Outlander ok cool
00:33 Outlander so that all appear as the new hosts
00:34 Outlander when they are terminated, how do you clean the salt-key list up?
00:34 Outlander I guess you could do a termination feedback loop with SNS/SQS to have something remove a host from salt when it goes down.
00:34 Outlander or a reaper script to clean up nodes that haven’t checked in for x amount of time
00:34 Outlander or both
00:35 Outlander do you provision them based on grains or hostname?
00:35 gadams999 left #salt
00:38 bemehow joined #salt
00:38 kickerdog hostname usually
00:39 kickerdog basically I use aws to auto-scale, salt-cloud to destroy vm's after i'm done with them by enforcing a cloud.map
00:41 DaveQB joined #salt
00:42 joehoyle joined #salt
00:53 taion809 joined #salt
01:00 bhosmer joined #salt
01:05 bhosmer joined #salt
01:05 sroegner joined #salt
01:07 thayne joined #salt
01:13 ectoskeleton_ joined #salt
01:14 Rycher007 joined #salt
01:14 JonGretar joined #salt
01:15 jalbretsen joined #salt
01:16 meteorfox joined #salt
01:18 Rycher007 Is this the channel for curing meats?
01:20 ckao joined #salt
01:20 Rycher007 joined #salt
01:20 masterkorp How do i delete a minion after machine removal ?
01:20 masterkorp just delete the key
01:20 masterkorp the hostname is out top.sls
01:21 MTecknology masterkorp: salt-key
01:22 MTecknology that's it
01:22 l0x3py joined #salt
01:23 yomilk joined #salt
01:24 arthabaska MTecknology for the sake of keeping salt-key listings clean, is there any downside to just deleting the file from /etc/salt/pki/master/minions/$minionid (or wherever) ?
01:24 xzarth joined #salt
01:24 masterkorp does it get removed automagically ?
01:24 masterkorp also, if i rename a machine fqdn will the key get updated ?
01:25 yomilk_ joined #salt
01:25 MTecknology arthabaska: heh? -d deletes it, use salt-key to manage them
01:26 MTecknology masterkorp: renaming in the latest, it'll keep it's old name (which is the far better option)
01:26 masterkorp so its better to delete and create another one
01:28 ectoskeleton_ pillar question: if I have users/init.sls  is there a way to load users from single files from say users/users/tom.sls users/users/frank.sls from the init.sls vs. a single file?
01:29 arthabaska MTecknology ah, I somehow missed that option and assumed there was only an invalidate option
01:30 bhosmer joined #salt
01:30 MTecknology masterkorp: yup- you'd have hell if it just changed
01:30 masterkorp i see
01:35 dwiden joined #salt
01:35 dwiden is there a way to use cmd.wait/run, but only run the command if it hasn't been run before?
01:36 Rycher007 joined #salt
01:36 Math` joined #salt
01:38 Nazca__ joined #salt
01:39 Gareth dwiden: based on what the command does use unless to check for that case.
01:39 bemehow joined #salt
01:46 [diecast] joined #salt
01:46 dwiden I just want to update an environment variable, but I don't want to keep appending the same prefix to the variable
01:58 bemehow_ joined #salt
02:01 yomilk joined #salt
02:01 Rycher007 joined #salt
02:09 oz_akan_ joined #salt
02:13 MindDrive joined #salt
02:19 possibilities joined #salt
02:19 bemehow__ joined #salt
02:22 dwiden Gareth: do you know if there have been issues with the windows salt minion?
02:30 bemehow joined #salt
02:30 ajw0100 joined #salt
02:36 bemehow_ joined #salt
02:51 Rycher007 joined #salt
02:53 notimpossible joined #salt
02:55 philipsd6 joined #salt
03:01 xl1 joined #salt
03:01 smcquay_ joined #salt
03:06 sroegner joined #salt
03:08 austin987 joined #salt
03:14 JordanRinke joined #salt
03:17 notimpossible joined #salt
03:25 Rycher007 joined #salt
03:34 robinsmidsrod joined #salt
03:35 yomilk joined #salt
03:36 middleman_ joined #salt
03:38 gothix_ joined #salt
03:38 xl1 joined #salt
03:40 Linz joined #salt
03:43 thayne joined #salt
03:46 Math` joined #salt
03:58 smcquay_ joined #salt
04:03 mgw joined #salt
04:06 N-Mi joined #salt
04:10 alunduil joined #salt
04:21 srage joined #salt
04:22 ika2810 joined #salt
04:24 yomilk joined #salt
04:29 Rycher007 joined #salt
04:38 srijan4 joined #salt
04:39 N-Mi joined #salt
04:52 xl1 joined #salt
04:56 schimmy joined #salt
05:01 schimmy joined #salt
05:06 sroegner joined #salt
05:12 meteorfox joined #salt
05:26 xl1 joined #salt
05:34 stephanbuys joined #salt
05:46 fllr joined #salt
05:47 gildegoma joined #salt
05:51 CeBe joined #salt
05:53 justlooks joined #salt
05:53 joehoyle joined #salt
05:53 justlooks why i can not use a.b.c as variable name in jinja?
05:54 justlooks why i can not use a.b.c as variable name in pillar ,jinja say it can not recognize it
05:56 xl1 joined #salt
05:58 marnom justlooks: I don't know, but maybe quote it?
05:59 ChaosPsyke joined #salt
06:01 Outlander joined #salt
06:01 possibilities joined #salt
06:02 justlooks marnom: i think jinja will recognize a as a dict
06:09 sdlarsen joined #salt
06:13 nkuttler justlooks: what is a anyway?
06:13 nkuttler oh wait, yeah, you can't use dots in var names, basic jinja
06:16 justlooks nkuttler:  buy why also can use - in var name ?
06:16 nkuttler you can?
06:17 justlooks can not
06:17 nkuttler justlooks: well jinja is modeled after python, a-b sounds like arithmetic
06:18 ipalreadytaken joined #salt
06:22 eligro91 joined #salt
06:24 jmreicha joined #salt
06:25 sdlarsen I'm installing a repo on an EC2 instance (mongodb repository) and afterwards try to install mongo-10gen and mongo-10gen-server. The repository is added fine, but installation of the packages fail with 'not found (possible matches) mongo-10gen' and the same for the -server. If I re-run highstate they're installed correctly. What am I missing?
06:28 eligro91 hey, question. I'm new for salt states. I build a system like salt-states, which deploys files to minions. now I'm migrating to use salt-states. one thing I'm not sure how to migrate is the hooks. I've pre/post hooks per group of files. for example, nginx. I would like that after deploying the updated files, it'll do nginx -t & kill -HUP `nginx.pid`, how I'm doing that? thanks
06:30 marnom eligro91: define the nginx service
06:30 marnom and have it watch the config file
06:30 marnom - or - have the config file use 'watch_in' on the -service: nginx
06:31 eligro91 nginx:
06:31 eligro91 pkg:
06:31 eligro91 - latest
06:31 marnom sdlarsen: possibly it isn't running apt-get update first time and therefor not finding the package?
06:31 eligro91 service:
06:31 eligro91 - running
06:31 eligro91 - watch:
06:31 eligro91 - file: nginxconf
06:31 marnom eligro91: put it in a gist plz
06:31 eligro91 like this
06:31 eligro91 sorry
06:31 marnom but yeah that seems ok if the nginxconf reference matches a file
06:31 marnom I use it like that as well so that if I deploy a changed config it will reload the daemon
06:32 bhosmer joined #salt
06:32 eligro91 great, but how I'm testing it before reloading nginx
06:32 eligro91 if nginx -t fails then don't deploy
06:32 eligro91 don't reload *
06:32 eligro91 it's possible
06:37 ndrei joined #salt
06:37 Kenzor joined #salt
06:43 sgviking joined #salt
06:43 ipalread_ joined #salt
06:44 smurfy_ joined #salt
06:50 xl1 joined #salt
06:52 anuvrat joined #salt
06:54 fllr joined #salt
06:56 _fllr_ joined #salt
06:58 obimod joined #salt
06:59 obimod hey! so highstate always needs to be run to setup the minion per configuration/state details, right?
07:04 balboah joined #salt
07:06 nkuttler obimod: well, not necessarily, but it's probably what almost everybody does
07:06 mtford joined #salt
07:06 obimod @nkuttler reactor would be the preferred alternative solution?
07:07 sroegner joined #salt
07:07 nkuttler not really done much with reactors yet, i was thinking you can run individual sls files
07:10 lyddonb joined #salt
07:11 Xe joined #salt
07:12 harobed joined #salt
07:14 justlooks hi ,if i write this {% for i in pillar['dfs_ha_namenodes_childnodes'] %}{{i}},{% endfor %} ,it will be " node1, node2, " how can i remove last "," ?
07:14 joehoyle joined #salt
07:15 mtford joined #salt
07:15 nkuttler justlooks: isn't there something like forloop.last in jinja?
07:15 ChaosPsyke Hi guys, I used the bootstrap to install the latest salt-minion from git. But I get the following error during the install.  File "/usr/lib/python2.7/dist-packages/salt/fileclient.py", line 13, in <module>    import requests ImportError: No module named requests
07:16 ChaosPsyke Is this a known issue?
07:17 sdlarsen marnom: it's an amazon linux ami, so it's using yum. What puzzles me is that it actually suggests the very package is says is 'not found'
07:19 carlos joined #salt
07:23 \ask joined #salt
07:25 marnom sdlarsen: Hmm, odd.. I don't know much about Yum sorry, does it use repository signing like apt? Perhaps the signing happens after you're trying to install the package for the first time & therefor it only works 2nd time? Sorry I can't be of more help :\
07:25 scooby2 joined #salt
07:25 Katafalkas joined #salt
07:26 ravibhure joined #salt
07:30 schimmy joined #salt
07:34 schimmy1 joined #salt
07:35 Katafalkas joined #salt
07:38 Katafalkas joined #salt
07:38 mike25ro i am not sure if my comment qualifies ... but i use salt 0.17.1 - i have updated salt-master and 1 minion to the latest version... and i had errors.. like pkg was not found... altough i could install it with yum install package... i was dissapointed and rolled back to 0.17.1
07:39 marnom mike25ro: make sure to check changelog, there is an incompatible change between agent communication with the newest versions, I had to update my master as well
07:39 marnom after that it was all working again
07:39 mike25ro marnom: master and minion were both the same version
07:40 mike25ro marnom: some packages were found.. others not - and manually i could install all of them . Someone told me .. here that there is a known bug which will be fixed, so now... i am waiting for  a future release..
07:47 xl1 joined #salt
07:48 elfixit joined #salt
07:51 marnom mike25ro: ah okay.. sorry don't know about that, thought perhaps you had a version mismatch
07:52 mike25ro i was careful with that :) i know that is not a good idea to have diff versions.
07:52 viod1 joined #salt
07:55 marnom mike25ro: yeah I learned my lesson to use version pinning
07:55 fllr joined #salt
07:55 topochan joined #salt
07:56 ndrei joined #salt
08:00 MrTango joined #salt
08:03 smurfy_ joined #salt
08:16 Katafalk_ joined #salt
08:17 xl1 joined #salt
08:35 babilen What do you personally consider the better approach regarding naming states? Using "foo:\n pkg: .... \n service: .... \n " or "foo-package: pkg: -name: foo \n foo-service: service: - name: foo ..." ?
08:36 babilen I've seen both and, also due to using formulas, ended up with a wild mixture. I don't really like this as it always requires me to look up the particular scheme and would like to normalise on one.
08:37 srage joined #salt
08:39 yomilk joined #salt
08:40 giantlock joined #salt
08:42 CeBe joined #salt
08:42 lynxman joined #salt
08:43 millz0r joined #salt
08:51 webthusiast joined #salt
08:51 xmj moin
08:52 xmj is it possible to use prereq_in *across* states -- for example, to make nginx/init.sls depend on postgres/init.sls ?
08:54 webthusiast Hi all, I'm trying to create a TLS certificate with salt. `tls.create_csr` requires a ca_name parameter, but I don't see how that's necessary for a CSR. Also, looking at the module code, the CA-cert doesn't seem to be used anywhere.
08:54 srage joined #salt
08:54 webthusiast Am I missing anything?
08:55 marnom babilen: I don't have any advice on this, I'm wondering as well. My config is a mixture as wel
08:55 fllr joined #salt
08:55 xmj also - is it possible to have the saltmaster create a dependency hierarchy not only depending on states but on remote machines?
08:55 ndrei joined #salt
08:56 marnom xmj: I believe you're looking for overstates
08:56 xmj like, only execute stuff on nginx.domain.tld after stuff on postgres.domain.tld has been executed?
08:56 marnom xmj: But I haven't used these myself yet, so I could be wrong
08:56 che-arne joined #salt
08:56 babilen marnom: I see the merits of both approaches, but this mixture is, well, simply making it harder to use. Just looking for advice ... What do you use for you own states?
08:57 babilen xmj: Look into "overstate"
08:57 babilen Ah, marnom mentioned that already -- Haven't used it either, but that is what is being mentioned when this question is asked :)
08:57 xmj marnom: looks exactly like what i should be looking at
08:57 marnom babilen: yeah, I agree. Personally I seem to be using nginx: pkg: -installed service: -running etc (so one label for both things)
08:58 marnom but, then again, sometimes I need to push config files for a package as well, which I then do in a seperate '/etc/default/file: file: -managed' statement, which I dislike
08:58 xmj Hooray for the endless wisdom of #salt
08:59 babilen marnom: Yes, that is exactly why I started using the "foo-config: ..." scheme ... In a way I prefer the "nginx: pkg: -installed service: -running " but the need to manage different configuration files caused me to adopt the "foo-package ... foo-service ... foo-config ... foo-default-config ..." scheme
09:00 marnom babilen: Good point
09:00 marnom babilen: I'm only working with Salt for several weeks now so I'm still looking for my 'own standard scheme' :)
09:00 babilen marnom: Same here :)
09:00 marnom will probably have to refactor most of my current salt states anyway to be more uniform/standardized
09:01 babilen ditto :)
09:01 nkuttler i wanted to refactor my states written for 0.10 and there's so much new stuff to learn..
09:08 sroegner joined #salt
09:08 torrancew joined #salt
09:09 ocdmw joined #salt
09:10 shoma_ joined #salt
09:13 dRiN joined #salt
09:16 techdragon joined #salt
09:22 mike25ro left #salt
09:26 babilen Hmm, is there a way to see the "source: " value for a state that I extend? It looks as if it is using the wrong file and I'd like to verify that the reason is that my (double) extend is not working as expected.
09:30 nkuttler babilen: for a template? salt-minion with -l debug afaik
09:31 nkuttler or master actually, not sure, but it's somewhere in the debug output
09:31 Steven_ joined #salt
09:31 Steven_ hi to all
09:31 zz_Cidan joined #salt
09:32 babilen http://paste.debian.net/91378/ is what I am using and it appears to be using "- source: salt://xcache/files/xcache.ini.bdo.jinja" rather than "- source: salt://foo/web/master/files/xcache.ini.jinja"
09:33 babilen Seems as if my "double extend" approach is not working :-/
09:34 bhosmer joined #salt
09:38 bja joined #salt
09:38 Math` joined #salt
09:38 babilen Is this a bug or what am I doing wrong?
09:39 yomilk joined #salt
09:41 joehoyle joined #salt
09:44 ndrei joined #salt
09:45 pkruithof joined #salt
09:47 ggoZ joined #salt
09:51 pkruithof Question: I've set up my master to use an environment for each project I want to provision minions for. But now I'm getting errors like "Detected conflicting IDs, SLS IDs need to be globally unique.", which is because of this multi-environment setup.
09:51 pkruithof But shouldn't only the environment specified in the minion be loaded and thus cause no conflicts?
09:55 fllr joined #salt
09:56 joehoyle joined #salt
09:56 marnom pkruithof: mabye it's in base and the environment? I think it merges base/ and (for example) dev/ to one 'space' in which it needs to be unique
09:57 pkruithof marnom: no it conflicts in two environments, for example: "The conflicting ID is "newrelic" and is found in SLS "casco:newrelic" and SLS "getgeo:newrelic""
09:57 babilen That was my understanding too -- this whole "has to be globally unique, even if in different namespaces" thing is a bit meh
09:58 babilen Can I extend a state only once?
10:00 pkruithof ok so I'm not doing something wrong here? I'll open an issue then
10:02 marnom pkruithof: I have a base environment with several globally defined (and unique) SLS files.
10:02 marnom Then in my dev/ and prod/ environment for example, I have a webserver.sls
10:02 marnom which is slightly different for these environments
10:02 marnom this does not cause a conflict in my setup
10:03 marnom running latest 2014.x.x salt master/minion setup
10:03 Steven_ left #salt
10:06 pkruithof I have software stack which I include in all my projects, it ensures some basic software I require. Each project is given its own environment. This is why you'd see the same SLS ID in two different environments.
10:11 Katafalkas joined #salt
10:12 srage joined #salt
10:12 webthusiast left #salt
10:13 babilen Honestly, I have no idea what is going on .. Shouldn't it work as I expect it to? (that is source to be salt://foo/web/master/files/xcache.ini.jinja and not salt://xcache/files/xcache.ini.bdo.jinja ? )
10:15 babilen The documentation is quite specific about multiple "extends: .." in the same SLS, but I can see nothing that would suggest that what I am doing shouldn't work the way i attempt it to.
10:16 babilen Lets see what happens if I implement xcache/backports.sls without extends (which would be just ugly)
10:23 pkruithof created an issue: https://github.com/saltstack/salt/issues/11743
10:23 faldridge joined #salt
10:28 babilen So, it works if I use an explicit state in xcache/backports.sls -- Why is that necessary? Shouldn't I be able to extend the same state multiple times with the "last" extension for a key in the dictionary being the actual value?
10:29 babilen pkruithof: Great, hope that it can be clarifified/resolved soon
10:31 babilen Well, I guess I'll file an issue too! (yay ... *sob*)
10:36 sdlarsen marnom: The repository is added with gpgcheck: 0 so it should not matter and I have require_in with a pkg entry for bogh mongo-10gen and mongo-10gen-server.
10:37 sdlarsen marnom: s/bogh/both
10:39 marnom sdlarsen: ok sorry then, just trying to bounce some ideas :)
10:40 sdlarsen marnom: and thanks!
10:40 marnom no problem hope you get it resolved!
10:44 sdlarsen I've made an sls trying to install mongo from their (redhat) repository on an EC2 insance. It fails the first time I try (can't find mongo-10-gen and mongo-10gen-server, but suggests the very same packages). My state file is here: http://bpaste.net/show/197102/ - anyone care to take a look?
10:45 sdlarsen If i rerun state.highstate for the minion, it installs fine
10:46 babilen https://github.com/saltstack/salt/issues/11744 (fwiw)
10:50 seb`- joined #salt
10:50 thehaven_ joined #salt
10:51 sirtaj joined #salt
10:55 fllr joined #salt
10:57 ika2810 left #salt
11:02 xt joined #salt
11:05 gadams999 joined #salt
11:09 sroegner joined #salt
11:16 Math` joined #salt
11:23 srage joined #salt
11:24 ndrei joined #salt
11:38 eligro91 left #salt
11:41 diegows joined #salt
11:45 ndrei joined #salt
11:51 fllr joined #salt
11:52 johno joined #salt
11:53 fllr joined #salt
11:53 johno hi there is there a way to pass reset_system_locale=False to cmd.run in a state? I am running out of ideas and - kwargs: { reset_system_locale: False } does not work
11:54 Math` joined #salt
11:55 fllr joined #salt
11:56 N-Mi joined #salt
12:01 gadams999 joined #salt
12:03 bastion1704 joined #salt
12:06 TheSojourner joined #salt
12:06 TheSojourner joined #salt
12:07 ndrei joined #salt
12:09 dwiden joined #salt
12:10 berto- joined #salt
12:10 balltongu joined #salt
12:11 jeddi joined #salt
12:11 echos joined #salt
12:20 ggoZ joined #salt
12:29 mortis anyone know how to use chocolatey.install in an sls-file? it works on the commandline, but not in an sls * brrr windows :x *
12:29 Luke_ joined #salt
12:31 DenizB joined #salt
12:31 che-arne joined #salt
12:33 che-arne joined #salt
12:36 lsc mortis: there's no state module for Chocolatey yet
12:36 mortis lsc: ah right
12:36 mortis that explains a lot hehe
12:36 jeremyBass joined #salt
12:38 lsc you could use the "module" state (with an if-clause to check if the package is already installed)
12:38 lsc http://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html
12:39 mortis so when saying salt chocolatey.install <- thats not a state?
12:40 marty__ joined #salt
12:41 mortis execution-module?
12:41 mortis :x
12:41 bastion1704 joined #salt
12:42 DenizB now that was confusing to a poor salt-n00b
12:42 mortis :D
12:42 bja joined #salt
12:42 thewrinklyninja joined #salt
12:42 wkf joined #salt
12:43 zain_ joined #salt
12:44 lsc yes, execution module
12:45 lsc two different things
12:45 lsc execution modules do something (install a package, for example) and state modules ensure that a certain resource has a certain state (ensure that a package is installed)
12:46 mortis ahaaa
12:46 * mortis is less confused :)
12:49 dwiden I'm running a Linux master/windows minion.  I have two states failing (file.managed and file.recurse) with the same error: "global name '__salt__' is not defined".  These states were working before I upgraded to 2014.1.0/1, is there an open bug for this?
12:50 zooz joined #salt
12:50 Math` joined #salt
12:52 lsc dwiden: yes, actually it's already closed
12:52 lsc will be fixed in 2014.1.2
12:53 dwiden lsc: do you know when 2014.1.2 is slated for release?
12:54 lsc no idea, hopefully soon
12:54 lsc I ended up building my own packages
12:55 toastedpenguin joined #salt
12:55 dwiden lsc: thank you, hopefully soon indeed
12:55 fllr joined #salt
12:55 lsc nice to hear that there are others here who are using Salt on Windows minions
12:55 lsc how many machines?
12:56 sandbender1512 joined #salt
12:56 dwiden lsc: I'm only testing on one VM now (Windows 7).  I know we're gonna spin up some XP boxes as well.  Probably on the order of about 10
12:58 che-arne joined #salt
12:59 lsc 14934306
12:59 lsc oops
13:00 lsc I'm testing as well, if it works, we might roll it out to ~100 machines
13:01 zain_ joined #salt
13:01 lsc but I'm not sure yet
13:03 dwiden nice!  Do you happen to know if any salt devs are working on a function to update environment variables for the salt-minion process?  We wanted our Windows VMs to be clean before running highstate and we need to install python then a bunch of other packages.  But we can't install python and then use pip/easy_install because the minion process doesn't know that the environment variables (PATH) were updated
13:07 lsc I don't think so
13:08 lsc I don't usually add the Python directory to the PATH on production machines, because multiple versions
13:08 favadi joined #salt
13:08 oz_akan_ joined #salt
13:09 lsc AFAIK the pip state isn't even working on Windows, so you'd have to do this manually anyway
13:09 oz_akan_ joined #salt
13:09 ekristen joined #salt
13:10 sroegner joined #salt
13:11 vvlad joined #salt
13:11 favadi joined #salt
13:13 dwiden yeah the pip state isn't working.  I have a pythondependencies.sls that has all of the pip.installed states commented out, replaced with cmd.run "pip install..."  I figured it wouldn't be terrible to force the minions to be preloaded with Python for now
13:13 lsc well, for Salt itself it doesn't matter as it has its own frozen Python installation
13:14 zain_ joined #salt
13:19 jeh joined #salt
13:19 racooper joined #salt
13:20 babilen Is there a way to remove content added previously with file.append ?
13:23 lsc babilen: file.replace?
13:24 babilen lsc: That might work, yes
13:25 higgs001 joined #salt
13:25 lsc if you have to do this routinely, consider using file.blockreplace
13:25 higgs001 joined #salt
13:26 babilen lsc: Well, in the long run I have to properly manage that file and generate it from data in a pillar, but replacing the line with nothing will suffice for now. Ta!
13:26 bastion1704 joined #salt
13:28 mortis can you use match: pillar in the pillar top.sls?
13:29 jaimed joined #salt
13:31 faldridge joined #salt
13:32 timoguin joined #salt
13:32 mpanetta_ joined #salt
13:33 defunctzombie joined #salt
13:34 ipmb joined #salt
13:37 faldridge joined #salt
13:38 ashtonian joined #salt
13:38 babilen lsc: Worked perfectly ... "Everybody stand back! I know regular expressions!"
13:38 jslatts joined #salt
13:40 mpanetta_ joined #salt
13:49 mpanetta_ joined #salt
13:51 JasonSwindle joined #salt
13:52 kermit joined #salt
13:54 ashtonian joined #salt
13:55 fllr joined #salt
13:55 gadams999 joined #salt
13:56 thayne joined #salt
14:00 colinbits joined #salt
14:04 joehoyle joined #salt
14:06 mpanetta_ joined #salt
14:06 fedgoat joined #salt
14:06 sroegner joined #salt
14:09 che-arne joined #salt
14:16 danielbachhuber joined #salt
14:18 thedodd joined #salt
14:24 vvlad joined #salt
14:24 seapasulli joined #salt
14:25 EvaSDK joined #salt
14:25 EvaSDK hi there
14:27 lsc hi EvaSDK
14:29 moos3 is there a way to specify a user when doing salt '*' cmd.run 'my awesome command here' ?
14:30 joehoyle_ joined #salt
14:31 fllr joined #salt
14:31 lsc moos3: http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cmdmod.html#salt.modules.cmdmod.run
14:31 lsc moos3: it's right there in the documentation
14:31 gothix joined #salt
14:31 lsc parameter is called "runas"
14:33 moos3 lsc thanks I didn't scroll down enough thanks
14:34 ashtonian joined #salt
14:39 ashtonian joined #salt
14:42 diegows joined #salt
14:44 repl1cant joined #salt
14:45 gothix Noob question. I dont understand how i can manage users with this? How would i create the init.sls just list my users in that..if i do that they get installed on all my machines i figure i need to break them out in a bunch of little files
14:46 alunduil joined #salt
14:46 gothix the little documentation there is on this is not very clear
14:47 nkuttler gothix: not sure what your question is.. you can define a list of users as pillar for example and loop through that in your sls
14:47 nkuttler but you might want several files to include dotfiles and such
14:48 gothix i want to manage users but to not have them installed on every box only select machines
14:48 nkuttler if you want to have different users per box, yeah, pillars, grains, some logic
14:48 nkuttler gothix: there are several ways to do this really
14:48 gothix okay so i will need to use pillar data
14:48 nkuttler or you decide by grain
14:49 nkuttler depends on where you want the logic/data, but pillar is probably cleaner
14:50 timoguin gothix, https://github.com/saltstack-formulas/users-formula
14:50 timoguin check out the pillar.example in that formula
14:50 gothix what is confiusing me is what  to put in my init.sls
14:50 timoguin that one will work out of the box by just setting up your lists of users in pillar
14:51 gothix i was planning to create just a bunch of user.sls files and calling the identifier
14:51 gothix but it seems i need a init.sls
14:51 timoguin you don't have to have init.sls.
14:52 timoguin users/init.sls is funtionally the same as users.sls
14:52 timoguin similar to python imports
14:52 joehoyle joined #salt
14:52 dave_den joined #salt
14:53 gothix so just reference the user in pillar like tom: etc.and ensure it exists in the users.sls ?
14:54 timoguin well... pillar data is available as variabbles in the SLS files, so there's a lot of ways you can use it
14:54 timoguin the formula i linked will handle setting up groups, ssh keys, sudo users, absent users
14:55 timoguin and all you have to do is define your pillar properly
14:55 gothix ill check it out thanks.
14:57 bhosmer joined #salt
14:57 bja joined #salt
14:58 analogbyte joined #salt
14:59 ndrei joined #salt
15:01 jalbretsen joined #salt
15:05 conan_the_destro joined #salt
15:08 Nazzy joined #salt
15:12 kzx joined #salt
15:13 jeremyfelt joined #salt
15:13 analogbyte joined #salt
15:13 bhosmer joined #salt
15:16 joehoyle joined #salt
15:19 wendall911 joined #salt
15:21 halfss joined #salt
15:27 mgw joined #salt
15:29 alunduil joined #salt
15:30 JasonSwindle joined #salt
15:33 bastion1704 joined #salt
15:34 thayne joined #salt
15:37 spiette joined #salt
15:38 hunter_ joined #salt
15:43 jrdx joined #salt
15:43 abe_music joined #salt
15:44 dwiden Is there any reason that a windows minion would have trouble executing a cmd.wait/run if you change running the minion from debug mode (command line) to running it as a service?
15:45 kaptk2 joined #salt
15:46 ndrei joined #salt
15:46 LBJ_6 joined #salt
15:46 lsc dwiden: yes, a service can't launch interactive applications - what are you trying to run?
15:47 dwiden I'm trying to run an autoit executable
15:47 dwiden (because I have an executable that doesn't allow /s /q, etc)
15:50 joehoyle joined #salt
15:52 schimmy joined #salt
15:53 LBJ_6 joined #salt
15:54 schimmy1 joined #salt
15:55 che-arne joined #salt
15:57 higgs001 joined #salt
16:01 kittsg joined #salt
16:02 mattmtl joined #salt
16:05 Shish Top hit for saltstack on google, "Saltstack - Rated #1 by NetworkWorld <link to puppetlabs.com> [AD]". Stay classy, puppet ~_~
16:08 KyleG joined #salt
16:08 KyleG joined #salt
16:09 kittsg Greetings all.  I'm evaluating SaltStack for my company as both a configuration management and build orchestration tool, and was curious if anybody else used it in that fashion.
16:10 kittsg Specifically, I'm looking at a deploy of a versioned webapp that is triggered on a build
16:10 meteorfox joined #salt
16:10 EvaSDK configuration management yes
16:11 EvaSDK but what do you mean for "build orchestration tool" ?
16:11 kittsg I'm guessing the OverState / Orchestrate tool is where I should be looking
16:11 kittsg Something in the effect of 'maven artifact A version 1.0.0.0' built.  Trigger a deploy that pushes it to a set of hosts, in a given environment, with some minor 'scripting' around it
16:12 kittsg It seems like a state isn't quite the right way to approach that, unless I create a hierarchy with the version / artifact / etc
16:13 kittsg It's entirely possible I'm not expressing myself clearly, and if so I apologize - I've only been able to read through the Salt docs and am trying to work up a quick prototype to compare it against Ansible.
16:13 EvaSDK kittsg: probably you want a salt command being hooked up to the deploy button in jenkins ?
16:13 kittsg Eva - that's close enough for the purposes of this discussion, yes.
16:14 EvaSDK here we copy artifacts to a storage server and update states to pull the adequate release with relevant checksum updated
16:14 EvaSDK applying to state is still manual though and I don't think we will change that for now
16:14 LBJ_6 left #salt
16:16 pentabular joined #salt
16:16 kittsg So your state contains a specific version, and that's what you update as part of the 'deploy button' push
16:16 kittsg By 'applying to state' you mean the salt command to notify the minion to update their state?
16:16 bemehow joined #salt
16:21 mgw joined #salt
16:21 jeremyBass left #salt
16:24 possibilities joined #salt
16:25 alunduil joined #salt
16:26 Linz joined #salt
16:28 sijis whiteinge: hey. checked out the pepper recent changes and its awesome!
16:28 EvaSDK kittsg: yes, but we do not hook up jenkins builds with salt actions
16:30 robawt does anyone have a link for any Salt happenings at Pycon?
16:32 kzx robawt: I think there was supposed to be a sprint
16:32 kzx http://www.saltstack.com/salt-blog/2014/3/25/pycon-2014-saltstack-sprint
16:33 kzx it even has a theme and all, basepi can tell you more probably
16:33 robawt that's awesome, thanks kzx
16:34 basepi robawt: ya, the blog has some details.  Basically, we have an open space friday night, booth in the expo hall Thursday-Saturday, and a sprint on Monday
16:34 kittsg EvaSDK: Thanks for the suggestion
16:34 EvaSDK np
16:35 conan_the_destro joined #salt
16:36 robawt basepi: I'll be sure to say hello
16:36 basepi do it!
16:36 basepi =)
16:36 robawt and also to harass whiteinge again
16:36 robawt because he's nice about it
16:37 basepi unfortunately, whiteinge won't be there.  =\
16:37 joehillen joined #salt
16:38 basepi it's me, techhat, Tom, and one of our sales people
16:39 druonysus joined #salt
16:39 druonysus joined #salt
16:43 joehoyle joined #salt
16:51 masterkorp hello
16:51 masterkorp How do i know which hosts do have a specific plataform ?
16:51 masterkorp can i query the salt-master ?
16:52 masterkorp like i want to list which minions are on ubuntu14.05
16:52 masterkorp like i want to list which minions are on ubuntu14.04
16:54 babilen masterkorp: http://docs.saltstack.com/en/latest/topics/targeting/
16:55 timoguin masterkorp, you can query minions for grains data like this: salt '*' grains.get osrelease
16:55 masterkorp thanks
16:55 timoguin that'll give you "12.04" for ubuntu
16:55 timoguin grains.ls will give you a list of all available grains
16:55 Tekni joined #salt
16:56 babilen masterkorp: You could, for example, use a compound matcher on osrelease and os
16:56 Employee312 joined #salt
16:56 masterkorp now how do i match that data ?
16:57 Ryan_Lane joined #salt
16:57 babilen masterkorp: http://docs.saltstack.com/en/latest/topics/targeting/compound.html is what I was referring to
16:57 Employee312 joined #salt
16:57 hunter_ joined #salt
16:58 bhosmer joined #salt
16:58 masterkorp well doing grep for now
16:59 babilen heh
16:59 timoguin salt -C 'G@os:ubuntu and G@osrelease:12.04' test.ping
16:59 srage joined #salt
17:00 mgw joined #salt
17:00 timoguin but that doesn't help you to query that across all minions
17:03 Rycher007 joined #salt
17:08 smcquay joined #salt
17:13 smcquay joined #salt
17:16 Networkn3rd joined #salt
17:18 smcquay joined #salt
17:19 naiyte joined #salt
17:20 possibilities joined #salt
17:22 viod1 joined #salt
17:23 pentabular1 joined #salt
17:25 [diecast] joined #salt
17:25 smcquay_ joined #salt
17:25 chrisjones joined #salt
17:27 Guest_ joined #salt
17:30 notimpossible joined #salt
17:30 bastion1704 joined #salt
17:32 srage_ joined #salt
17:34 gamedna joined #salt
17:34 nmistry joined #salt
17:35 clark42 left #salt
17:37 Luke_ joined #salt
17:39 Kenzor joined #salt
17:42 schristensen joined #salt
17:43 smcquay joined #salt
17:44 kermit joined #salt
17:47 vxitch hey guys, how can i setup an event that gets triggered every time a certain state runs? i read the docs on the Salt Event System and it doesn't tell me that
17:49 arthabaska joined #salt
17:50 timoguin vxitch, calling event.fire_master at the end of the SLS file is one way
17:52 ipalreadytaken joined #salt
17:52 timoguin you'll need to use module.run to call the event module: http://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html
17:53 ipalread_ joined #salt
17:59 Kenzor joined #salt
18:00 pentabular joined #salt
18:00 joehoyle joined #salt
18:00 moos3 can I do this in a sls file {% if grains['role'] != 'freeswitch' %} ?
18:00 aleszoulek joined #salt
18:02 timoguin moos3, yes, but use 'not equals' instead of !=
18:02 timoguin and use grains.get('role') instead. yours will fail if a role grain isn't set on the minion
18:02 Luke_ joined #salt
18:03 timoguin grains.get won't, and you can pass a second param as a default value if it isn't there
18:03 moos3 ok
18:04 moos3 timoguin so like this grains.get('role') 'not equals' 'freeswitch'
18:04 timoguin well without the single quotes around not equals
18:04 ashtonian joined #salt
18:05 moos3 ok cool thanks a ton, I have been having a good time learning saltstack, still getting use to the sls files
18:07 dRiN joined #salt
18:10 smurfy_ joined #salt
18:11 thedodd joined #salt
18:13 smcquay joined #salt
18:14 Gareth utahcon: http://vagrantbox.msopentech.com/
18:15 TheRealBill_here joined #salt
18:15 smurfy__ joined #salt
18:15 timoguin Gareth, nice! I created my own 2k8 and 2012 base boxes recently.
18:15 timoguin but that saves some time. :)
18:17 Gareth utahcon: sorry. meant to share that with utahdave but he's not in here yet :)
18:17 Gareth timoguin: yeah. looks handy if you need Windows boxes quickly.
18:21 pentabular joined #salt
18:22 arrose joined #salt
18:22 arrose I know this isn't the most common method of using salt, but does anyone have any pointers for deploying salt to OS X minions?
18:23 fllr joined #salt
18:23 timoguin arrose, http://docs.saltstack.com/en/latest/topics/installation/osx.html
18:24 joehoyle_ joined #salt
18:24 timoguin it's in homebrew, and i think the bootstrap script will work on OS X
18:24 bhosmer joined #salt
18:25 arrose timoguin right on, i have been hoping to avoid manually installing homebrew on a few hundred macs
18:27 possibilities joined #salt
18:27 timoguin I'd probably use Fabric for that. :)
18:30 tedski I notice that python-git is missing from the Packages files on the ppa
18:30 tedski is that intentional?
18:30 ajw0100 joined #salt
18:31 Ryan_Lane tedski: https://github.com/saltstack/salt/issues/11080
18:32 tedski Ryan_Lane: awesome... thanks
18:32 tedski nice meeting you at the meetup, btw
18:33 Ryan_Lane you too
18:34 hunter_ joined #salt
18:35 timoguin arrose, i might've lied about the bootstrap script supporting OS X. it's not listed as supported in the docs.
18:35 tedski yeah, so the package is on the ppa, it's just not in the packages file
18:36 tedski (in addition to python-gitdb not being there at all)
18:36 santosh joined #salt
18:36 arrose I'd love to just package it and toss it out over munki
18:37 arrose ls -a
18:37 Guest73001 hi fellows new to salt .. newbie  question can salt provision new esx host on a baremetal server?
18:40 JasonSwindle joined #salt
18:40 pentabular left #salt
18:40 moos3 timoguin one last question in a sls file. I can do grains.get('hostname') == 'mail*' ?
18:42 [diecast] joined #salt
18:43 hunter_ joined #salt
18:43 yomilk joined #salt
18:44 SEJeff_work Question about gitfs
18:45 SEJeff_work Would it be possible to push a topic branch to a gitfs git remote and then test that individual topic branch on a single minion?
18:46 timoguin moos3, nope, not like that. jinja doesn't support filters on conditionals.
18:48 moos3 timoguin ok thanks, so what is the best way to do that
18:48 timoguin SEJeff_work, I assume you could use salt-call and reference specify saltenv as that branch
18:48 timoguin moos3, you may be able to do something with the match module: http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.match.html
18:49 timoguin but i haven't played with it.
18:50 Ryan_Lane is it possible to limit which modules are loaded from a gitfs repo?
18:50 Guest73001 hi fellows new to salt .. newbie  question can salt provision new esx host on a baremetal server?
18:51 Guest73001 hi fellows new to salt .. newbie  question can salt provision new esx host on a baremetal server?
18:51 mpoole joined #salt
18:51 Guest73001 hi fellows new to salt .. newbie  question can salt provision new esx host on a baremetal server?
18:51 viod1 joined #salt
18:51 tedski Ryan_Lane: i don't think gitfs supports submodules at all
18:52 tedski Ryan_Lane: unless that's a new feature
18:52 Ryan_Lane well, I don't mean submodules, I mean salt modules within a repo
18:52 dave_den joined #salt
18:52 tedski oh
18:52 tedski in _modules
18:52 srage joined #salt
18:52 Ryan_Lane so if a gitfs has redis, apache, and nginx, but I only want to allow it to include redis.
18:53 Ryan_Lane I have a use case where I'm letting application developers put modules into their own applications, then having the master include all of the repos
18:53 Ryan_Lane but I don't want conflicts between the repos accidentally
18:53 srage__ joined #salt
18:54 Ryan_Lane I guess I could always include the common repo last so that it always overrides, but I also want to avoid confusion for things that don't exist in common, but may exist in two other repos
18:55 jY is there anyway in jinja to take a list and do a join like .join(',')
19:04 arthabaska jY: http://jinja.pocoo.org/docs/templates/#list-of-builtin-filters haven't tried to join anything myself, but it seems you can
19:11 sroegner jY: that would be a regular python join
19:12 sroegner jY: as in ':'.join(theList)
19:14 bhosmer_ joined #salt
19:15 sroegner jY: oh and the jinja filter works also
19:17 MZAWeb joined #salt
19:20 jmstrupp joined #salt
19:21 jmstrupp if I installed the salt-minion, but the hostname was wrong. How do I regenerate a new key for the server?
19:21 thedodd joined #salt
19:26 kermit joined #salt
19:28 vxitch timoguin: thank you! so how do i write an event listener? in the docs it shows example python code
19:28 vxitch left #salt
19:28 timoguin use the reactor system: http://docs.saltstack.com/en/latest/topics/reactor/
19:28 vxitch joined #salt
19:29 vxitch how do i write an event listener? in the docs it shows example python code
19:29 vxitch do i write a script and have that continually run? im also new to python
19:31 timoguin you define a reactor.sls on your master.
19:31 timoguin that will tell salt to match certain events and execute SLS files in response
19:32 timoguin so you don't actually have to write an event listener
19:32 vxitch oo this looks powerful, thanks
19:32 timoguin if you look in the salt repo you'll see tests/eventlisten.py. you can run that
19:32 Networkn3rd joined #salt
19:32 timoguin and it will just listen and dump the event bus
19:33 johtso joined #salt
19:33 timoguin that's good to use while developing anything that uses events
19:33 Linz joined #salt
19:35 vxitch how should i formulate my module.run to properly pass the data to event.fire? is this good? http://hastebin.com/witaxuxala.sm
19:35 whiteinge sijis: thanks for your authentication-prompt addition!
19:35 whiteinge sorry i've been mostly offline this week
19:35 Ahlee slacker
19:35 vxitch i want to send the equivalent of event.fire_master '{"host": "hostname.tld"}' from the cli
19:36 whiteinge pfft
19:36 vxitch also, where would i include the tag if i wanted one? is it just another kwarg?
19:36 timoguin yea it is.
19:37 vxitch yes to the formatting of the data above and to it being a kwarg?
19:37 arrose joined #salt
19:37 timoguin i'm not sure about the data. you'll just have to run it andn see what it outputs
19:37 timoguin but yea it's another kwarg
19:38 whiteinge data should just be a dictionary: http://hastebin.com/juhevifusi.sm
19:38 bhosmer joined #salt
19:39 bhosmer_ joined #salt
19:39 vxitch timoguin, whiteinge: thanks a lot
19:39 vxitch i understand
19:39 vxitch is there a restriction on tag names?
19:39 possibilities joined #salt
19:39 vxitch can i have this-is-my-tag?
19:40 vxitch all the examples show / used
19:40 diegows joined #salt
19:40 ktenney joined #salt
19:41 vxitch nvm
19:45 hunter_ joined #salt
19:46 whiteinge the tags with dashes are the old format. slashes are the new format
19:47 possibilities joined #salt
19:47 kballou joined #salt
19:48 notimpossible joined #salt
19:48 moos3 i have a question about templating, is it possible to get a list of all the nodes that share the same grains in a template ?
19:49 andrej I'm still trying to understand why my minion targeted from the reactor is erroring out
19:49 andrej reactor.conf  http://pastebin.com/x9WtzUuW
19:49 andrej ufw_splunk.sls  http://pastebin.com/iSzC62rL
19:49 andrej add_minion.sls  http://pastebin.com/PjQUFbxx
19:49 andrej minion error  http://pastebin.com/0ELx522N
19:50 andrej I don't understand why the minion claims that it can't find the execution module - the way I see it I have mimmicked the example on the reactor doco page fairly closely
19:57 sijis whiteinge: oh.. no prob. i appreciate you fixing the param stuff. i'll bug you next week if you aren't busy then. was just looking other way i could help with it
19:58 forrest joined #salt
19:58 timoguin andrej, should it not be cmd.run instead of cmd.cmd.run?
19:58 andrej timoguin : not according to the docu on the reactor
19:59 andrej http://docs.saltstack.com/en/latest/topics/reactor/
19:59 whiteinge sijis: you did great. not having that eauth check is a usability problem. i'm not sure how to approach it though since eauth is pluggable  :-P
20:01 whiteinge andrej: two notes, timoguin's right about the cmd.cmd.run since add_minion.sls is getting called via state.sls. also that ufw_splunk.sls reactor match is going to get called *a lot*
20:03 whiteinge i'm confused on that error message though. it's trying call call a state that isn't defined in your reactor pastebin. have you tried restarting the master to clear out any stale reactor files?
20:03 sijis whiteinge: unless, the api exposes the registered auth types, then we can leverage it. but as you said.. it'd be a guessing game and/or just free-form text
20:04 sijis (hope the user knows their auth type)
20:04 * whiteinge nods
20:04 whiteinge salt's own CLI has that requirement too
20:04 sijis does it validate it
20:05 whiteinge hm. looks like it does :-/
20:05 * whiteinge ponders the security implications of exposing that list via the API
20:05 mgw joined #salt
20:05 whiteinge we'd need the list available before authentication. probably not a good idea
20:06 whiteinge but perhaps the error message from the API could be improved
20:07 andrej whiteinge , I did restart the master
20:08 sijis whiteinge: ya.
20:08 andrej I'll take the first cmd out, restart master and minion process and report back
20:08 sijis whiteinge: quest ion on the outputters. were you talking about importing the stuff in salt/output/* ?
20:09 andrej as for the called a lot: I can't see any way of reducing that off the top of my head
20:09 whiteinge sijis: i'm on the fence about that. suggestions welcome
20:09 hunter_ joined #salt
20:10 sijis whiteinge: well. its double the work. a patch ther.. would have to be brought in here too.
20:10 whiteinge andrej: one way to reduce it is timoguin's suggestion from yesterday and putting a ``module.run`` state in your sls file that calls ``event.fire_master`` with a custom event. then you can put something in the reactor that is splunk-specific
20:10 sijis whiteinge: is there a way to just import salt.outputers (or whatever it would be)? i suspect that includes bringing ALL of salt
20:11 ggoZ joined #salt
20:11 cewood joined #salt
20:11 whiteinge you're guess is correct
20:11 whiteinge *your
20:12 andrej new minion error http://pastebin.com/5Bub0hsZ
20:12 whiteinge it would be nice if pepper ran with no or minimal deps. we can get YAML back from the API. perhaps a lightweight wrapper to syntax-highlight YAML would be sufficient.
20:14 sijis whiteinge: my personal opinion would just be yaml and/or json back and do light wrapper around them both
20:15 sijis right now its json.. which ok. the yaml would give it more of the salt look and feel, which would be cool.
20:15 whiteinge andrej: something funky is going on. add_minion_ufw is not in any .sls file that the reactor is rendering. that ``state.sls spl_ufw.add_minion`` is executed on the splunk minion and not the reactor
20:16 whiteinge sijis: +1 to that
20:19 JasonSwindle left #salt
20:19 andrej heh ... nice assessment whiteinge
20:20 andrej How do I find out what level of funk there is, and, more importantly, how do I stop it and make it do what I want? :)
20:21 andrej Maybe I should try timoguin's suggestion, and fire an event from the minion, but that won't really affect what I'm trying to do on the reactor side of things?
20:22 hunter_ joined #salt
20:23 timoguin I only suggested fire_master because I assumed you were firing from a minion. :)
20:24 andrej Heh ... no worries. I liked whiteinge's comment about the state being called a lot (and it would be, indeed, for ANY old states I evecute)
20:24 whiteinge i'm not sure what (if any) caching the master does for reactor files. perhaps comment out the entire reactor, restart the master, get the event to fire, verify the reactor renders nothing, then uncomment incrementally to get the reactor to render the correct .sls
20:24 alunduil joined #salt
20:24 Rycher007 joined #salt
20:24 whiteinge any time you change the reactor config *or* a .sls file called by the reactor, restart the master
20:25 andrej So firing an event from the state that pushes splunk to the minion seems to be a way more efficient approach
20:25 andrej OK whiteinge
20:25 andrej I'll try that
20:26 whiteinge gl! i'm hopping back offline
20:27 elfixit joined #salt
20:27 hunter_ joined #salt
20:27 ipalreadytaken joined #salt
20:28 bemehow_ joined #salt
20:29 gildegoma joined #salt
20:30 ajw0100 joined #salt
20:32 babilen basepi: Thank you for your comments on #11744 -- I'll look into it first thing tomorrow. It might make sense to clarify this "can't extend multiple times" restriction in the documentation. Why isn't is possible to simply merge all the dictionaries with the last merge replacing earlier ones (standard python update behaviour)
20:33 basepi babilen: the key is conflicting IDs.  After all is said and done, each state is compiled down into a single lowdata dictionary.  And the state IDs must be unique at this point.  So you can't have two states with the same ID but different arguments.
20:34 basepi babilen: but you're right, we should add a note to the extend docs saying that a state can only be extended once per state run
20:36 babilen basepi: Well, I appreciate your comments and will look into "use" tomorrow at work. It's just that I really liked my pattern and would like to still be able to do something along those lines.
20:36 basepi babilen: it's a valid pattern that I think we want to support.  I think we already do via `use`, but keep us posted if that doesn't fit for some reason.
20:36 babilen Forgive me for not being to familiar with salt internals, but I had hoped that it is something like "Oh, we just have to recursively call "update" in the right order here"
20:37 basepi Ya, the fact that we boil everything down to a giant lowstate dictionary has pros and cons.
20:37 * babilen nods
20:39 marty_ joined #salt
20:39 babilen basepi: I had hoped that it would work something along the lines like, say, ConfigParser is able to digest many dictionaries/sources and the last one merged in/update'd would simply override earlier values.
20:41 basepi babilen: Well, we could potentially make it overwrite.  But then the old state with the old configs wouldn't be run at all.
20:41 basepi Only the last state that extended it would be run
20:42 andrej feck
20:42 babilen basepi: Which is, AFAICT, what I wanted to achieve in my example, isn't it? But I guess that it would break other implementations.
20:42 basepi Oh, I thought you wanted to run two different versions of a state?
20:43 andrej three restarts of the salt-master later, and 3 pemrutations of reactor.conf futzing on, I still get the same three lines of error-mesages.
20:43 basepi Extending it twice in the same state run doesn't make sense otherwise, imo?
20:43 andrej :9
20:43 babilen basepi: Not really. In the end I want to have one state that has simply been modified multiple times. The final state is the one with the right "source" (in this case)
20:43 babilen use looks okay though
20:43 basepi ohhhhhhhh
20:44 basepi interesting, let me think about that.
20:44 travisfischer joined #salt
20:44 basepi so you want it to start off in one file, include/extend into another file, then include/extend that one into another file for additional modifications?
20:44 babilen basepi: Think of it as an OO pattern in which I simply override some methods.
20:44 basepi or is it two extends in the same file?
20:46 babilen basepi: Well, I have one base case .. The first is the default. Then I define a second one (slight variation on the first, source repository in my example) ... I hand that over to my users (formula style) and they want to use their own configuration file. In my pattern that would require three extends (the first to set the repository for a newer version and the appropriate configuration file for that version and the second to allow the "user" of ...
20:46 babilen ... that state to set yet another configuration file
20:47 basepi ya, the extend system as it's written still won't support that workflow, but that clears up what you were shooting for in my mind.  let me think about it.
20:48 basepi i was completely misunderstanding what you were trying to accomplish
20:48 babilen oh, okay .. bad bug report then, sorry :(
20:48 basepi not necessarily.  i'm sure there was some of my bias towards certain workflows at work.
20:48 babilen heh
20:49 bja joined #salt
20:50 basepi ya, `use` may not work in this case, purely because you end up with three states that will all execute at the end.
20:50 babilen basepi: It's just that we deploy various versions. They are mostly the same but each version has to be installed from a different repository and comes with a version specific configuration files (or that scheme changed) -- I just don't want to have to repeat everything that is the same but somehow say: version 2.0 is exactly like 1.0 except that you should install it from $REPO and use $CONFIG_2.0
20:50 basepi whereas you want just the final, extended state right?
20:50 babilen yeah
20:50 harobed joined #salt
20:51 babilen And then somebody else uses that formula I just wrote but they want to replace my default config with something specific ... and then we have three extends
20:51 napper joined #salt
20:52 basepi so basically, you're shooting for a default template for the state, with configurable repo for the pkg, and configurable source for the config?
20:52 kzx joined #salt
20:52 babilen Am quite new to salt so this might be completely unidiomatic, but it felt like a valid approach :)
20:52 babilen basepi: yes
20:53 babilen And the documentation didn't mention that I could only extend once .. I just thought about it as subclassing and overriding different methods. :)
20:53 basepi Right, which based on the documentation is a valid assumption imo
20:54 timoguin it's more confused the formulas like the apache one that contains multiple extends in an SLS
20:54 timoguin *more confused by
20:54 babilen Yeah, I filed a bug report about that too :)
20:55 * babilen laughs
20:55 whiteinge timoguin: is that still a thing or did that get fixed?
20:55 babilen It got fixed
20:55 wt joined #salt
20:55 timoguin good. :)
20:56 babilen But the apache formula needs some love still (the hard coded order is just ugly with current salt versions)
20:56 babilen Which reminds me that I really have to finish up my nagios formula so that it can be merged
20:57 marty__ joined #salt
20:58 whiteinge babilen: any reason you're not using jinja to parameterize those states (instead of extend)?
20:58 babilen basepi: While you are here: I changed a lot of the nagios formula which was fairly Arch Linux specific, but had to cut corners to actually use it for $WORK in terms of backwards compatibility. How strong are constrains regarding breaking changes for formulas?
20:59 basepi not very strong.  formulas are mostly community-managed, and are not meant to be the end-all--be-all -- just a jumping off point
20:59 babilen whiteinge: I wanted to be able to just use "- foo-service.2.0" and "- foo-service.3.0" in my top.sls and didn't want to repeat the entire SLS file
20:59 basepi you might make some notes where you thought you corner-cut
20:59 basepi for future people
21:00 hunter_ joined #salt
21:00 basepi babilen, whiteinge: right, but if you were to keep the defaults for those file.managed and pkg.installed states in a jinja template file, and then include that into your foo-service.2.0.sls with some context, that might really simplify the issue.
21:01 basepi (I brought whiteinge in on this, he's a jinja master, and I'm kind of thinking that's where this should be happening -- in jinja)
21:02 basepi maybe even a simple jinja macro
21:02 babilen So essentially something like the map.jinja approach commonly taken in for formulas and just reference different keys in the dict then finally override that with values in a pillar?
21:02 whiteinge yeah, exactly. you wouldn't have to use pillar for that if you didn't want to
21:03 whiteinge just any place you want to pull in a dictionary of defaults or a dictionary of overrides
21:03 basepi that way you can manage defaults easily, and define the overrides you need
21:03 godog left #salt
21:04 bhosmer joined #salt
21:05 whiteinge jinja macros (as basepi) suggested are also very well-suited to this kind of work
21:06 babilen Okay - I have to confess that my jinja-fu is not that developed, but I will happily look into that. Would you mind outlining the general approach?
21:06 whiteinge they basically mimic the same functionality you're after via ``extend``, with a slightly different syntax :)
21:06 whiteinge i'll paste an example in #11744
21:06 babilen perfect!
21:06 basepi mine is not either.  i'm actually hoping to pow-wow with whiteinge one of these days and maybe get a quick-and-dirty jinja macro tutorial into the docs
21:06 basepi or at least some common examples.
21:06 whiteinge we need one
21:07 babilen yeah, I have the feeling as if I am lacking there (after reading the salt docs) and I guess that it shows in the way that I develop these days
21:07 whiteinge we often discourage macros because it's easy to treat them as functions for logic which is definitely a bad pattern. but for repeating similar-but-different states, they are ideal
21:08 DaveQB joined #salt
21:09 faldridge joined #salt
21:10 nhubbard_ joined #salt
21:10 babilen Well, thank you for this discussion. I'll look into it in the morrow and will reply in the bug report. I think that the use of extend should definitely be clarified though as my misunderstanding might be more prevalent
21:13 viq joined #salt
21:13 viq joined #salt
21:13 joehoyle joined #salt
21:14 Gordonz joined #salt
21:14 whiteinge definitely agree there
21:14 whiteinge thanks for pointing it out
21:15 joehoyle_ joined #salt
21:16 Whissi When running a command through "cmd.run"... which 'terminal' is used on the remote client?
21:16 mpanetta_ Whissi: do a cmd.run 'echo $TERM'
21:16 mpanetta_ That should tell you I believe
21:17 mpanetta_ It may not even be set
21:17 Whissi Mh, it is "linux", but that's not what I am looking for.
21:17 Whissi Let me describe my problem:
21:17 Whissi Running a command directly on a client will work. No error.
21:17 Whissi When running the same command through cmd.run I'll get an error.
21:18 mpanetta_ What's the error look like?
21:18 timoguin every time? got a paste?
21:18 Whissi That's not salt related... but I want to report the error to upstream but I am not sure how to describe the problem :)
21:18 mpanetta_ Well, technically TERM being set to linux is a lie
21:18 Whissi It has something to do with the "shell" salt will spawn...
21:19 timoguin my minions retured 'screen'
21:19 mpanetta_ timoguin: Are your minions running under screen?
21:19 mpanetta_ It is probably inherited
21:19 timoguin nope, they're running as a normal service
21:19 mpanetta_ Unless salt provides terminal control when it is running things TREM should probably be set to none
21:20 mpanetta_ timoguin: Oh that is odd
21:20 basepi babilen, whiteinge:  https://github.com/saltstack/salt/pull/11758
21:20 Whissi Like said, TERM is set to "linux"... but when I set TERM to linux on my shell I cannot reproduce the problem. So this isn't the problem. There's something else causing the problem...
21:21 mpanetta_ Whissi: If you prepend "export TERM=none" to your command that you are passing to cmd.run wat happens?
21:21 mpanetta_ Whissi: the problem may be that it is expecting the terminal to be a linux terminal but it really isn't, it is a pipe.
21:22 mpanetta_ That is just a guess...
21:22 Whissi I am still getting the problem when setting TERM to none when running though salt.
21:22 mpanetta_ damn :(
21:22 mpanetta_ what does your command do?
21:22 mpanetta_ Is it interactive?
21:22 Whissi No.
21:22 ajw0100 joined #salt
21:22 Whissi Do you know Gentoo Linux?
21:23 Whissi I am running "revdep-rebuild -ip"...
21:23 mpanetta_ eh, sorta.  I have played with it once a long time ago :)
21:23 timoguin whoops, i double-quoted my command, so it was just passing the master's term. they're returning 'linux' now
21:23 Whissi But the command doesn't matter
21:23 Whissi the important thing is, that this will consume /lib/gentoo/functions.sh
21:23 Whissi and when running through salt I'll see
21:23 Whissi /lib/gentoo/functions.sh: line 444: [: : integer expression expected
21:23 Whissi So there's a bug within functions.sh ... but to report this bug...
21:24 mpanetta_ Oh that almost sounds like it is expecting a variable to be set that isn't set in the env that salt provides.
21:24 Whissi I need a way to reproduce it without salt... so I need to know how salt cmd.run is calling the process...
21:24 Whissi you understand? :)
21:24 mpanetta_ maybe see what cmd.run 'set' says vs just running set?
21:24 mpanetta_ Yes
21:24 rlarkin joined #salt
21:24 mpanetta_ It looks to me like some variable isn't set somewhere...
21:24 Whissi Let me compare.
21:25 eculver joined #salt
21:25 eculver joined #salt
21:25 pfallenop joined #salt
21:27 Whissi mpanetta_: Found the problem
21:28 Whissi COLUMNS isn't set
21:28 Whissi Thanks for the hint.
21:28 mpanetta_ yw :)
21:31 druonysuse joined #salt
21:31 garthk joined #salt
21:33 napper joined #salt
21:34 garthk Can I set an environment variable to control the configuration directory for salt? I’m on a Mac, and don’t want to sudo it all.
21:36 Rycher007 joined #salt
21:36 garthk https://github.com/saltstack/salt/issues/2399 hmm SALT_CONFIG_DIR perhaps
21:36 arthabaska joined #salt
21:36 joehillen joined #salt
21:36 garthk env SALT_CONFIG_DIR=$HOME/.salt salt-call grains.items # nope failed
21:37 garthk Aaah, hang on: it worked, but not quite enough
21:41 ipalreadytaken joined #salt
21:42 andrej Hmmm - next iteration: I have simlified my add_minion.sls http://pastebin.com/mkyfCNU8
21:42 faldridge joined #salt
21:43 andrej and I don't get an error anymore http://pastebin.com/Ep0AV2Xr
21:43 andrej but the firewall rule doesn't get added
21:43 andrej :/
21:44 * andrej starts looking for a brick wall to bash his head against
21:46 * andrej taps whiteinge on the shoulder "Sorry mate, any ideas ... ?" :}
21:49 whiteinge andrej: what invokes add_minion.sls? the reactor?
21:49 andrej In a round-about way
21:50 andrej whiteinge ... I have an sls that the reactor invokes, and that then runs the state
21:51 andrej the reactor fires http://pastebin.com/iSzC62rL ... which then invokes http://pastebin.com/mkyfCNU8
21:51 bemehow joined #salt
21:51 whiteinge ok. let's separate those things out first
21:52 andrej ok ... what do you need me to do?
21:53 bemehow_ joined #salt
21:53 whiteinge the reactor file you have is equivalent to calling the following from the CLI:
21:53 whiteinge salt splunk state.sls spl_ufw.add_minion pillar='{new_minion: XXX}'
21:53 whiteinge make sure that works first
21:53 whiteinge then add in the reactor after
21:55 whiteinge what is the empty for-loop in http://pastebin.com/mkyfCNU8 ?
21:56 andrej That run from the command line gives the following output on the splunk box
21:56 andrej http://pastebin.com/wZjqhhyS
21:56 andrej I didn't know how else to convert the host name to an IP
21:56 whiteinge oh! that's from the splunk minion?
21:56 andrej ufw doesn't like IPs
21:56 * whiteinge is starting to catch on
21:57 UForgotten Gareth: I'm having trouble declaring two iptables.append states in one block, it conflicts even if I specify a name: - what would the right way be to do this?
21:57 kermit joined #salt
21:57 andrej So the output is the same as from the spl_ufw triggered by the reactor
21:58 andrej neither method seems to add the rule, though :(
21:59 jnials joined #salt
21:59 JasonSwi_ joined #salt
21:59 whiteinge andrej: what is an example value for  {{ grains['main_ip'][0] }}  in that state? what does ufw need?
21:59 * whiteinge doesn't know ufw
22:00 andrej it's the IP 192.168.1.115
22:00 andrej main_ip is a grain that I custom-set using your runner from last week
22:00 whiteinge ok
22:00 whiteinge ah ok
22:01 andrej many of our boxes have several IPs, and main_ip is the one known to the core network, aka the master and the splunk box
22:01 bhosmer joined #salt
22:02 andrej ufw requires an IP rather than a host-name
22:03 andrej the funny thing is that when I run the line from the minions output manually in the command line it works
22:03 andrej Hmmm
22:04 * andrej now wonders whether UFW requires a TTY, and whether salt's way of executing it provides one
22:05 whiteinge sec. working on a pastebin...
22:05 andrej Hmm ... gotta run into a meeting :/ ... back in 1h
22:07 UForgotten is that a limitation of salt, can't call the same state twice in one object?
22:07 whiteinge andrej: (when you're back) try this: http://pastebin.com/eWJQiGBe
22:08 whiteinge UForgotten: yes, each state ID can only contain a single call to the same 'module.funcion' (because it's a dictionary key)
22:09 UForgotten whiteinge: gotcha. well in my case I want two things to happen back to back, but even when in the same state file it doesn't appear to be ordering them properly.
22:09 higgs001 joined #salt
22:09 whiteinge the best way to enforce ordering is with 'require' statements
22:10 UForgotten in this case I need one thing to be last, and the other next to last
22:10 UForgotten order:last works but the other one just happens whenever it feels like it :)
22:12 whiteinge UForgotten: i'm not sure if this will work or not, but try ``order: -2``
22:12 whiteinge (for the second-to-last one)
22:12 Luke joined #salt
22:12 possibilities joined #salt
22:13 whiteinge you use to be able to do ``order: -1`` to achive the same thing as "last" but that was a while back so i'm not sure if that's still a thing
22:16 sroegner_ joined #salt
22:19 yomilk joined #salt
22:20 UForgotten whiteinge: yeah looks like that worked, thanks.
22:22 xunil joined #salt
22:23 smcquay joined #salt
22:27 UtahDave joined #salt
22:27 UtahDave left #salt
22:27 JasonSwindle joined #salt
22:31 wkf joined #salt
22:32 johtso joined #salt
22:35 johtso joined #salt
22:40 possibilities joined #salt
22:40 andrej Hi whiteinge - here's the result your paste gave me http://pastebin.com/jKwvb14P
22:41 rgbkrk joined #salt
22:42 halfss joined #salt
22:43 whiteinge andrej: is the 'main_ip' grain on the new minion yet? and if so, has it sent its mine data up to the master yet?
22:43 xt joined #salt
22:44 andrej whiteinge : yeah, it is in the mine, because my state actually managed to populate it from the mine
22:45 whiteinge i don't follow
22:45 druonysus joined #salt
22:46 andrej In the output from my last attempts the IP of the playpen came out of the mine and showed in the log of the splunk box
22:47 andrej Results of YAML rendering:
22:47 andrej OrderedDict([('/usr/sbin/ufw allow proto tcp from  192.168.1.115 to any port 9997', OrderedDict([('cmd.run', None)]))])
22:47 yomilk_ joined #salt
22:47 andrej that was generated by my weird for loop
22:48 andrej which pulls the IP out of the mine
22:48 mgw joined #salt
22:50 ndrei joined #salt
22:50 andrej is there a difference in the way a cmd.run on the command-line and one from a state execute a command on the minion?
22:51 andrej salt 'splunk' cmd.run 'ufw allow proto tcp from  192.168.1.115 to any port 9997'  adds a rule.
22:51 andrej execution of the same line via state doesn't
22:52 tcotav left #salt
22:53 ajprog_laptop joined #salt
22:53 bhosmer_ joined #salt
22:54 fedgoat how easy is it to override functions in existing built-in modules...anyone have an example?
22:54 fedgoat is it possible to create a subclass and do this as well as extending the parent
22:55 Katafalkas joined #salt
22:56 yomilk joined #salt
22:56 druonysuse joined #salt
22:56 druonysuse joined #salt
22:58 napper joined #salt
23:01 srage joined #salt
23:05 possibilities joined #salt
23:06 __number5__ fedgoat: make your own module, just copy existing one with a different name and change whatever you want
23:07 abe_music joined #salt
23:07 __number5__ subclass tends to break when you upgrade Salt
23:07 faldridge joined #salt
23:07 mattmtl joined #salt
23:10 fedgoat if you give it the same name will it override the built-in?
23:10 Katafalkas joined #salt
23:11 pydanny joined #salt
23:13 seapasulli joined #salt
23:14 rgbkrk joined #salt
23:21 MedicalJaneParis joined #salt
23:21 possibilities joined #salt
23:26 timoguin andrej, here is the difference between using the cmd.run module and the cmd.run state: https://gist.github.com/timoguin/9964865
23:27 timoguin your SLS is erroring on your custom grain for some reason
23:28 hunter_ joined #salt
23:29 cewood joined #salt
23:31 meteorfo_ joined #salt
23:32 tyler-baker left #salt
23:33 gregmacdonald joined #salt
23:34 gregmacdonald Hi Everyone, Is there a way to remotely upgrade windows minions? I tried saltutil.update with a web server but it's not working.
23:35 druonysuse joined #salt
23:40 gregmacdonald left #salt
23:41 bja joined #salt
23:50 vxitch left #salt
23:50 raizyr joined #salt
23:53 ndrei joined #salt
23:53 ipalreadytaken joined #salt
23:54 bhosmer joined #salt
23:59 socket1 left #salt

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