Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2016-12-30

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

All times shown according to UTC.

Time Nick Message
00:00 citaret whytewolf: I will try fpm. Thanks.
00:01 madboxs joined #salt
00:07 jkinning joined #salt
00:11 madboxs joined #salt
00:11 oida joined #salt
00:15 WesleyTech joined #salt
00:18 DoomPatrol joined #salt
00:19 DoomPatrol joined #salt
00:21 madboxs joined #salt
00:23 DoomPatrol joined #salt
00:26 teclator joined #salt
00:31 madboxs joined #salt
00:36 cyborg-one joined #salt
00:37 hwtt joined #salt
00:41 madboxs joined #salt
00:46 teclator_ joined #salt
00:51 madboxs joined #salt
00:52 PatrolDoom joined #salt
00:52 Klas joined #salt
00:59 sh123124213 joined #salt
01:02 madboxs joined #salt
01:02 abednarik joined #salt
01:03 DEger joined #salt
01:07 madboxs joined #salt
01:23 DEger joined #salt
01:31 s_kunk joined #salt
01:33 shoemonkey joined #salt
01:34 abednarik joined #salt
01:43 jeddi joined #salt
02:08 sp0097 joined #salt
02:09 Salander27_ joined #salt
02:37 catpigger joined #salt
02:38 hwtt joined #salt
02:38 oaklndr1 joined #salt
02:41 sebastian-w joined #salt
02:46 jholtom joined #salt
02:48 ilbot3 joined #salt
02:48 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.3.4, 2016.11.1 <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ (please don't multiline paste into channel) <+> See also: #salt-devel, #salt-offtopic <+> Ask with patience as we are volunteers and may not have immediate answers
03:09 seanz joined #salt
03:09 seanz Greetings, all. Would this be a valid compound matcher: 'G@site:mysite and G@env:prod'
03:09 seanz ?
03:10 seanz Coupled with
03:10 seanz - match: compound
03:10 seanz In an sls file?
03:10 seanz whiteinge: Greetings!
03:10 whiteinge seanz: fancy meeting you here!
03:10 whiteinge yes, that is a valid compound match
03:11 seanz whiteinge: I'm glad to see you online. Long time no talk.
03:11 seanz I'm getting an error with that:
03:11 seanz SaltRenderError: Unknown yaml render error; line 9
03:11 seanz - match: compound    <======================
03:11 seanz I'm not quite sure why, though.
03:11 whiteinge sls file or top file?
03:11 whiteinge (can only appear in top files)
03:12 seanz top file.
03:12 seanz Both in pillar and salt.
03:12 seanz Ah, dang. I was missing a semicolon.
03:12 seanz Sigh...
03:13 seanz It was worth it to say hi, anyway.
03:14 whiteinge :D
03:15 oaklndr1 joined #salt
03:16 muuse joined #salt
03:16 seanz whiteinge: We'll have to catch up sometime. I'll ping you the next time I'm on IRC.
03:16 seanz I hope things are going well.
03:19 yetanotherzero joined #salt
03:23 fxhp joined #salt
03:23 whiteinge +1
03:43 DEger joined #salt
03:44 bastiand1 joined #salt
03:55 raspado joined #salt
03:55 raspado hi all
03:55 raspado i have a service I need to install and also ensure its running
03:56 raspado can I do this http://pastebin.com/76s08aJt
03:56 raspado or am I going to clobber the naming?
04:01 whiteinge Salt will complain that you have duplicate IDs in use.
04:01 raspado thanks whiteinge whats the best approach to what im trying to accomplish?
04:01 whiteinge You can put multiple states under the same ID if you want to. Or just give each one a unique ID.
04:02 raspado so basically like this? http://pastebin.com/QWA6HSSx
04:03 DEger joined #salt
04:05 aphor joined #salt
04:06 raspado is there a way to restart a process if a file has changed
04:08 raspado oh i guess simply - watch would do
04:16 DEger joined #salt
04:19 rdas joined #salt
04:26 haam3r joined #salt
04:39 DEger joined #salt
04:41 hwtt joined #salt
04:50 jeddi joined #salt
05:28 bocaneri joined #salt
05:28 aki_ joined #salt
05:30 aki_ hello i want to use saltpad gui with saltstack open source can some direct me to some tutorial or blog where i can find detail steps for it
05:30 aki_ ??
05:38 DEger joined #salt
05:42 hwtt joined #salt
05:43 DEger joined #salt
05:43 aphor @aki_ do you mean like this? https://github.com/Lothiraldan/saltpad/blob/master/docs/README.md
05:45 samodid joined #salt
05:51 DEger_ joined #salt
05:58 DEger joined #salt
06:03 DEger joined #salt
06:04 PatrolDoom joined #salt
06:32 DEger joined #salt
06:36 DEger_ joined #salt
06:54 madboxs joined #salt
07:04 samodid joined #salt
07:27 TylerJWhit joined #salt
07:28 TylerJWhit I need to check if salt minions have a certain package installed, but not to install the package if they don't? From what I understand pkg.installed installs the package if it's absent. Right?
07:35 PatrolDoom TylerJWhit: depends on pkg backend
07:35 PatrolDoom e.g. apt can do that
07:35 PatrolDoom w/ pkg_installed
07:35 PatrolDoom erm info_installed
07:35 PatrolDoom https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.aptpkg.html#module-salt.modules.aptpkg
07:36 TylerJWhit Thanks
07:40 DEger joined #salt
07:41 TylerJWhit Confirmed it worked. PatrolDoom you just saved me a lot of time!
07:42 PatrolDoom indeed np
07:43 JohnnyRun joined #salt
07:44 hwtt joined #salt
07:45 Jimlad_ joined #salt
07:48 ekkelett joined #salt
07:56 flyboy joined #salt
08:03 DEger joined #salt
08:11 madboxs joined #salt
08:38 cyteen joined #salt
08:42 dkrae joined #salt
08:44 hwtt joined #salt
08:49 jeddi joined #salt
09:17 NeoXiD joined #salt
09:33 DEger joined #salt
09:44 samodid joined #salt
09:57 madboxs joined #salt
09:59 sh123124213 joined #salt
10:00 J0hnSteel joined #salt
10:06 teclator_ joined #salt
10:18 mavhq joined #salt
10:28 TomJepp joined #salt
10:39 XmonkModeZ joined #salt
10:39 XmonkModeZ Hi all. Can anyone help me in regards to salt[cmd.run] and a salt check from nrpe?
10:41 XmonkModeZ Put simply, when I perform a grep under a cmd.run from nrpe within a full state.highstate test=True check, 94 of my states are correct, but there's one that errors with:
10:41 XmonkModeZ "This account is currently not available. "
10:42 XmonkModeZ This check is a grep for the /etc/passwd file. Whereas any other time it will strip out the local users, performed from nrpe it will not.
10:42 XmonkModeZ I'm a little flu-ey and probably my brain needs a reboot.
10:43 XmonkModeZ But can't quite think of how this would be a problem.
10:44 flyboy82 check the user under your nrpe check runs
10:45 XmonkModeZ I have set to sudo to launch the script that performs the check.
10:45 flyboy82 it must have /bin/bash as shell
10:46 XmonkModeZ Hmm. I disable root accounts as login.
10:46 hwtt joined #salt
10:47 flyboy82 ok, you're running a cmd.run (as root if you have salt running as root too)
10:47 XmonkModeZ yes.
10:47 XmonkModeZ If i'm logged into the root user, the script and cmd.run works fine.
10:47 XmonkModeZ If I use nrpe to launch the script via a sudo, the cmd.run fails.
10:48 stooj joined #salt
10:48 flyboy82 the script being a salt command on the master?
10:48 XmonkModeZ On the minions, sorry.
10:49 XmonkModeZ akin to "salt-call state.highstate test=True --output=terse | grep changes"
10:50 XmonkModeZ (For the record, i'm trying to write an nrpe check that will poll the minions on occasion, and check for any pending changes)
10:51 XmonkModeZ If there's a better/cleaner method people use, please feel free to tell me to do that way instead :-)
10:51 flyboy82 have you specified by any chance a user as which the cmd.run will be executed?
10:52 XmonkModeZ I have not (that I know of) - should be salt defaults.
10:52 XmonkModeZ (and salt does run as root)
10:54 CeBe joined #salt
10:54 flyboy82 so salt-call is being called via sudo on every minion
10:56 XmonkModeZ Not quite. salt-call is made from a script (that checks the outputs and returns nagios-preferred values). the script is called via sudo from the nrpe check.
10:58 madboxs joined #salt
10:59 flyboy82 so it's: nagios -> nrpe(minion) -> sudo script -> salt-call -> cmd.run -> grep /etc/passwd
11:00 XmonkModeZ Yes.
11:00 XmonkModeZ Pastebin extract likely to help?
11:00 flyboy82 of the state that fails, yes
11:01 XmonkModeZ 1 second please.
11:02 Trauma joined #salt
11:03 XmonkModeZ http://pastebin.com/ep2NTMZb
11:04 sh123124213 try to su - nrpe and run the sudo command
11:04 sh123124213 or whatever nrpe is running with
11:05 XmonkModeZ Yup. The same is returned "This account is currently not available".
11:05 flyboy82 what type of shell does the nrpe user have?
11:06 XmonkModeZ So, salt needs to be able to execute a shell for the cmd.run, and ...
11:06 XmonkModeZ the nologin shell :-)
11:06 flyboy82 oook, so he can't run bash commands :)
11:06 XmonkModeZ Fair point. :-)
11:07 XmonkModeZ I thought salt was magic.
11:07 flyboy82 sudo -s /bin/bash etc. etc.
11:07 XmonkModeZ hmm. I'm not too keen on nrpe having a shell.
11:08 flyboy82 that's why i didn't tell you to usermod
11:08 flyboy82 it will invoke a shell only for this sudo run
11:08 XmonkModeZ oh. hmm. I see what you mean, sorry - "fuzzy head from flu" card played.
11:08 dkrae joined #salt
11:09 flyboy82 also something i saw in your pastebin, i tend to always enclose my commands in cmd.run in single quotes and use double quotes for any nested quoted text where applicable
11:09 flyboy82 bash is very picky about its quotation
11:10 XmonkModeZ I'll take that onboard, thanks.
11:13 DEger joined #salt
11:15 flyboy82 oh, i saw that sudo -s gets the shell from an env var, so you may want to do it like: "SHELL=/bin/bash sudo -s etc. etc."
11:18 XmonkModeZ ahh, Yeah, I was just wrestling with that.
11:19 cyteen joined #salt
11:21 XmonkModeZ still seem to be getting the same account unavailable return. I'll continue to tinker.
11:25 mswart left #salt
11:31 abednarik joined #salt
11:33 DEger joined #salt
11:44 netcho joined #salt
11:46 sh123124213 joined #salt
11:59 madboxs joined #salt
12:08 cDR joined #salt
12:09 cDR hello
12:10 cDR Can anyone tell me how to schedule a salt-run command on the saltmaster? I want to run "salt-run winrepo.genrepo" daily
12:20 haam3r You mean this: https://docs.saltstack.com/en/latest/topics/jobs/#scheduling-jobs
12:21 haam3r and cron is always an option
12:30 netcho joined #salt
12:48 hwtt joined #salt
12:59 lorengordon joined #salt
13:01 madboxs joined #salt
13:02 netcho joined #salt
13:34 fracklen joined #salt
13:39 jeddi joined #salt
13:47 netcho joined #salt
13:48 hwtt joined #salt
13:50 fracklen joined #salt
13:52 catpig joined #salt
13:52 catpigger joined #salt
13:52 nebuchadnezzar joined #salt
13:54 izrail_ hi
13:56 izrail_ i try to get data from my minions using mine.get, however i get empty output
13:56 amontalban joined #salt
13:56 izrail_ i tried i.e., "salt '*' mine.get '*' ssh.host_keys" and "salt '*' mine.get '*' grains.items"
13:57 izrail_ i get empty output from all minions that i have configured
13:57 izrail_ any idea what i am doing wrong?
13:59 izrail_ damn. nevermind, i only configured ssh.user_keys but not ssh.host_keys in mine_functions
14:01 madboxs joined #salt
14:16 netcho joined #salt
14:24 goudale joined #salt
14:24 goudale hi all
14:24 goudale I'm running salt 2016.11.1 under ubuntu 16.04, and it looks like there is a regression the smtp returner is missing
14:25 goudale specifically; the --return=smtp switch wont do anything besides logging `smtp.returner could not be loaded`, and `salt-call sys.returner_doc` wont print anything about smtp
14:25 goudale both command would work on salt 2016.3 under ubuntu 14.04 though
14:26 goudale smtp_returner.py actually exists in the filesystem
14:27 goudale any idea ?
14:27 abednarik joined #salt
14:37 netcho joined #salt
14:41 viq goudale: do you have smtplib installed?
14:42 viq And check https://docs.saltstack.com/en/latest/ref/returners/all/salt.returners.smtp_return.html and your config to see if you have all required fields set.
14:44 goudale indeed
14:44 goudale `--return smtp_return` prints a different DEBUG message; Could not LazyLoad smtp_return.returner: 'smtp_return' __virtual__ returned False: Could not import smtp returner; gnupg is not installed.
14:47 goudale so it looks like smtp.py is actually imported
14:47 goudale I mean smtp_returner.py
14:49 hwtt joined #salt
14:49 nebuchadnezzar joined #salt
14:49 goudale okay so I `apt-get install python-gnupg`
14:50 cyteen joined #salt
14:51 goudale now, with `--return smtp_return` I get a `Could not LazyLoad smtp_return.returner: 'smtp_return.returner' is not available.`
14:51 goudale but with `--return smtp`, I indeed get a mail
14:59 shoemonkey joined #salt
15:02 madboxs joined #salt
15:08 shoemonkey joined #salt
15:10 lorengordon joined #salt
15:12 netcho joined #salt
15:13 edrocks joined #salt
15:14 mpanetta_ joined #salt
15:19 mpanetta_ joined #salt
15:22 netcho joined #salt
15:23 morissette joined #salt
15:23 chadhs joined #salt
15:30 abednarik joined #salt
15:37 DEger joined #salt
15:38 NeoXiD joined #salt
15:43 DEger joined #salt
15:43 pipps joined #salt
15:50 shoemonkey joined #salt
15:51 hwtt joined #salt
15:52 klaas joined #salt
15:55 sarcasticadmin joined #salt
16:00 JohnnyRun joined #salt
16:01 DEger joined #salt
16:02 fracklen joined #salt
16:03 pipps joined #salt
16:04 madboxs joined #salt
16:07 DEger joined #salt
16:11 cyborg-one joined #salt
16:20 JohnnyRun joined #salt
16:24 tharkun joined #salt
16:26 nicksloan joined #salt
16:31 abednarik joined #salt
16:33 wgoulet joined #salt
16:34 wgoulet Hi all, I'm dutifully working through the example salt tutorials using the environment at https://github.com/UtahDave/salt-vagrant-demo and I'm stuck at the example using pillars
16:35 wgoulet Getting an error Rendering SLS 'base:examples' failed: Jinja variable 'salt.pillar object' has no attribute 'editor'
16:35 wgoulet when I try and use the pillar defined in the tutorial in my example.sls state. Anyone else run into this issue?
16:35 DEger joined #salt
16:40 whytewolf wgoulet: base:examples doesn't sounds right. can you post your state and pillar data [since it is tutorial info it shouldn't need cleaning]
16:41 wgoulet sure
16:41 wgoulet root@saltmaster:/srv/salt# cat pillar/default.sls
16:41 wgoulet editor: vim
16:41 wgoulet that's my pillar file
16:41 wgoulet this is my editor.sls file I created
16:41 wgoulet vim installed:
16:41 wgoulet pkg.installed:
16:42 wgoulet - name: {{ pillar['editor'] }}
16:42 wgoulet I run saltutil.refresh_pillar
16:42 felskrone joined #salt
16:42 wgoulet followed by salt 'minion2' state.apply editor
16:42 wgoulet and get the error above
16:44 wgoulet oh sorry, actually I first tested with examples.sls
16:44 wgoulet so my state file is called 'editor.sls'
16:44 wgoulet and the error message is
16:44 wgoulet Rendering SLS 'base:editor' failed: Jinja variable 'salt.pillar object' has no attribute      'editor'
16:45 whytewolf what does pillar.items show you?
16:45 wgoulet salt '*' pillar.items --out=json
16:46 wgoulet "minion2": {}
16:46 wgoulet not copying whole output to screen here
16:47 whytewolf you know you can use gist. it might be easier. anyway looks like minion2 didn't get the pillar.
16:48 wgoulet Didn't know about gist; full output is here https://gist.github.com/anonymous/4cc7907220a90ff60b6f1c471ca1ebb2
16:48 shoemonkey joined #salt
16:48 DEger joined #salt
16:49 whytewolf okay, so you have two minions and niether one has any pillar data. can you add your top.sls to that?
16:49 wgoulet but correct; appears that the pillar didn't get sent, but when I manually look at the pillar directory in /vagrant/saltstack/salt/pillar on minion2 I do see the 'editor.vim' file there
16:49 whytewolf the pillar one
16:50 whytewolf editor.vim?
16:51 wgoulet sure https://gist.github.com/anonymous/3372115ace468cd9d7bfe220f34f72bb
16:51 wgoulet sorry I meant to say that on minon2 I see the editor.sls file there
16:51 wgoulet not editor.vim
16:52 whytewolf yeah editor.sls is there, otherwise it would be compleaining about not having the file. not that it can't render it. just wondering why your pillars are not rendering ...
16:52 whytewolf you pillars look correct. have you changed any configs in the master?
16:53 wgoulet No I've been following the tutorial point by point; I can apply states just fine if I don't use the pillar data
16:56 whytewolf humm i wonder if it is just the wrong directory
16:56 wgoulet the only variation that I can think of is that I'm editing my files directly on the saltmaster server (as opposed to editing them on my local host and relying on the mapping that Vagrant sets up between my local directory and /srv/salt on the saltmaster server). Can't see why that would matter at all...
16:57 whytewolf the default is /srv/pillar not /srv/salt/pillar
16:57 nZac joined #salt
16:57 wgoulet ah actually that would make a difference then wouldn't it :)
16:58 whytewolf yes a very big one
16:58 whytewolf and i see the vagrant file that came with that enviroment set that up correctly did you change that?
16:59 whytewolf or just use a different vagrant file?
16:59 wgoulet I didn't touch the vagrant file at all. The root cause here is that I am editing files on the saltmaster server directly (ssh to the box and using vim there to create my configs)
16:59 wgoulet tutorial assumes you are editing files on your local system
17:00 whytewolf ahh...
17:00 wgoulet and I'm not editing files on my localsystem because my virtualbox host is a Windows system and I hate windows text editors :)
17:01 wgoulet all is good now
17:01 whytewolf when i have to edit text files on windows i normally install vim
17:02 wgoulet right I can do that too. Anyways now my example works fine. Thanks for the help here!
17:03 whytewolf no problem :) have wonderful salting
17:04 wgoulet It's actual pretty joyful experience ;)
17:05 madboxs joined #salt
17:08 seme hi guys... I was hoping someone could point me in the right direction
17:08 whytewolf that way ->
17:08 whytewolf [just kidding]
17:16 whytewolf seme: what is the issue?
17:23 DEger_ joined #salt
17:27 edrocks joined #salt
17:27 yetanotherzero joined #salt
17:28 buu VIM
17:28 buu what are we talking about?
17:29 whytewolf right now? not a thing :P
17:32 daxroc joined #salt
17:36 buu oh
17:36 buu =[
17:36 buu We could talk about tabs
17:36 PatrolDoom joined #salt
17:37 whytewolf tabs suck.. i perfer spaces
17:37 daxroc Can you use an unless on a http.query checking another http.query
17:38 whytewolf daxroc: that would be  ... difficult... unless is sent to the shell and looks for retcode on a shell command
17:40 PatrolDoom whytewolf: spaces ftw
17:40 daxroc What would the best way to guard on a http.query ,  I was hoping for something like unless  - checking the ret code of another request ?
17:40 PatrolDoom daxroc: write a script and call it via salt?
17:41 PatrolDoom i know salt can do a lot however do it within reason
17:41 daxroc Would that not be messy - is there no primitives for guarding ?
17:41 * PatrolDoom doesn't understand "is there no primitives for guarding ?
17:44 mvensky joined #salt
17:44 daxroc I'm working with a restapi, I don't want http.query to run if it has run in the past as it would result in an error, is there anyway to guard against this or negate that a failure with a particular return code is OK ?
17:44 Praematura joined #salt
17:45 PatrolDoom write a script that can touch a file and if that file exists don't run it?
17:46 whytewolf daxroc: you are using states.http.query for your query right?
17:46 * pcn waits for this to escalate until it rerquires kafka and react
17:46 daxroc whytewolf: yes
17:46 PatrolDoom pcn: lol
17:46 daxroc pcn: wait what :D
17:48 whytewolf state.http.query has match and status to determine if the query came back in select states. which i belive changes it to fail if the match is not correct. which you should be able to use with onfail
17:49 daxroc I'm using status to declare  200 OK, Thanks for the tip
17:50 mvensky joined #salt
17:50 whytewolf humm thinking about it salt could really use an onsuccess requisites
17:50 whytewolf or the ability to negate onfail
17:51 daxroc I would need to reverse the logic here - if <exists> onfail <create> ?
17:52 hwtt joined #salt
17:52 whytewolf right, onfail triggers if the state it is watching fails other wise the state won't run
17:52 * daxroc likes yoda logic
17:54 whytewolf humm. guess we could use a requisite for each possable outcome of a state. success, no change, change, fail
17:55 whytewolf guess require matches no change and change so would in fact be success
17:55 whytewolf and we have change and fail
17:56 whytewolf only thing we dn't have is no change
17:57 daxroc What would be the ideal for this ?
17:57 mvensky joined #salt
17:58 whytewolf sorry require might be just what you need since if the state fails [you don't get your 200 code] the other state won't run
17:58 whytewolf it is still early so i could just be speaking in circles in my head out loud
17:59 mvensky joined #salt
18:00 daxroc What do you mean with require: check for the error status on the exists endpoint http.query having the create http.query require it ?
18:01 whytewolf instead of reversing the onfail check. just use require in a normal check
18:01 mvensky joined #salt
18:01 whytewolf the second http.query should require the first one
18:02 daxroc Yeah logic is much better
18:04 whytewolf yes it is. just kind of escapes me this morning.
18:05 yetanotherzero joined #salt
18:06 madboxs joined #salt
18:08 vexati0n joined #salt
18:09 sp0097 joined #salt
18:10 vexati0n I've had a few years' experience with salt as a basic config mgmt/remote exec system. getting into salt-cloud now. What I'm not seeing is, where is the allowance for dynamic instance names, auto-scaling, etc? how do i write one set of configs that can handle creating a bunch of different instances for the same purpose but with different names in different environments?
18:10 daxroc so you need both the require in the second and the onfail in the check_exists
18:12 fracklen joined #salt
18:14 wgoulet Hi all, since whytewolf helped me get going earlier now I can ask a more useful question :)
18:14 sh123124213 joined #salt
18:15 yetanotherzero joined #salt
18:15 wgoulet I want to distribute key material to my minions and I've successfully configured my pillars to share that information with my minions
18:15 daxroc https://www.irccloud.com/pastebin/jLMMVJz6/
18:16 daxroc whytewolf: see above - how do you skip the execution when it doesn't find the 404 on does_not_exist state
18:16 mvensky joined #salt
18:17 wgoulet Next step, I want to execute a function to get data from a REST API that I will use to create the key material that will be shared. What is not clear to me is how to best go about this. There are tons of pillar modules that I can use to fetch the info, but I don't want to execute these commands manually on the server. Ideally, I would have the master execute the pillar command to fetch the data when the minions boot up.
18:18 mvensky joined #salt
18:18 wgoulet Is using events and reactors the right way to approach this? e.g. create a reactor on the salt master that will invoke something like salt.pillar.cmd_json when it gets an event from a minion?
18:18 whytewolf daxroc: you don't need the onfail. require should do exatly what you are lookinf for. the does not exist state should fail if it can't get the match on status 404. and require shouldn't allow create to run if does_not_exist
18:20 whytewolf wgoulet: pillar is not the only way to feed data into a minion. a minion can run queryes directly ... using something like httpd.query [a module] in jinja
18:21 wgoulet right; my reasoning for using pillar is that I want the API requests to come from the salt master itself as opposed to the queries
18:21 abednarik joined #salt
18:21 wgoulet sorry as opposed to the minions themselves
18:21 whytewolf well pillars can be built with jinja also
18:21 daxroc @whytewolf when it returns 200 both states fail
18:22 wgoulet so I can embed functions into the pillars then?
18:22 whytewolf daxroc: correct. since the first state fails the second fails automaticcly
18:23 daxroc Is there away to suppress these as errors as it's desired behavior?
18:23 daxroc *just feels wrong ?
18:23 PatrolDoom daxroc: clearly youve never managed a java app ;)
18:23 * PatrolDoom saw stack traces, devs were like "oh yeah that means its working"
18:24 whytewolf lol PatrolDoom
18:24 whytewolf that always bugged me about java. the amount of showing off of their traces they did
18:24 PatrolDoom yeah, doesn't help debugging at all
18:25 _JZ_ joined #salt
18:26 whytewolf daxroc: and no. no way to quiet fails...sorry
18:26 mvensky joined #salt
18:26 whytewolf wgoulet: you can embed jinja in pillar that can do lots of things [just not access other pillars]
18:27 daxroc uggh back to the drawing board :D
18:27 daxroc Thanks for the help folks. Have a good new year!
18:27 whytewolf daxroc: everyway i can think of to do what you want involoves something somewhere failing on purpase
18:28 wgoulet ok got it. I think I see now how I can basically call any functions I want inside a jinja block to do what I need. I'll keep digging into it.
18:28 wgoulet thanks!
18:28 daxroc It looks like an anti-pattern to me to purposely fail on desired state like that ?
18:28 daxroc *only new to salt
18:29 daxroc Would using the onfail and a blank cmd echo cause the require to run in succession ?
18:30 whytewolf well you didn't use onfail right to begin with. onfail works kind of like the oppisite of require.
18:30 whytewolf instead of it requireing the other state if the other state fails it triggers
18:31 daxroc using curl in an unless is cleaner , but that negates using http.query
18:31 daxroc *in a why bother kind of way
18:31 whytewolf you could use jinja to render the state away if the query is in a state.
18:32 whytewolf useing the http exacution module instead of the state
18:32 daxroc I'll take a look at that
18:32 mvensky joined #salt
18:33 daxroc Thanks again, have a good one!
18:33 whytewolf and on that note i think i need to step out to hunt down some coffee
18:35 Edgan joined #salt
18:37 abednarik joined #salt
18:38 mvensky joined #salt
18:45 mvensky joined #salt
18:48 pjs joined #salt
18:50 jonher joined #salt
18:50 yetanotherzero joined #salt
18:52 whytewolf mmm coffee
18:53 hwtt joined #salt
18:53 jonher left #salt
18:54 emattiza joined #salt
18:55 edrocks joined #salt
18:59 cmarzullo Is there a way within a state file to read a file into a jinja variable?
18:59 cmarzullo file.read isn't in 2016.11.1 but it's in dev branch
18:59 mvensky joined #salt
19:00 PatrolDoom swear there was a way to do something like that
19:00 PatrolDoom i've seen folks use pillars to generate templates
19:00 PatrolDoom e.g. nginx.ng formula does that
19:01 cmarzullo yeah I do that plenty. pillar to file. But in this case I'm generating certificates and I need to put the contents of the cert into a mysql.query state
19:01 PatrolDoom ah
19:02 cmarzullo on dev salt branch there's docs for file.read.
19:02 PatrolDoom when you find a solution, i'd like to see it
19:02 cmarzullo I'll think of something.
19:02 PatrolDoom we're still using 2015 :'(
19:07 madboxs joined #salt
19:13 cboltz joined #salt
19:16 cboltz Hi!
19:16 cboltz I noticed that salt-master appears in process lists (like "ps aux") as
19:16 cboltz /usr/bin/python /usr/bin/salt-master
19:16 cboltz but the ExecStart in salt-master.service is just
19:17 cboltz /usr/bin/salt-master
19:17 cboltz does someone know why the python interpreter appears in the processlist?
19:17 PatrolDoom cause its a python app
19:17 PatrolDoom if it was java you'd see a java process
19:19 cboltz I know it's python
19:19 cboltz but I always thought the interpreter doesn't get included in the processlist
19:19 cboltz (unless you start something with "python foo.py")
19:19 PatrolDoom well in the script it calls the interpreter
19:19 PatrolDoom youre thinking about C binary apps or the link
19:20 PatrolDoom or the like*
19:24 whytewolf cboltz: typically the shabang of a script causes the file application in linux to use the command in the shabang to start the app when you exacute it. this has the effect of putting the /usr/bin/python in because it is how it is being run.
19:24 theblazehen71 joined #salt
19:24 cboltz yeah, I know about the shebang etc
19:25 cboltz I'm "just" surprised to see the interpreter listed in the process list
19:25 whytewolf you shouldn't be
19:25 whytewolf that is normal for anything that file interprets on how to run
19:26 whytewolf bash scripts do it also
19:27 cboltz hmm, then I must have overlooked this in the processlist for years ;-)
19:27 PatrolDoom joined #salt
19:28 whytewolf you most likely have. i know i don't even see it anymore even though it stares me in the fac everyday
20:05 dendazen joined #salt
20:05 dendazen guys i have this error, what could that be?
20:05 dendazen Detected conflicting IDs, SLS IDs need to be globally unique.
20:05 dendazen The conflicting ID is 'syslog_ng' and is found in SLS 'base:services/syslog-ng' and SLS 'base:services.syslog-ng.init'
20:06 whytewolf sounds like you have 2 stanzas that have the same name
20:06 whytewolf wait that is the same file twice
20:07 whytewolf this sounds like you are giving the minion the same file twice
20:07 yetanotherzero joined #salt
20:07 madboxs joined #salt
20:08 coldbrewedbrew joined #salt
20:08 coldbrewedbrew joined #salt
20:09 FreeSpencer joined #salt
20:09 FreeSpencer joined #salt
20:09 coldbrewedbrew_ joined #salt
20:12 dendazen let me check
20:13 whytewolf one time it is call service/syslog-ng the other it is services.syslog-ng.init
20:13 dendazen i have this in top sls for base
20:13 dendazen - services.syslog-ng.init
20:13 dendazen - services.syslog-ng.config
20:13 dendazen and i have two sls under syslog-ng
20:14 dendazen syslog-ng/config.sls and init.sls
20:14 whytewolf does anthing include service/syslog-ng
20:14 dendazen yeah
20:14 dendazen include:
20:14 dendazen - services/syslog-ng
20:14 dendazen in config.sls
20:14 whytewolf that would be why
20:14 dendazen but i need it
20:14 dendazen how can i work around
20:15 dendazen because sometimes i need to appy .sls separately
20:15 dendazen without base or high state
20:15 dendazen with state.sls
20:15 whytewolf then you don't want services.syslog-ng.init in your top file if you have services.syslog-ng.config in your top
20:16 whytewolf also you can just use services/syslog-ng as the name in top
20:16 whytewolf you don't need to include the .init
20:16 dendazen oh thank you
20:16 dendazen thats it
20:17 PatrolDoom state.apply is available too
20:17 PatrolDoom state.sls is older method (i think) but still works none the less
20:17 whytewolf state.apply is just a simple function that calls highstate or state.sls :P
20:17 PatrolDoom OOOO
20:17 * PatrolDoom got learnt
20:18 whytewolf it is the prefered method as it it used for both highstate and single sls, but yeah it is just a simple function
20:19 whytewolf 3 lines iirc
20:22 whytewolf yeap 3 lines ... and about 140 lines of comment for instructions
20:23 whytewolf also dendazen you can pass more then one state to state.sls/state.apply
20:27 dendazen yeah that i know
20:27 dendazen we can't use apply i think
20:27 dendazen our salt agents/server too ancient
20:28 whytewolf too ancient for apply? wow that is old
20:29 whytewolf oh huh, was introduced in 2015.5 thought it was one of the 2014's
20:30 abednarik joined #salt
20:31 PatrolDoom im still on 2015
20:31 * PatrolDoom dies a lil inside
20:32 whytewolf I do love the fact i maintain my own enviroment so get to play with the latest and greatest. or develop if i so choose
20:36 PatrolDoom came into a 2 salt env
20:36 PatrolDoom migrated from one
20:36 PatrolDoom cleaning up the new one
20:36 sp0097 joined #salt
20:36 PatrolDoom now going to look into creating another salt master per dev env
20:37 PatrolDoom cause salt envs dont work as expected from what i've heard/read
20:45 Edgan PatrolDoom: I can't tolerate anything less than latest with patches
20:45 PatrolDoom heh oh how i can't wait to be there
20:45 Edgan PatrolDoom: I make my own debs and rpms
20:45 Edgan PatrolDoom: based on the official ones
20:46 PatrolDoom dang
20:46 * PatrolDoom needs to get on Edgan's level
20:48 Edgan PatrolDoom: What distribution and release are you using?
20:49 PatrolDoom atm we're between migrating from wheezy to jessie, (zomg so much to do)
20:49 Edgan PatrolDoom: Not that familiar with Debian releases. What is the default version of python in jessie?
20:50 dendazen hard for us to upgrade
20:50 * PatrolDoom has to check
20:51 PatrolDoom looks like 2.7 for jessie
20:51 Edgan PatrolDoom: ok, but looks like both have python3
20:51 Edgan PatrolDoom: One of the big changes in 2016 of salt is support for python3
20:51 PatrolDoom oh yeah
20:51 PatrolDoom well that shouldn't hurt us too much, we're a C shop
20:51 Edgan PatrolDoom: Jessie looks roughly equivalent to Ubuntu 16.04 Xenial
20:52 PatrolDoom oh dang, hheh
20:52 Edgan PatrolDoom: I would recommend making your salt masters jessie, if they aren't already
20:52 PatrolDoom yeah i am about to do that asap
20:52 PatrolDoom cause i'm dying on ole one
20:52 PatrolDoom so much i can't do
20:52 Edgan PatrolDoom: Will probably make supporting gitfs easier
20:53 PatrolDoom ^^^^^
20:53 Edgan PatrolDoom: I like using gitfs with salt masters to not have to clone git repositories manually
20:53 PatrolDoom does that work on jessie?
20:53 PatrolDoom last time i tried to use it, man i had hell
20:53 PatrolDoom thats part of the reason im on old implementation
20:53 Edgan PatrolDoom: It is mostly a matter of getting the right python modules installed, and I would expect it to work on jessie easily
20:54 PatrolDoom yeah i end up doing the salt util to sync git manually when i do changes cause im impatient
20:54 PatrolDoom ill def need to give it a go soon
20:54 hwtt joined #salt
20:54 Edgan PatrolDoom: gitfs does 60 second polling
20:54 Edgan PatrolDoom: and I just do sleep 60 ; salt
20:54 PatrolDoom i'm /that/ impatient
20:55 Edgan PatrolDoom: Plus if it really development, use salt-ssh instead, so you don't have to commit changes to test them
20:55 PatrolDoom thats what i've been trying to get us to use
20:55 PatrolDoom other folks think its something totally diff than salt itslef
20:55 PatrolDoom when its just antoher transport
20:55 Edgan PatrolDoom: Another method is a salt-master in vagrant, but doesn't scale very well
20:56 PatrolDoom yeah we wont do that
20:56 PatrolDoom i've mentioned tools like that and that doesnt fly here lol
20:56 Edgan PatrolDoom: It has it's own quriks, but it is like 95% the same
20:56 nZac joined #salt
20:56 PatrolDoom slowly adopting "newer" ways to do things
20:56 Edgan PatrolDoom: If you want to get really good, kitchen-salt
20:56 PatrolDoom oh yeah ty for mentioining htat
20:56 edrocks joined #salt
20:57 PatrolDoom been trying to remember what that was called
20:57 Edgan PatrolDoom: One of the lessons to learn in the "new world", everyone doesn't have to do it the same way. You can do it the better way for yourself, and then let others take notice.
20:57 * PatrolDoom nods
20:58 Edgan PatrolDoom: It is kind of like preaching about religion. People don't want to hear it, but they will often notice and ask questions.
20:58 Edgan PatrolDoom: My father is a DBA, that is likely about to move into Devops. I was just telling him the same thing this morning.
20:58 mpanetta_ joined #salt
21:00 Edgan PatrolDoom: Neither of us likes it, since we both come from an Ops background, but it is the new reality.
21:08 madboxs joined #salt
21:09 fracklen joined #salt
21:11 acmd joined #salt
21:12 Trauma_ joined #salt
21:13 PatrolDoom indeed
21:13 PatrolDoom Edgan: completely agree
21:13 PatrolDoom its been a challenge as now you're expected to be master of none
21:16 acmd could someone help me create a pkg definition file
21:16 Edgan PatrolDoom: Yes!
21:17 PatrolDoom acmd: ask away
21:18 acmd i'm trying to use a network share for the installer param, but unsure how to use it
21:18 acmd for a windows minion
21:18 PatrolDoom ah windows, out of my realm unfortunately
21:19 acmd I get an error "Specified cwd '\\fileserver\Apps\programname' either not absolute or does not exist"
21:20 acmd from the docs, param str installer: The path to the .exe or .msi to use to install the package. This can be a path or a URL. If it is a URL or a salt path (salt://), the package will be cached locally and then executed. If it is a path to a file on disk or a file share, it will be executed directly.
21:21 acmd i could mount the network share on the server, but was hoping the minions could go directly to the file server
21:22 PatrolDoom probably need to add a mount state
21:22 PatrolDoom then have a state to copy file and/or install it
21:25 mpanetta_ joined #salt
21:28 cyborg-one joined #salt
21:43 FreeSpencer joined #salt
21:43 FreeSpencer joined #salt
21:43 coldbrewedbrew joined #salt
21:43 coldbrewedbrew joined #salt
21:43 beowuff joined #salt
21:43 coldbrewedbrew_ joined #salt
21:50 bworth joined #salt
21:58 beowuff left #salt
22:00 fracklen joined #salt
22:00 coldbrewedbrew joined #salt
22:00 coldbrewedbrew joined #salt
22:00 FreeSpencer joined #salt
22:00 FreeSpencer joined #salt
22:01 coldbrewedbrew_ joined #salt
22:01 bworth left #salt
22:04 nicksloan joined #salt
22:08 fracklen joined #salt
22:09 madboxs joined #salt
22:10 acmd i seem to have installed the package successfully once I started the minion in debug mode, running it with my admin acct, so my guess is permissions to the network share
22:26 PatrolDoom joined #salt
22:33 prg3 joined #salt
22:34 prg3_ joined #salt
22:37 mpanetta_ joined #salt
22:56 hwtt joined #salt
23:15 hasues joined #salt
23:36 teclator joined #salt
23:44 DEger joined #salt
23:47 prg3 joined #salt
23:52 DEger joined #salt
23:54 hasues left #salt

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