Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2015-12-17

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

All times shown according to UTC.

Time Nick Message
00:00 whytewolf RandyT: you mean the examples here don't help you https://docs.saltstack.com/en/latest/topics/jobs/schedule.html
00:02 RandyT whytewolf: that should be a good start. not sure what I was whining about... looks different from when I last saw it, perhaps it is just me... thanks
00:03 RandyT pillar the preferred way to set these up?
00:03 whytewolf RandyT: from the master, yeah
00:03 favadi joined #salt
00:03 ekristen joined #salt
00:06 nZac joined #salt
00:10 keimlink_ joined #salt
00:17 kusams joined #salt
00:17 maduro joined #salt
00:19 bhosmer joined #salt
00:39 druonysus joined #salt
00:39 druonysus joined #salt
00:40 ajw0100 joined #salt
00:41 hightekvagabond is there a way to make salt cmd.run not take the stdout?   ie:  salt '*' cmd.run '/home/ubuntu/myscript.sh > mylog.txt'
00:41 hightekvagabond it seems to be getting caught on the STDOUT redirect
00:42 otter768 joined #salt
00:46 intel joined #salt
00:46 flowstat_ joined #salt
00:49 nZac joined #salt
00:51 druonysus joined #salt
00:51 druonysus joined #salt
00:59 colegatron joined #salt
01:13 deus_ex joined #salt
01:14 jdipierro joined #salt
01:23 tcolvin joined #salt
01:25 antonw joined #salt
01:25 OliverMT joined #salt
01:25 frankS2 joined #salt
01:26 munhitsu_ joined #salt
01:26 kusams joined #salt
01:27 gtaylor joined #salt
01:27 huddy joined #salt
01:27 bVector_ joined #salt
01:28 Ryan_Lane joined #salt
01:29 solidsnack joined #salt
01:31 zmalone joined #salt
01:33 abednarik joined #salt
01:33 solidsna_ joined #salt
01:33 chadhs joined #salt
01:43 rem5 joined #salt
01:45 flowstat_ joined #salt
01:55 wenxin joined #salt
01:58 nmadhok joined #salt
02:02 solidsnack joined #salt
02:05 druonysuse joined #salt
02:05 druonysuse joined #salt
02:06 Ashald_ is there is a way to trigger an event on master with salt-run without touching minions?
02:07 subsignal joined #salt
02:07 nmadhok what do you mean by "without touching minions"?
02:07 nmadhok you want to fire an event only on the master's local bus?
02:07 nmadhok do you have a minion running on your master?
02:10 ronrib joined #salt
02:13 hightekvagabond1 joined #salt
02:14 evidence joined #salt
02:24 shaggy_surfer joined #salt
02:25 antpa joined #salt
02:26 DammitJim joined #salt
02:29 brianfeister joined #salt
02:29 hackel joined #salt
02:31 PeterO joined #salt
02:45 otter768 joined #salt
02:45 flowstat_ joined #salt
02:47 evle joined #salt
02:51 overyander joined #salt
02:56 catpiggest joined #salt
02:56 subsignal joined #salt
02:58 ralish joined #salt
02:59 ralish Hi there, was wondering for any guidance as to how to approach states that are dependent upon package versions in a way that ideally avoids static lookup tables (e.g. this distro release has version X, this one version Y, etc...)?
03:00 ralish So say I have a formula that installs a package and configures it, but the configuration depends upon the version, say, because some config directives are only supported where the version is >= x.y
03:00 auzty joined #salt
03:00 ralish Something like a call to the pkg.version module would work, but the problem is, at the time the Jinja template is evaluated, the package may not be installed, and I'm not aware of anything akin to a "delayed template render"
03:01 ralish Curious if anyone has clever solutions to solve such a problem?
03:04 jcockhren ralish: sounds like something that'll have to be written for every package config file right?
03:04 jcockhren ralish: your best bet is to use the jinja renderer for pillar
03:05 jcockhren that way you (or formula maintainers) can do what you're asking
03:05 ralish I don't understand how that solves it? Doesn't that basically entail just putting versioning data in the pillar?
03:05 jcockhren be sure you put, #!yaml|jinja at the top of a pillar file that'll hold the configuration
03:06 jcockhren yes
03:07 jcockhren unless I misunderstood you, you want to be sure to cover installations where configuration maybe package version specific
03:07 jcockhren feel free to tell me to hush if I'm not making sense. ;)
03:08 ralish Yes, that's right, but I ideally want to be able to determine the version of the package that was installed within the salt formula rather than relying on knowing the version number ahead of time based on looking up the distro and/or codename with a grains.filter_by
03:08 jcockhren ah!
03:08 jcockhren well, I've done that
03:08 ralish oh?! How? :>
03:08 jcockhren I store it as a grain
03:09 jcockhren at the end of a state's successful run, I add a grain that lists the packages/apps installed by salt.
03:09 jcockhren b/c
03:10 jcockhren 1. it speeds up the state compilation and running when you can skip unneeded steps.
03:10 jcockhren 2. I want to be able to quickly get the previous installed version of something quickly and use it in states.
03:11 ralish Right, makes sense, but presumably taht then relies on running the formula multiple times to get to the desired configuration state?
03:12 jcockhren well, not exactly.
03:12 ralish My first thought was to use a call to pkg.version to grab the package version and store it in a jinja variable, but at the time the template is rendered, the package may not yet be installed
03:12 jcockhren depends on who wrote the state?
03:12 jcockhren you can always check to see if a grain is defined
03:12 jcockhren if it is defined, get the version
03:12 jcockhren (save it to a var)
03:13 jcockhren if it is not defined, do all the things
03:14 ralish Hmm, I think I'm still not entirely explaining this properly, or am failing to grok what you're saying. Hold on, let me paste some code to a Gist to help illustrate.
03:17 ralish jcockhren: https://gist.github.com/ralish/5c455f31118a7335cae2
03:17 ralish I've trimmed the formula down to just the relevant parts
03:18 ralish So the problem in the above formula, is Postfix may not yet be installed, in which case pkg_version won't be defined/sane, as at the time the template is rendered, the install state won't yet have completed
03:19 ralish And therefore the main.cf file won't render correctly for the version specific directives. But I'm not sure how to write it in such a way that it will successfully complete all states in a single pass in the case where the package of interest isn't initially pre-installed
03:19 ralish Does that make sense?
03:19 quasiben joined #salt
03:20 favadi joined #salt
03:23 moderation joined #salt
03:23 Striki joined #salt
03:24 mikepea joined #salt
03:27 iggy good luck
03:28 iggy if you figure it out, I'll buy you a beer at saltconf
03:28 ralish lol
03:29 iggy salt-formula has the same problem right now (I'm sure other formulas do as well)
03:30 jcockhren ralish: will take a look. brb. walking dog
03:31 ralish np!
03:31 bhosmer joined #salt
03:32 winter__ joined #salt
03:33 winter__ joined #salt
03:35 ralish jcockhren, iggy: So, might have a solution
03:36 kusams joined #salt
03:36 ralish Looks like if the call to pkg.version in a Jinja template is made in the config template instead of the salt state, it's rendered at the time the underlying state that references the configuration file template is executed
03:37 ralish ie. pass the name of the package through to the config template in context and then perform the pkg_version call from within the config template
03:37 ralish Which is "good enough" if you only need to know the version number in the config file, and not as parameters in the salt state(s) themselves
03:45 flowstat_ joined #salt
03:48 upb is salt transactional? seemw like the problem comes down to being able to read the version of package installed or _being installed_ in the same 'transaction'
03:49 upb and seems whatvis read instead version from a 'snapshot' taken at the beginnig of thr transactiobln
03:49 upb if any of that makes sense in salt context
03:52 jaybocc2 joined #salt
04:10 writtenoff joined #salt
04:11 yomilk joined #salt
04:13 malinoff joined #salt
04:17 jcockhren ralish: word.
04:21 brianfeister joined #salt
04:22 iggy yeah, I think there's an issue open about being able to re-render everything, but that kind of amounts to "restart highstate"
04:23 yomilk joined #salt
04:23 ramteid joined #salt
04:30 kusams joined #salt
04:34 kshlm joined #salt
04:44 otter768 joined #salt
04:44 flowstat_ joined #salt
04:45 boredatwork joined #salt
04:45 antpa joined #salt
04:48 antpa joined #salt
04:54 anmol joined #salt
04:55 armguy joined #salt
05:03 Eugene joined #salt
05:04 rem5 joined #salt
05:08 brianfeister joined #salt
05:16 rdas joined #salt
05:17 antpa joined #salt
05:21 moogyver joined #salt
05:34 kshlm joined #salt
05:41 CeBe joined #salt
05:45 flowstat_ joined #salt
05:50 yomilk joined #salt
05:53 yomilk_ joined #salt
06:00 calvinh joined #salt
06:05 hightekvagabond joined #salt
06:10 kshlm joined #salt
06:13 Striki joined #salt
06:13 asoc joined #salt
06:14 LondonAppDev joined #salt
06:14 LondonAppDev__ joined #salt
06:17 CeBe joined #salt
06:30 kshlm joined #salt
06:40 nidr0x joined #salt
06:43 felskrone joined #salt
06:45 otter768 joined #salt
06:46 flowstat_ joined #salt
06:47 nidr0x joined #salt
06:48 nafg_ joined #salt
06:49 cyborg-one joined #salt
06:57 colegatron joined #salt
07:02 antpa I'm having a lot of difficulty running highstate on our a server on our local network.  I continually receive "SaltReqTimeoutError: Message timed out".  1/20 times it will work.  I've added the following to my minion configuration: tcp_keepalive: True tcp_keepalive_idle: 75 tcp_keepalive_cnt: 9 tcp_keepalive_intvl: 75
07:02 jaybocc2 joined #salt
07:05 malinoff joined #salt
07:07 kusams joined #salt
07:16 Eugene joined #salt
07:19 brianfeister joined #salt
07:35 antpa joined #salt
07:37 malinoff joined #salt
07:41 hightekvagabond joined #salt
07:43 KermitTheFragger joined #salt
07:44 flowstat_ joined #salt
07:46 Eugene joined #salt
07:51 zerthimon joined #salt
07:51 jaybocc2 joined #salt
07:52 scc joined #salt
08:04 fredvd joined #salt
08:04 cberndt joined #salt
08:04 jhauser joined #salt
08:04 xnaveira joined #salt
08:14 xnaveira joined #salt
08:15 mattiasr joined #salt
08:23 eseyman joined #salt
08:30 InAnimaTe joined #salt
08:31 DanyC joined #salt
08:32 aqua^c joined #salt
08:44 dgutu joined #salt
08:46 flowstat_ joined #salt
08:46 otter768 joined #salt
08:50 Trauma joined #salt
08:51 stooj joined #salt
08:55 yomilk joined #salt
09:03 GreatSnoopy joined #salt
09:07 s_kunk joined #salt
09:07 s_kunk joined #salt
09:08 nafg joined #salt
09:08 brianfeister joined #salt
09:11 moderation joined #salt
09:11 salt_noob joined #salt
09:12 salt_noob Hi, I think there is a bug in publish module. Which is better: post details here or post on salt-users mailing list?
09:12 salt_noob More specifically - there is no way to get multiple grains using publish module
09:15 cberndt joined #salt
09:16 Striki joined #salt
09:22 pkimber joined #salt
09:23 Xevian joined #salt
09:25 denys joined #salt
09:27 slav0nic joined #salt
09:28 Edgan joined #salt
09:30 slav0nic joined #salt
09:30 brianfeister joined #salt
09:31 Joren_ joined #salt
09:32 N-Mi joined #salt
09:32 N-Mi joined #salt
09:32 keimlink joined #salt
09:35 cberndt joined #salt
09:36 intel joined #salt
09:36 thalleralexander joined #salt
09:36 Striki joined #salt
09:37 mikepea joined #salt
09:44 moderation joined #salt
09:49 DanyC joined #salt
09:50 xnaveira left #salt
09:51 rotbeard joined #salt
09:52 zerthimon salt-common : Depends: python-tornado (>= 4.2.1) ??? is that true ?
10:02 jaybocc2 joined #salt
10:03 zerthimon since when does salt depend on tornado ?
10:04 dkrae joined #salt
10:08 ingslovak joined #salt
10:09 linjan joined #salt
10:10 babilen zerthimon: It is true and it was added around 2015.5. Do you have to know exactly?
10:10 Grokzen joined #salt
10:14 felskrone joined #salt
10:18 jaybocc2 joined #salt
10:18 AlberTUX joined #salt
10:21 kshlm joined #salt
10:21 antpa joined #salt
10:21 giantlock joined #salt
10:25 elsmo joined #salt
10:27 avenda joined #salt
10:29 zer0def joined #salt
10:31 jesterfraud joined #salt
10:33 dgutu joined #salt
10:33 jesterfraud I've posted a question on Reddit, but here's the tl;dr: I want to get a unique value from an API once on each minion, and put that value in a local config file.
10:33 jesterfraud What's the best way to accomplish that?
10:33 jesterfraud If you'd prefer to answer on reddit for future findability: https://www.reddit.com/r/saltstack/comments/3x6yhp/how_do_i_get_store_and_use_an_api_provided_token/
10:33 saltstackbot [REDDIT] How do I get, store and use an API provided token on a minion? (self.saltstack) | 1 points (100.0%) | 0 comments | Posted by aLiamInvader | Created at 2015-12-17 - 08:47:15
10:39 Jimlad joined #salt
10:43 antpa joined #salt
10:44 zerth joined #salt
10:46 amcorreia joined #salt
10:47 otter768 joined #salt
10:47 dthorman joined #salt
10:50 favadi joined #salt
11:10 babilen jesterfraud: You could use a combination of http.query and some method to store that value (e.g. set it as a grain)
11:12 LondonAppDev joined #salt
11:12 LondonAppDev__ joined #salt
11:15 jesterfraud oh cool
11:15 jesterfraud I'll do some reading
11:23 jesterfraud babilen, how would I go about saving a key of the parsed (JSON) result of http.query to a grain?
11:23 jesterfraud would it be a case of writing a sls file using Python, or?
11:25 permalac joined #salt
11:26 babilen jesterfraud: You could write it in Python, yeah. You might even be able to do that in jinja, but it might get tricky with all the parsing and whatnot. A state for writing grains is https://docs.saltstack.com/en/latest/ref/states/all/salt.states.grains.html#salt.states.grains.present
11:35 av_ joined #salt
12:03 stooj joined #salt
12:07 ggoZ joined #salt
12:09 kshlm joined #salt
12:16 evle1 joined #salt
12:17 giantlock joined #salt
12:29 jaybocc2 joined #salt
12:33 aurynn joined #salt
12:34 moderation joined #salt
12:36 mikepea joined #salt
12:38 Striki joined #salt
12:40 jesterfraud babilen, thanks for the advice! Looks like I've solved that piece of the puzzle. :)
12:45 jaybocc2 joined #salt
12:47 otter768 joined #salt
12:53 bhosmer joined #salt
12:56 babilen jesterfraud: Yes! Would it be possible to see your solution?
12:56 babilen (e.g. paste it to http://refheap.com)
12:56 jesterfraud babilen, once I've verified it, sure!
12:57 babilen Yeah, take your time .. it is just that my advice was more akin to "Hmm, if I had to do that I would probably use those two tools.." rather than "Yeah, done that multiple times before. Just X, Y and Z" :)
12:58 colegatron joined #salt
12:58 jesterfraud thus far, I've used Python for the state file that sets the token, which uses a `grains.get('grain') or do_fetchy_stuff`
12:58 jesterfraud that's the brunt of it
12:58 jesterfraud and yeah, under a grains.present
13:04 Striki joined #salt
13:07 antpa joined #salt
13:10 mikepea joined #salt
13:10 shiriru joined #salt
13:11 moderation joined #salt
13:13 mikepea_ joined #salt
13:15 moderation_ joined #salt
13:22 antpa joined #salt
13:22 TyrfingMjolnir joined #salt
13:22 calvinh_ joined #salt
13:26 Xevian joined #salt
13:29 DammitJim joined #salt
13:35 bhosmer_ joined #salt
13:35 zigurat joined #salt
13:36 TyrfingMjolnir joined #salt
13:36 akhter joined #salt
13:39 jesterfraud I'd welcome any suggestions on how to improve it, but here it is: #!py
13:39 jesterfraud # The following statefile uses Python to set a grain ('sample-token') to
13:39 jesterfraud # a value pulled from a HTTP call. The call will not be repeated if the
13:39 jesterfraud # grain is already set.
13:39 jesterfraud from salt.utils.http import query
13:39 jesterfraud import json
13:39 jesterfraud def run():
13:39 jesterfraud if __opts__['test']:
13:39 jesterfraud return {
13:39 jesterfraud 'token': {
13:39 jesterfraud 'test.configurable_test_state': [
13:39 jesterfraud {'name': 'gitlab-runner-token'},
13:39 jesterfraud {'result': True},
13:39 jesterfraud {'changes': not grains.get('gitlab-runner-token')}
13:39 jesterfraud ]
13:39 jesterfraud }
13:39 jesterfraud }
13:39 jesterfraud return {
13:39 jesterfraud 'token': {
13:39 jesterfraud 'grains.present': [
13:39 jesterfraud {'name': 'sample-token'},
13:39 jesterfraud {'value': grains.get('sample-token') or json.loads(
13:39 jesterfraud query('http://jsonplaceholder.typicode.com/posts/1',
13:39 jesterfraud decode_type=False)['body'])['id']}
13:39 jesterfraud ]
13:39 jesterfraud }
13:39 jesterfraud }
13:39 jesterfraud ...
13:39 jesterfraud nope
13:39 jesterfraud I'd welcome any suggestions on how to improve it, but here it is: https://gist.github.com/liamdawson/a13d80f26337b6fe9ab2
13:41 akhter joined #salt
13:45 cyborg-one joined #salt
13:46 Norrland jesterfraud: gist/hastebin such things...
13:47 jesterfraud Norrland, I tried to, but I apparently failed to copy the URL :(
13:49 dendazen joined #salt
13:49 LotR jesterfraud: first suggestion, don't spam the channel like that, but use a nopaste service
13:50 LotR oh, sorry. Norrland beat me to it
13:52 TyrfingMjolnir joined #salt
13:53 jesterfraud Hopefully this is an easy question: when I use a https url in gitfs_remotes, I get an error in the salt-master log saying "failed to resolve address for https: No address associated with hostname"
13:54 jesterfraud I'm guessing this is because it's picking up the colon in the url as delimiting key and value?
13:54 jesterfraud how do I use a https address for the gitfs remote?
13:54 isharma joined #salt
13:57 TooLmaN joined #salt
14:01 subsignal joined #salt
14:02 bhosmer joined #salt
14:03 dyasny joined #salt
14:07 hasues joined #salt
14:10 hasues left #salt
14:11 jdwilly2001 joined #salt
14:12 pkimber joined #salt
14:12 jdwilly2001 i'm having issues building the salt minon for windows... looks like its missing the actual salt libraries in site-packages
14:13 jdwilly2001 im trying to use pkg/windows/BuildSalt.cmd but i also see another github project for the MSI build
14:15 btorch why does file.recurse keep on showing mode changes when it has already made the change on a previous highstate ?
14:15 btorch the mode hasn't changed on the dirs
14:17 tkharju joined #salt
14:17 TooLmaN joined #salt
14:21 Azid joined #salt
14:25 jnielsen55 joined #salt
14:25 jnielsen55 question
14:25 jnielsen55 Does saltstack work with CoreOS?
14:27 XenophonF joined #salt
14:27 martoss joined #salt
14:28 XenophonF has anyone else noticed the bug in the RHEL installation instructions? the gpgkey url in the sample repo file for RHEL 6/7 has a typo
14:28 Viz joined #salt
14:28 jdwilly2001 i think i'm fixing my own issues, again... i need to run setup.py bdist first to create a dist for the msi to package
14:42 dendazen_ joined #salt
14:43 winsalt joined #salt
14:46 teryx510 joined #salt
14:46 marsdominion joined #salt
14:46 marsdominion joined #salt
14:48 otter768 joined #salt
14:49 TooLmaN joined #salt
14:52 drawsmcgraw left #salt
14:52 _JZ_ joined #salt
14:53 tvinson joined #salt
14:54 rem5 joined #salt
14:56 jaybocc2 joined #salt
14:58 quasiben joined #salt
14:58 racooper joined #salt
14:59 TooLmaN joined #salt
15:02 dyasny joined #salt
15:03 andrew_v joined #salt
15:05 perfectsine joined #salt
15:05 cyborg-one joined #salt
15:12 jaybocc2 joined #salt
15:16 perfectsine joined #salt
15:20 mpanetta_ joined #salt
15:20 zmalone joined #salt
15:27 nmadhok joined #salt
15:28 kusams joined #salt
15:36 bhosmer joined #salt
15:42 murrdoc joined #salt
15:42 drawsmcgraw joined #salt
15:44 perfectsine joined #salt
16:07 cberndt joined #salt
16:08 chadhs joined #salt
16:10 drawsmcgraw Anyone ever seen ssh/vim sessions just randomly hang while you're still active on them? It's taking me forever to write this Opengrok state file because the thing hangs every minute.
16:11 sdm24 joined #salt
16:11 murrdoc there must be a setting
16:11 murrdoc somewhere in ssh
16:11 murrdoc to keep alive the tcp
16:11 murrdoc #stay-trolling
16:12 murrdoc Host *
16:12 murrdoc ServerAliveInterval 60
16:12 murrdoc TCPKeepAlive=yes
16:12 murrdoc add that to your ~/.ssh/config
16:12 stomith joined #salt
16:17 giantlock joined #salt
16:17 evilrob joined #salt
16:24 venu0336 joined #salt
16:28 calvinh joined #salt
16:31 moogyver joined #salt
16:38 fredvd joined #salt
16:44 MeltedLux joined #salt
16:44 babilen drawsmcgraw: You should also look into mosh
16:45 drawsmcgraw murrdoc: Thanks. But this is hanging *while I type*. Would that still make a difference?
16:45 drawsmcgraw babilen: mosh.... lemme look that up
16:45 drawsmcgraw babilen: mobile shell? https://github.com/mobile-shell/mosh
16:46 babilen It's just wonderful to close your laptop with multiple sessions, only to open it somewhere else and have all your sessions back :)
16:46 drawsmcgraw O.o
16:46 babilen Also a life saver when you are working on slow/unreliable links
16:46 drawsmcgraw Definitely digging into that. Thanks!
16:46 babilen Yeah, https://mosh.mit.edu/
16:46 murrdoc mosh is the gnosh
16:46 MeltedLux joined #salt
16:47 babilen Watch the sales pitch video .. but nothing beats trying it yourself .. Just open a session, rip out the cable, turn off wifi .. wait .. plug it in and .. *bam*
16:47 hightekvagabond joined #salt
16:49 otter768 joined #salt
16:52 jaybocc2 joined #salt
16:54 babilen drawsmcgraw: You like?
16:55 Brew joined #salt
16:57 drawsmcgraw babilen: I've bookmarked it for tonight. Our Opengrok server's been down for two days now and I gotta finish the Salting so it's never hard to deploy again :)
16:58 babilen drawsmcgraw: It would literally be a "apt-get install mosh" (on both sides) and a "mosh box-to-which-you-can-connect-via-ssh-already"
16:59 babilen Just though it might make your life a lot easier immediately
16:59 babilen *thought
16:59 drawsmcgraw hrm.... one second
16:59 brianfeister joined #salt
16:59 PeterO joined #salt
17:01 troyready joined #salt
17:04 quasiben joined #salt
17:04 kermit joined #salt
17:05 AlberTUX joined #salt
17:09 drawsmcgraw And... my test VM got hung trying to index several GB's of source code.... well. Eventually
17:16 felskrone1 joined #salt
17:16 tmclaugh[work] joined #salt
17:17 denys joined #salt
17:20 marsdominion joined #salt
17:20 marsdominion joined #salt
17:22 cpowell joined #salt
17:24 ageorgop joined #salt
17:26 dgutu joined #salt
17:28 chadhs joined #salt
17:32 marsdominion joined #salt
17:32 marsdominion joined #salt
17:33 writtenoff joined #salt
17:41 akhter Anyone remember what I have to pass to the minion to accept external modules?
17:41 runiq joined #salt
17:41 whytewolf akhter: if the module is in _modules you just run saltutil.sync_all
17:41 akhter No, I was thinking testing development modules.
17:42 akhter http://ryandlane.com/blog/2015/06/03/using-development-branch-saltstack-python-modules-in-the-stable-release/
17:42 akhter Found it.
17:42 runiq Hey all, is there a way to raise something like a NotImplementedError in an SLS file? I'd like to write a formula for internal use that doesn't yet work on a few distributions.
17:43 whytewolf akhter: oh glad you found it i think you meant the -m for modules_dir
17:43 akhter That works, I didn't know there was a flag for it.
17:44 whytewolf akhter: for salt-call there is, I don't know about salt
17:44 whytewolf but testing should be done with salt-call anyway ;)
17:45 whytewolf runiq: you could have a jinja test the distro then if it isn't correct use a test state
17:45 whytewolf runiq: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.test.html
17:45 flowstat_ joined #salt
17:45 whytewolf runiq: kinda like this but testing for distro not a nonexistend pillar https://gist.github.com/whytewolf/60d0318b33122af367e1
17:46 runiq whytewolf: Ah, excellent, thank you! I didn't even know about the test state.
17:46 runiq That'll come in handy.
17:58 shaggy_surfer joined #salt
18:00 tmkerr joined #salt
18:03 nmadhok joined #salt
18:03 perfectsine joined #salt
18:03 IPA` joined #salt
18:04 nafg joined #salt
18:04 amcorreia joined #salt
18:10 shaggy_surfer joined #salt
18:19 winsalt joined #salt
18:19 bhosmer joined #salt
18:20 baweaver joined #salt
18:22 marsdominion joined #salt
18:23 lumtnman joined #salt
18:24 Ryan_Lane can anyone think of a reason that salt-call might take forever to initialize and run on os x?
18:24 lumtnman joined #salt
18:25 Ryan_Lane this just started recently and I don't know why it might be happening
18:25 jfindlay Ryan_Lane: salt version?
18:25 Ryan_Lane 2015.8.something
18:25 jfindlay do you see anything in the debug log?
18:26 Ryan_Lane no log file. even before it starts logging it's taking forever
18:26 whytewolf Ryan_Lane: on os x? not sure. I know i recently had that issue with linux that turned out to be lspci hanging forever.
18:26 jfindlay does `salt-call -l trace` show anything?
18:27 jfindlay or strace? :)
18:28 Ryan_Lane no strace on os x :(
18:28 Ryan_Lane with -l trace it still takes ages just for it to get to the point of logging
18:28 geekatcmu dtrace
18:28 Ryan_Lane which is why I'm thinking it has something to do with the initilization
18:28 Ryan_Lane yeah, I'm terrible with dtrace, though
18:29 geekatcmu "dtruss" is probably what you really want.
18:29 Ryan_Lane oh. awesome. it's way closer to strace
18:29 geekatcmu yes
18:31 Ryan_Lane pretty sure it's the module loading that's taking ages
18:32 Ryan_Lane yeah. it is.
18:33 jfindlay Ryan_Lane: paste? :)
18:33 Ryan_Lane paste won't be helpful
18:33 jfindlay darn
18:33 Ryan_Lane it just loads a module shown in the trace, then it takes like 30 secs then it loads the next one
18:34 jfindlay that is a long time, especially for a few hundred modules
18:35 Ryan_Lane I think there's something wrong with my laptop
18:35 Ryan_Lane now shell commands are taking ages
18:35 Ryan_Lane I hope it isn't giving up the ghost :(
18:35 Ryan_Lane hahaha. dtruss was causing that. nevermind :)
18:36 rem5 joined #salt
18:38 Lionel_Debroux joined #salt
18:39 wendall911 joined #salt
18:42 wendall911 left #salt
18:43 flowstat_ joined #salt
18:44 marsdominion joined #salt
18:44 marsdominion joined #salt
18:47 quasiben joined #salt
18:49 baweaver joined #salt
18:50 otter768 joined #salt
18:52 rem5 joined #salt
18:54 kevinquinnyo salt orchestrations happen in order in which you write them, from top to bootom by default right?
18:54 kevinquinnyo and if so, what happens if you use the py renderer to define them
18:54 rem5 joined #salt
18:55 Edgan kevinquinnyo: yes, one exception I have found is grains set within a state are always set at the end of that state
18:55 marsdominion joined #salt
18:55 kevinquinnyo weird, they seem to be happening out of order for me
18:55 Edgan kevinquinnyo: The order is a configurable setting. Let me dig it up
18:56 Edgan kevinquinnyo: orchestration might be different if it is trying to parallelize things. I have seen ansible behave that way.
18:57 Edgan kevinquinnyo: https://docs.saltstack.com/en/latest/ref/states/ordering.html
18:58 kevinquinnyo yeah but i thought the point of the orchestrate runner was so that you can guarantee ordering without having to use requisites or an explicit 'order' key
18:58 cpowell would anyone happen to know if file.replace happens to suport regex/capture groups?
18:58 ageorgop joined #salt
18:58 Edgan kevinquinnyo: orchestration as in salt on the salt master, not salt-ssh, right?
18:59 kevinquinnyo yeah
18:59 colegatron joined #salt
18:59 kevinquinnyo salt-run salt-run state.orchestrate ...
18:59 kevinquinnyo oops
18:59 kevinquinnyo s/^salt-run\ //
19:00 whytewolf humm, orchestration for me is always top down. but then again i don't use py render for it. maybe the python is returning things in the wrong order?
19:00 geekatcmu So, here's an odd thing: is there a way in Jinja to determine if a state is laoded?
19:00 geekatcmu I realize there is a whole chicken-and-egg thing.
19:00 kevinquinnyo whytewolf: that's something i was worried about -- if it does things top-down, then salt, internally must be reading the file lin-by line, since order is generally arbitrary in python data structures to my knowledge
19:01 geekatcmu But I've got a couple states where I want to modify firewall rules, but only if the firewall module has already been loaded.
19:01 geekatcmu s/module/state/
19:01 whytewolf kevinquinnyo: well yaml is loaded in an ordereddict.
19:01 RandyT question regarding schedules
19:02 free_beard joined #salt
19:02 RandyT what would be required to create a schedule to run win_update.installed ?
19:02 marsdomi_ joined #salt
19:02 RandyT appears it is not a function: and not finding many other examples in the doc
19:03 TyrfingMjolnir joined #salt
19:05 kevinquinnyo Edgan: whytewolf: it goes in the expected order (top-down) when written in YAML format, but not when using py renderer
19:05 whytewolf geekatcmu: you could check https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.sysmod.html#salt.modules.sysmod.list_modules for the module you are looking for. or https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.sysmod.html#salt.modules.sysmod.list_state_modules if state module
19:06 geekatcmu whytewolf: thanks
19:06 geekatcmu Sadly, I don't think they help.
19:06 geekatcmu It's actual states.
19:06 Edgan kevinquinnyo: fun
19:06 RandyT here is what I am currently trying to create the schedule on the minion; https://gist.github.com/rterbush/bf57a8e54c9527a739b3
19:07 geekatcmu If someone does "include: - firewall.standard\n - bacula.client" the bacula.client state will want to extend the firewall state.
19:07 geekatcmu But if they just "include: - bacula.client" no firewall bits need to be touched.
19:08 whytewolf ahhh so check for states in the highstate data. in thoery maybe you could wrap show_highstate in jinja
19:09 marsdominion joined #salt
19:09 marsdominion joined #salt
19:10 whytewolf but that would be a pain to rip apart
19:11 marsdominion joined #salt
19:11 marsdominion joined #salt
19:12 whytewolf RandyT: win_update is a state module. you are trying to run it as a exacution module
19:12 RandyT figured it out...
19:12 RandyT thanks whytewolf
19:12 RandyT state.sls
19:12 whytewolf yeap
19:13 cliluw joined #salt
19:14 nethershaw joined #salt
19:14 geekatcmu thanks for the idea.
19:14 geekatcmu I'll see if it's feasable.
19:14 geekatcmu and maybe learn to spell
19:14 ajw0100 joined #salt
19:14 chadhs joined #salt
19:15 whytewolf why I never learned to read :P
19:16 cberndt joined #salt
19:17 marsdominion joined #salt
19:17 marsdominion joined #salt
19:20 peters-tx joined #salt
19:21 marsdominion joined #salt
19:22 Ashald_ hi guys
19:23 Ashald_ how can I execute saltmod.wait_for_events via salt-run or RunnerClient?
19:24 GreatSnoopy joined #salt
19:25 whytewolf um, saltmod is a state module not a runner module. the closest i can think of is state.event
19:26 whytewolf Ashald_: https://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.state.html#salt.runners.state.event
19:26 Ashald_ the problem is that I need to wait for several event to occur
19:27 Ashald_ so I though about using 'id_list' feature of wait_for_event
19:27 Ashald_ let's say I have event 'deployed', and one will have in data 'component=X' while another will have 'component=Y'
19:27 Ashald_ and I need to wait for both of them to complete
19:28 Ashald_ from within a runner
19:30 Ashald_ I'm already using RunnerClient within my runner so thought I will use it here as well
19:30 Ashald_ But maybe there is other way to call this function from within the runner?
19:31 mapu joined #salt
19:33 forrest joined #salt
19:34 whytewolf Ashald_: yeah, unforchantly saltmod isn't even a exacution module. you might be able to use it with __states__ but i can't say for sure. honestly you are better off using state.event which is a runner and deep diving the data returned.
19:34 Ashald_ hm... got your idea, thanks
19:35 Ashald_ another question :)
19:35 perfectsine joined #salt
19:35 Ashald_ let's assume within the sls I have a dict serialized as yaml string
19:36 StolenToast joined #salt
19:36 Ashald_ so the var name is data_str
19:36 Ashald_ can I do something like {{ data|yaml }} to get it deserialized?
19:36 whytewolf {{data|yaml}} goes the orther direction
19:37 whytewolf from yaml to dict
19:37 whytewolf err from dict to yaml i mean
19:39 marsdominion joined #salt
19:39 marsdominion joined #salt
19:40 Ashald_ is there is a way to get from yaml to dict? :)
19:40 giantlock joined #salt
19:40 whytewolf Ashald_: had to go to the docs for this one {{data|load_yaml}} is the other direction
19:41 Ashald_ can you point me to the docs you fund this in?
19:41 Ashald_ I tried...
19:41 Ashald_ but didn't find
19:41 Ashald_ :(
19:41 Ashald_ thanks!
19:42 whytewolf Ashald_: https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html#salt.utils.jinja.SerializerExtension about half way down that function under load filters
19:42 Ashald_ oh greatL
19:42 Ashald_ *!
19:42 Ashald_ thanks!
19:43 mrwboilers joined #salt
19:44 mrwboilers I'm having an issue upgrading using the saltstack CentOS6 repo. It seems to need a package openpgm-5.2.122-2.el6.x86_64 but it can't find it.
19:44 mrwboilers Is there anything wrong with the repo, or is this a problem on my end?
19:44 flowstat_ joined #salt
19:46 pfallenop joined #salt
19:46 tmclaugh[work] joined #salt
19:47 zmalone What do you get for "yum list openpgm"?
19:47 mrwboilers Here's the full error if that's any help: https://gist.github.com/mrwboilers/e1a0c3caa0284c15740b
19:48 whytewolf mrwboilers: strange, browseing the repo i se the rpm
19:48 zmalone ew, that looks like a result of saltstack's packaging overwriting OS packages with identically named packages
19:49 zmalone So you have libpgm-5.1.so.0, and something else depends on it
19:49 mrwboilers zmalone: yum list does show the package in the saltstack-repo. It just says 'not found' when I actually try to install it.
19:49 zmalone and saltstack is trying to install openpgm 5.2 instead
19:49 zmalone So you need to uninstall zeromq3-3.2.5-1.el6.x86_64 first?
19:50 mrwboilers I ran into this same issue on one of my minions. I just uninstalled openpgm (which meant uninstalling salt as well) then reinstalling. That worked ok.
19:50 mrwboilers But now, I'm getting this on my master. I'd like to avoid an uninstall/reinstall if at all possible.
19:51 akhter joined #salt
19:52 whytewolf mrwboilers: been a while since i did this but iirc you can remove the old package through rpm instead of yum which should allow you to proceed.
19:53 whytewolf of coarse, backup first
19:54 mapu I am using salt-cloud to instantiate severl severs at amazon. I’d like to use script_args to specifiy the version of salt that I need installed. I used script_args: stable '2015.8.1' but that is failing. Any guidance would be most helpful.
19:54 ViciousLove Can anyone think of a way to take data from an unmanaged file, so that I can use it in a managed file?
19:55 zmalone mapu: What repo are you using?
19:55 zmalone Stable is now 2015.8.3, and 2015.8.1 doesn't exist in the primary repo any more, the saltstack people move it to an "archive" repo
19:56 mrwboilers uninstalling via rpm just gives me failed dependency errors. Following all the dependencies leads to needing to uninstall salt. So, same result as yum.
19:57 whytewolf mrwboilers: could have sworn there was a way to force the uninstall then use yum to fix the tree
19:57 mapu zmalone: hmm- good question. I am not specifying any- whatever the default using the newest bootstrap-salt.sh script.
19:57 mapu Essentially- I need that version to properly manage rt53 DNS
19:57 whytewolf the bootstrap script has always been a crap shoot
19:58 zmalone Try changing your settings to 2015.8.3 and it might work
19:58 mapu Ah- ok- trying that.
19:58 mrwboilers whytewolf: Tried '--force' but it fails and says only installation, upgrading, rmsource and rmspec can be forced.
19:59 whytewolf mrwboilers: --nodeps?
20:00 mrwboilers whytewolf: THANKS!! That did the trick. Uninstalled openpgm with rpm --nodeps, then reinstalled via yum.
20:00 baweaver joined #salt
20:01 mrwboilers And didn't need to uninstall/reinstall salt
20:03 FreeSpencer Is there a guide to follow for commenting your template files for arguments and such?
20:04 marsdominion joined #salt
20:05 bhosmer joined #salt
20:07 teryx510 joined #salt
20:08 marsdominion joined #salt
20:08 zmalone mapu: I'm curious if it works, packages and bootstrapping are a lot of trouble right now.
20:16 pegmanm joined #salt
20:18 pppingme joined #salt
20:20 wendall911 joined #salt
20:20 sinh joined #salt
20:21 Ashald_ hey guys, another question :)
20:21 Ashald_ I'm doing a call with pepper library
20:21 Ashald_ with --client=runner
20:21 murrdoc hot
20:21 Ashald_ and job is expected to run for ~5 mins
20:22 Ashald_ I have 'rest_timeout: 3600' in my master/api config
20:22 Ashald_ but eventually pepper returns with the message
20:22 Ashald_ "Pepper error: Server error."
20:23 Ashald_ And if I look into API logs I see TImeoutError as here http://pastebin.com/raw/TAAwH2p6
20:23 Ashald_ <murrdoc> hot -- you meant me asking a lot of questions? yeah, I'm doing PoC with SaltStack and trying to convince our organization to use it :)
20:23 Ashald_ any ideas what's wrong with my setup? :(
20:24 kevinquinnyo if you have an orchestration, the order is top-down, but are the items in - sls: also run in order of appearance?
20:25 anmol joined #salt
20:25 bhosmer joined #salt
20:25 perfectsine joined #salt
20:26 pmcnabb joined #salt
20:26 wryfi left #salt
20:27 baweaver joined #salt
20:28 marsdominion joined #salt
20:28 marsdominion joined #salt
20:30 mrwboilers left #salt
20:30 adelcast joined #salt
20:31 colegatron joined #salt
20:33 colegatron_ joined #salt
20:33 winsalt i think salt always runs states top to bottom, unless there are requires
20:34 whytewolf any kind of requisit, or order function can cause salt to wildly chang ethe order
20:35 perfectsine joined #salt
20:36 fen joined #salt
20:37 cyborg-one joined #salt
20:37 fen hi
20:38 fen i have a jinja question.. i want to limit thie to max three results: mons.values()|sort|map(attribute='host')|join(',')
20:38 fen i'm trying this for days now
20:38 fen using slice(3) i get the closest to what i want but still it does not fit
20:38 fen i want to get a string a,b,c
20:38 fen and with slice(3) i get [a],[b],[c]
20:39 pirulo joined #salt
20:39 AndreasLutro try (mons.values()|sort)[:3] | map(..)|join(',')
20:39 fen isn't it possible to limit a list in jinja to n elements?
20:39 viq joined #salt
20:40 fen @andreaslutro: thanks!
20:40 fen that works
20:40 fen *bow*
20:40 pirulo I'm trying to run this command from salt \* cmd.run "cat /proc/mounts|sort|awk '{print $1 "\011" toupper(substr($4,0,2))}'" I'm having a hard time
20:41 shaggy_surfer joined #salt
20:41 fen because of the nested "?
20:41 Destreyf joined #salt
20:42 Destreyf Guys i'm having some trouble working my way through this mentally and was wondering if someone could help me wrap my brain around how this would be accomplished
20:42 marsdominion joined #salt
20:42 marsdominion joined #salt
20:43 flowstat_ joined #salt
20:43 viq1 joined #salt
20:43 Destreyf I need to run a command on the salt-master to generate a token, then have the salt-minion install a package, once that package is done, i need to run 2 commands, one to configure the package (it has its own cli utility to do so) and the other to restart the service to make it take effect.  Any examples that would get me some of the information on passing the request across?
20:43 Destreyf errr data, nto request
20:46 fen cp.push?
20:48 DammitJim joined #salt
20:51 otter768 joined #salt
20:51 Ashald_ is there is a 'requisites' keyword to execute state when there are NO changes?
20:52 cpowell_ joined #salt
20:53 fxhp joined #salt
20:54 antpa joined #salt
20:57 hackel joined #salt
20:58 mapu joined #salt
20:58 anotherZero joined #salt
21:01 brianfeister joined #salt
21:12 aidalgol joined #salt
21:15 cpowell joined #salt
21:22 cyborg-one joined #salt
21:24 rem5 joined #salt
21:28 bonzibuddy joined #salt
21:30 schuyler1d joined #salt
21:30 schuyler1d is there a way to put full raw files in a pillar (rather than in state)?
21:30 RandyT winsalt: whytewolf noticing your comments regarding order
21:30 antpa joined #salt
21:31 RandyT I just now finished a successful run on a windows server role that takes 1.5hr to provision.
21:31 RandyT I somehow got the impression over past weeks that using requisites was best practice.
21:31 RandyT Can I really count on salt to run the states as laid out in the state files?
21:33 winsalt salt is made to run in the same order with requisites or not.
21:34 RandyT winsalt: the thing that has been very challenging about this experience is reboots...
21:35 winsalt it shouldnt be that bad with orchestration
21:35 RandyT based on your comments, seems that I should be able to put a reboot at the end of where I think the deployment process ends
21:36 akhter joined #salt
21:37 RandyT winsalt: I probably need to get deeper into orchestration. I am using some orchestration as you have coached me... but at some point, just resorting to continual highstate until it is complete on reboots
21:37 winsalt i believe if you had a reboot state, at the bottom of the list in top.sls, it would be the last state executed
21:38 RandyT I will continue on the path.. feeling some success to have captured this one rather complex server role.
21:39 RandyT Will dig deeper into orchestration as I start looking at more boto and networking services...
21:40 winsalt yeah i think orchestration is key.
21:40 RandyT I need to actually do a bit more debugging to see if it is actually working. jobs.active seems to show a highstate rather early right now and wait_for_event not clear
21:41 DanyC joined #salt
21:42 RandyT from what I have seen, it is not clear that the cloud/*/created event is actually occuring before the started event...
21:42 DanyC hi all, anyone is using salt as part of a ci/cd pipeline ?
21:43 winsalt i have "salt-run state.event pretty=True" always running in another window, its like looking into  the matrix
21:43 flowstat_ joined #salt
21:43 RandyT winsalt: thanks for the hint, I will give that a try.
21:46 baweaver joined #salt
21:52 mapu zmalone: I set the following : script_args: stable '2015.8.3' and my launch failed. Can you suggest a way for me to ensure that version 2015.8.3 is installed on my minions?
21:53 zmalone It should be listed in your apt/yum package list, but if the bootstrap script is bombing, I'd just follow the instructions at https://repo.saltstack.com/ that involve manually adding the repo
21:53 zmalone like https://repo.saltstack.com/#rhel for rhel or https://repo.saltstack.com/#debian for debian
21:55 RandyT mapu: I set script_args: git v2015.8.3 in profiles
21:55 RandyT no messing with repo updates, etc
21:56 mapu ah - true.
22:02 rburkholder joined #salt
22:07 ageorgop joined #salt
22:16 brianfeister joined #salt
22:17 ekristen joined #salt
22:26 winsalt RandyT, here is that source for the state ordering https://docs.saltstack.com/en/latest/ref/states/ordering.html
22:28 upb joined #salt
22:32 murrdoc ordering is top down
22:32 murrdoc use top down
22:32 murrdoc stay sane :D
22:32 whytewolf for once i agree with murrdoc :P
22:34 RandyT winsalt: thanks
22:35 RandyT so if I understand, setting state_auto_order: False will make salt process states in order that they are found in the state files?
22:35 murrdoc whytewolf: u agree with me once a day
22:35 murrdoc thats my daily goal
22:35 RandyT wording is a bit confusing: state_auto_order "makes states get evaluated in the order in which they are defined in sls files"
22:37 RandyT "auto" would imply for me that the system orders them as it sees fit...
22:43 jfindlay it would be nice if there were an equivalent to show_sls for runners
22:44 flowstat_ joined #salt
22:45 winsalt left #salt
22:47 elsmo joined #salt
22:52 otter768 joined #salt
22:54 slav0nic as i can force restart service every time on highstate call?
22:55 whytewolf slav0nic: actually yes you can. instead of using service.running. use module.run with service.restart
22:56 slav0nic whytewolf, tnx
23:01 adelcast joined #salt
23:05 cberndt joined #salt
23:11 abednarik joined #salt
23:13 nmadhok joined #salt
23:14 nmadhok joined #salt
23:16 LondonAppDev joined #salt
23:16 nmadhok joined #salt
23:17 LondonAppDev Hey, I want to use archive.extracted to a specific directory. I don't want it to create a directory with the name of the tar archive inside the target, I want the contents of the tar to be moved to the destination. Is that possible?
23:21 elsmo joined #salt
23:27 antpa joined #salt
23:27 quasiben joined #salt
23:28 TyrfingMjolnir joined #salt
23:30 eliasp LondonAppDev: archive.extracted doesn't create a top-level directory on its own, it just unpacks the archive
23:31 eliasp LondonAppDev: if the archive contains a single top-level directory, use "tar_options: '--strip-components=1'"
23:31 LondonAppDev eliasp: yes that's right but my archive is called wordpress.tar.gz and I want to put it in /usr/local/sites/mysite/htdocs/
23:32 yomilk joined #salt
23:32 eliasp LondonAppDev: and the result is?
23:33 ranomore1 LondonAppDev isn't that what the name parameter is for? Or is the problem that your tgz file has a root folder inside of it?
23:33 LondonAppDev eliasp: ah just saw your last message, will try it.
23:33 LondonAppDev ranomore1: the problem is tgz file has a root folder in it.
23:36 ajw0100 joined #salt
23:37 LondonAppDev eliasp: --strip-components=1 worked like a dream. Thank you.
23:37 eliasp LondonAppDev: yw
23:39 rem5 joined #salt
23:39 baweaver joined #salt
23:42 drawsmcgraw left #salt
23:43 flowstat_ joined #salt
23:44 kevinquinnyo https://gist.github.com/kevinquinnyo/dc9563ea24ceae6945d7  <-- why is my unless being ignored
23:44 kevinquinnyo i have even tried switching the unless command to 'echo foo'
23:44 kusams joined #salt
23:44 kevinquinnyo is my syntax incorrect?
23:48 subsignal joined #salt
23:50 ranomore1 what does it look if you write it in a jinja state file and do a state.show_sls on it?
23:50 bimmerboy joined #salt
23:51 ranomore1 curious mostly, I think it looks fine ;)
23:52 liskl joined #salt
23:53 kevinquinnyo had to put test in front of the command
23:53 kevinquinnyo which is weird becuase it was already returning the correct exit codes
23:54 kevinquinnyo maybe it has to do with the way salt runs the commands or the env of the salt-minion user
23:54 kevinquinnyo but thanks for the tup on show_sls -- i think ive been looking for that for a while
23:54 ranomore1 oh good
23:55 zmalone joined #salt
23:55 kevinquinnyo tip*
23:56 goldbuick__ joined #salt

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