Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-08-04

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

All times shown according to UTC.

Time Nick Message
00:06 woodtablet whytewolf: i found an oracle linux repo.. if it helps http://yum.oracle.com/public-yum-ol7.repo
00:06 woodtablet wget that yum repo file, and you will see all the sub repos
00:08 woodtablet left #salt
00:24 noraatepernos joined #salt
00:30 whytewolf humm, looking through that i don't see a java repo. and i would rather not replace my centos with oracle linux
00:31 whytewolf maybe i just dreamed it
00:52 karlthane joined #salt
01:11 cyborg-one joined #salt
01:30 sh123124213 joined #salt
01:39 demize Yeah, I think you'd just have to install the RPMs for CentOS.  For RHEL you can enable Java repos through subscription-manager.
01:39 justan0theruser joined #salt
01:40 justan0theruser joined #salt
01:50 llua joined #salt
01:52 ilbot3 joined #salt
01:52 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.6, 2017.7.0 <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic <+> We are volunteers and may not have immediate answers <+> The call for speakers for SaltConf17 is now open: http://tinyurl.com/SaltConf17
01:55 svij2 joined #salt
02:06 http_GK1wmSU joined #salt
02:07 svij2 joined #salt
02:08 http_GK1wmSU left #salt
02:28 mbuf joined #salt
02:42 nkuttler joined #salt
02:47 justanotheruser joined #salt
02:48 justanotheruser joined #salt
02:51 svij2 joined #salt
02:51 icebal joined #salt
03:04 mikea joined #salt
03:08 onlyanegg joined #salt
03:19 donmichelangelo joined #salt
03:49 onlyanegg joined #salt
04:02 ninjada_ joined #salt
04:03 pualj joined #salt
04:13 evle joined #salt
04:26 swills joined #salt
04:37 karlthane joined #salt
04:43 J0hnSteel joined #salt
04:46 ninjada joined #salt
04:53 icebal joined #salt
05:04 svij2 joined #salt
05:05 btorch left #salt
05:22 Bock joined #salt
05:32 swa_work joined #salt
05:33 impi joined #salt
05:43 preludedrew joined #salt
05:50 oida_ joined #salt
05:54 jhauser joined #salt
06:01 golodhrim|work joined #salt
06:07 DarkKnightCZ joined #salt
06:09 cyborg-one joined #salt
06:29 Ricardo1000 joined #salt
06:33 impi joined #salt
06:35 do3meli joined #salt
06:35 do3meli left #salt
06:37 onlyanegg joined #salt
06:46 aphor joined #salt
06:47 Guest73 joined #salt
06:54 _aeris_ joined #salt
06:57 dan949 joined #salt
07:01 kiorky joined #salt
07:03 ashmckenzie joined #salt
07:16 rgrundstrom joined #salt
07:16 rgrundstrom Good morning everyone
07:23 pocketprotector joined #salt
07:25 Hybrid joined #salt
07:28 ninjada_ joined #salt
07:29 Miouge joined #salt
07:32 rgrundstrom This is a bit off topic but im writing code to setup firewall rules for my servers... How ever the rules that salt creates does not seem to work... And i have no idea why.  (My iptables knowlage is limited.)
07:32 rgrundstrom https://gist.github.com/anonymous/c4c17039442a4a26cf75e9e3af729169#file-gistfile1-txt
07:36 http_GK1wmSU joined #salt
07:36 ixs rgrundstrom: you have accept rules for new connections. you also need one, that allows related/not new connections: -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
07:37 http_GK1wmSU left #salt
07:37 rgrundstrom Ixs: So i need 2 rules for each port?
07:38 Rumbles joined #salt
07:38 ixs rgrundstrom: no. the rules you already had are good. they basically tell your machine to allow new incoming connections on your <ports>
07:39 ixs but they will only allow the first packet.
07:39 ixs all other packets are not considered NEW anymore and will be blocked.
07:39 ixs therefore you need _one_ other rule that says iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
07:39 ixs that one will allow all later packets as they are belonging to an ESTABLISHED connection.
07:42 rgrundstrom Ok, hang on
07:43 impi joined #salt
07:47 rgrundstrom Ok so, If i understood you correctly it should look like this?
07:47 rgrundstrom https://gist.github.com/anonymous/4e57dbc46b6bde143aaced51f1cf65ee#file-gistfile1-txt
07:47 rgrundstrom ixs: ping
07:47 ixs jupp
07:47 ixs rgrundstrom: that should work
07:47 rgrundstrom I will try
07:48 rgrundstrom Seems to be working :)
07:49 rgrundstrom Ixs: Atleast I did not lock myself out :)
07:52 ixs \o/
07:53 rgrundstrom And the rules should apply to all interfaces?
07:55 ixs the way you have defined them, yes.
07:55 rgrundstrom Good :)
07:57 cyteen joined #salt
07:58 rgrundstrom I understand the basics of a for loop. But what I dont understand is what happens after the ~ in this line:
07:58 rgrundstrom {%for port in salt['pillar.get']('firewall:' ~ salt['pillar.get']('role', ''))%}
07:59 rgrundstrom Anyone that can explain it?
07:59 kiorky joined #salt
08:00 rgrundstrom Does it include what is under pillar role?
08:01 pualj joined #salt
08:02 mikecmpbll joined #salt
08:13 ixs rgrundstrom: ~ is the concat operator for strings.
08:15 pbandark joined #salt
08:16 rgrundstrom ixs: Sorry but I dont understand what you just said.
08:16 Rumbles joined #salt
08:16 ixs rgrundstrom: string1 ~ string2 will end up being "string1string2"
08:16 ixs that's called concatenation
08:16 rgrundstrom Ok thank you
08:17 ixs so what your loop is doing is iterating over a pillar called firewall:$role
08:18 ixs e.g. if your role is webserver, it is iterating over the firewall:webserver pillar content
08:19 rgrundstrom Ahh good :) That will be usefull.
08:25 gmoro_ joined #salt
08:28 kiorky joined #salt
08:32 djinni` joined #salt
08:32 rgrundstrom vim init.sls
08:32 rgrundstrom ups... Wrong window
08:35 ninjada joined #salt
08:39 onlyanegg joined #salt
08:42 ninjada joined #salt
08:43 mikecmpbll joined #salt
08:44 lorengordon joined #salt
08:46 _KaszpiR_ joined #salt
08:48 chowmeined joined #salt
08:54 sh123124213 joined #salt
08:58 ninjada joined #salt
09:05 rgrundstrom Ixs: you still around?
09:08 ixs rgrundstrom: sure... but I might fall asleep anyminue
09:09 Miouge joined #salt
09:09 rgrundstrom Ixs just got one more question... If i have <protocol> <port> defined in my pillar file. How do i split them into seprate variables?
09:10 N-Mi joined #salt
09:10 N-Mi joined #salt
09:13 Naresh joined #salt
09:13 pualj_ joined #salt
09:16 babilen Can we disable service restarts (triggered via mod_watch) for state runs by now?
09:17 babilen Would be nice to have if services can't be restarted at the moment, but when you want to roll out/test the configuration/saltstack
09:18 babilen rgrundstrom: Could you provide an example of what you have and what you would like to achieve?
09:21 ixs rgrundstrom: {%- set (var1, var2) = pillar.whatever.split() -%}
09:21 pualj_ joined #salt
09:25 ixs rgrundstrom: that _might_ do it. untested. but should work...
09:31 zerocoolback joined #salt
09:31 Tucky joined #salt
09:39 rgrundstrom Hello babilen :) Its been to long.
09:47 Rumbles joined #salt
09:55 simon_c1 joined #salt
09:56 simon_c1 left #salt
09:57 simon_c joined #salt
10:05 rgrundstrom So this works well: https://gist.github.com/anonymous/fc56086d21515d8637624fabdcc72720#file-gistfile1-txt question is how do i get it to set the proto:? Cause inside the for loops willl not work.
10:09 Guest73 joined #salt
10:09 impi joined #salt
10:15 ixs rgrundstrom: you got a comment on https://gist.github.com/anonymous/fc56086d21515d8637624fabdcc72720#file-gistfile1-txt
10:16 rgrundstrom ixs: Allready tested that one. Does not work
10:17 ixs really? what do you get?
10:17 ixs run with -l debug and look at what gets rendered.
10:17 ixs check if the split works.
10:19 rgrundstrom ixs: https://gist.github.com/anonymous/59c93f7f54d52253d76305662170e9de
10:19 rgrundstrom The split works
10:19 rgrundstrom Allready tested it
10:20 _KaszpiR_ joined #salt
10:21 ixs rgrundstrom: the proto: tcp line needs to go.
10:26 _KaszpiR_ joined #salt
10:31 simon_c Hi all. I'm trying to understand pillars properly. I want to override "default" data based on the minionID. Is there anyway I can do something generic in the top.sls ? in psudocode, Something like "if file {grains.id}.sls exists, include the file {grains.id}.sls" ?
10:31 rgrundstrom ixs: Got it working now thank you.
10:39 onlyanegg joined #salt
10:39 N-Mi is pygit2 to be preferred over gitpython to use gitfs ? On Debian Stretch, the libgit2 version has an issue that makes it unable to fetch HTTPS repositories. So my options are a) switch to gitpython b) manually upgrade python-pygit2 and libgit2
10:42 simon_c and, when I've got pillar data, how do I query it for a specific minion ? piller.items is showing everything for a minion, but I can't figure out how to get it to only return one item.
10:50 simon_c of. figured out what I was doing wrong with question #2. I needed to do a saltutil.refresh_pillar before doing a pillar.get against the minion. (didn't need to when doing a state.apply, not sure why that is)
10:50 simon_c /of/ok/
10:52 zerocool_ joined #salt
10:52 babilen simon_c: state.apply refreshes pillars as part of the highstate run
10:53 smartalek joined #salt
10:53 pualj joined #salt
10:53 simon_c babilen: I was thinking that, but even after I'd applied a state, running the pillar.get didn't seem to return anything. But, could be me getting confused. :)
10:55 babilen simon_c: A specific state/SLS with "state.apply foo.bar" or a highstate with "state.apply" ?
10:55 simon_c babilen: a state.apply foobar
10:56 babilen simon_c: What I referred to holds true for highstates (i.e. "state.highstate" for which "state.apply" without arguments is an alias)
10:56 babilen But it's not a bad idea in general to refresh pillars if you rely on them being correct regardless
10:58 simon_c babilen: OK. so yes. When I set a state, with "state.apply ntp", the new values are updated in the managed file. but if I query the pillar data, with "pillar.get ntp:servers" it returns the old values, until I've ran a refresh.
10:58 simon_c babilen: which seems strange, but at least I understand that bit now.
10:59 XenophonF N-Mi: I'm not sure one Git library is preferred over another.
11:00 XenophonF I personally prefer GitPython b/c it supports things like ED25519 public keys (since it uses "real" git/ssh).
11:01 N-Mi XenophonF: ok, I'll try to switch to gitpython then. I was seeing that many features were available only with pygit2, so I thought it might be the "official" git protocol provider
11:02 XenophonF Note that you can still configure GitPython using Salt.
11:02 simon_c back to the first question on pillars. I want to override "default" data based on the minionID. Is there anyway I can do something generic in the top.sls ? in psudocode, Something like "if file {grains.id}.sls exists, include the file {grains.id}.sls" ?
11:02 simon_c Or, do I *have* to add a " 'minionid': \n   - minionid' for every minion I want to import custom data for ?
11:03 XenophonF I use users-formula to manage both the Git config and the SSH config/keys for the salt-master service account.
11:03 XenophonF for example - https://github.com/irtnog/salt-pillar-example/blob/master/salt/example/com/init.sls#L19
11:04 XenophonF simon_c: where do you store your pillar data?
11:05 XenophonF I keep mine in Git, so it takes the salt-master a bit to cache updates.
11:05 XenophonF a minute or two, usually
11:05 simon_c XenophonF: just in the file system. Not reached advanced things like git yet :)
11:05 babilen simon_c: You can do exactly what you do, but would have to specify ignore_missing
11:05 babilen (i.e. use grains.id)
11:06 N-Mi XenophonF: thanks
11:07 ixs simon_c: have a look at https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.file_tree.html
11:07 ixs simon_c: that might be a simple solution to what you're facing
11:08 ixs simon_c: and about your override question, look at https://docs.saltstack.com/en/latest/topics/pillar/#pillar-namespace-flattening
11:08 ixs and the chapter after
11:09 XenophonF babilen: is ignore_missing an option you'd specify in the target list, like match?
11:11 high_fiver joined #salt
11:12 simon_c ixs: Thanks. I'll take a look at filetree too, looks a little more advanced, so want to get to grips with the basics first.
11:15 pualj joined #salt
11:16 XenophonF well this is a bummer - ignore_missing isn't documented
11:16 simon_c babilen: So, doing "  '{{grains.id}}': \n   - {{grains.id}}  " in top.sls did something, but now when I try to do a pillar.items against the minion, it's saying the "specified SLS file 'host.domain' doesn't in environment 'base' is not available on the sale master. ."  the file host.domain.sls exists My minion IDs are FQDNs, including dots, does that matter ?,
11:16 XenophonF but it's in the code: https://github.com/saltstack/salt/blob/develop/salt/pillar/__init__.py#L522
11:17 XenophonF simon_c: don't do `'{{grains.id}}'` to escape things
11:17 XenophonF use {{ grains.id|yaml_encode }} instead
11:18 XenophonF I've never named my SLSes "something.something.sls".
11:19 XenophonF I've always used subdirectories e.g. "something/something/something/dark/side.sls"
11:19 simon_c XenophonF: *ahh* that might be the problem I'm running into there...
11:20 babilen simon_c: did you specify ignore_missing as mentioned?
11:20 simon_c I'll figure out how to do a s/\./_/  on the IDs, and SLS file names, which I do in puppet now, so shouldn't be a problem.
11:21 simon_c babilen: not yet, wanted to get it working with a file i know should be there, and see errors if it doesn't work.
11:21 * simon_c is taking baby steps.
11:21 babilen simon_c: You'd target it to '*' and specify ignore_missing
11:22 XenophonF this is how I did it: https://github.com/irtnog/salt-pillar-example/blob/master/top.sls#L99
11:22 babilen Dots are probably causing the problem and you might want to account for that or target by hostname
11:22 babilen Ah, yaml_encode ftw :)
11:22 babilen The important bit is the ignore_missing
11:24 XenophonF simon_c: use jinja to replace . with _
11:25 XenophonF {{ grains.id|replace('.', '_')|yaml_encode }}
11:25 XenophonF er i mean {{ grains.id|replace('.', '_')|lower|yaml_encode }}
11:26 XenophonF there's usually a YAML filter for common cases, seeing as how it's used so much in HTML templating in the Python world
11:27 XenophonF and if there isn't a YAML filter, you can usally call methods on a given object (e.g., {{ grains.id.lower() }})
11:27 XenophonF and in the absolute worst case, you can write your own Salt execution module which can perform all sorts of awful kludges
11:27 peters-tx joined #salt
11:29 XenophonF Is there an ordering guarantee for SLS target specs in top files?
11:29 XenophonF That's why I put this particular match at the end of my top file.
11:29 XenophonF (I'd want the minion-specific Pillar SLS to override everything that came before.)
11:30 simon_c XenophonF: that looks like a perfect example. thanks !
11:31 http_GK1wmSU joined #salt
11:32 http_GK1wmSU left #salt
11:46 zerocoolback joined #salt
11:53 Guest73 joined #salt
11:53 tacoboy joined #salt
11:55 gmoro joined #salt
12:05 ssplatt joined #salt
12:10 cgiroua joined #salt
12:10 _KaszpiR_ joined #salt
12:20 gmoro joined #salt
12:35 J0hnSteel joined #salt
12:38 Guest73 joined #salt
12:40 onlyanegg joined #salt
12:51 _aeris_ joined #salt
12:55 drawsmcgraw joined #salt
12:58 drawsmcgraw left #salt
13:00 drawsmcgraw1 joined #salt
13:20 pualj_ joined #salt
13:20 Guest73 joined #salt
13:22 Reverend do you chaps reckon I could do a salt['grains.get'] from inside the pillar? O.o
13:27 numkem joined #salt
13:29 Guest73 joined #salt
13:31 Guest73 joined #salt
13:32 racooper joined #salt
13:32 bildz I'm playing around with some logic and am wondering if the if statement I have is possible, cause it's creating the 1st file, but not the 2nd:  https://pastebin.com/MmTgEWDJ
13:39 haam3r_ joined #salt
13:41 onlyanegg joined #salt
13:45 haam3r_ joined #salt
13:45 _JZ_ joined #salt
13:46 hemebond left #salt
13:47 mage_ joined #salt
13:47 mage_ hello
13:47 mage_ has anyone already setup CI/CD with Gitlab and Saltstack ?
13:48 drawsmcgraw1 left #salt
13:48 drawsmcgraw joined #salt
13:48 mage_ my goal is to launch an orchestration script on the salt master
13:49 noobiedubie joined #salt
13:49 drawsmcgraw mage_: I've done Github + Jenkins
13:50 drawsmcgraw Github hook -> Trigger Jenkins -> Hit salt-api
13:50 tapoxi joined #salt
13:52 mage_ salt-api ?
13:52 mage_ why not directly execute a state ?
13:53 swills joined #salt
13:54 mage_ I've 3 FreeBSD jails, one with gitlab, one for salt-master and one which is the sandbox .. do you thing I need salt-api in this case ? I thought I could directly execute on the salt-master from a gitlab runner ...
13:55 mage_ commit -> runner -> launch orchestration script on salt-master -> deploy on sandbox
13:55 drawsmcgraw Ah. I don't know enough about BSD jails but it *sounds* like you could skip the salt-api part. I'm used to using Github.com, Jenkins on one box, and the Salt master on another.
13:56 mage_ you can see jails as chroot on steroids, or similar to Docker
13:56 drawsmcgraw mage_: I don't see why that wouldn't work. Sounds solid to me.
13:56 drawsmcgraw Right. Makes sense
13:56 mage_ perfect :)
13:56 mage_ thanks
13:56 drawsmcgraw yep! Let us know if you run into snags
13:56 drawsmcgraw Even better, let us know if/how it works out!
13:57 mage_ yep!
14:00 Guest73 joined #salt
14:00 stevednd joined #salt
14:02 haam3r_ joined #salt
14:02 om2 joined #salt
14:03 GnuLxUsr joined #salt
14:10 DammitJim joined #salt
14:10 haam3r_ joined #salt
14:17 haam3r_ joined #salt
14:17 cgiroua joined #salt
14:27 mavhq joined #salt
14:34 doubletwist joined #salt
14:38 doubletwist So I'm not familiar with the salt release process. When might I expect to see this issue actually available in a release update? https://github.com/saltstack/salt/pull/42411
14:38 doubletwist s/issue/fix
14:40 zerocoolback joined #salt
14:41 doubletwist I see it's labeled 2017.7.1 - and I see release notes for 2017.7.1, though I don't see that issue/pull request referenced and of course I don't see that version available in the repo yet.
14:52 zerocoolback joined #salt
14:56 bildz anyone have a quick second to help me validate a conditional statement that isnt working?  It's possible that I cannot do what it is I'd like to perform
14:59 coredumb bildz: it's not creating lockfile2 ?
14:59 bildz it's not
14:59 bildz :/
14:59 coredumb remove the single quotes around {{ lockfile }}
15:00 bildz https://pastebin.com/yKud5qjv
15:00 bildz k
15:00 coredumb althought that's the first thing that comes to my mind
15:00 coredumb * may not be right*
15:00 bildz https://pastebin.com/83bzDy46
15:01 bildz yeah it's syntax erroring
15:01 coredumb not sure on the correctness of the function call
15:01 coredumb ok then sorry :D
15:01 bildz no worries I appreciate the assistance
15:01 bildz i know that {{ }} is a print statement
15:01 coredumb oh yeah
15:01 coredumb remove {{ }}
15:01 coredumb my bad I didn't see that
15:02 coredumb {% if salt['file.file_exists'](lockfile) %}
15:02 coredumb {{ }} is to be used outside of jinja {% %} blocks
15:02 coredumb inside only the variable is to be used
15:02 bildz that did it man
15:02 bildz thank you \o/
15:03 coredumb «o/
15:03 coredumb \o/
15:05 Nahual joined #salt
15:27 kiorky joined #salt
15:37 drawsmcgraw left #salt
15:41 cswang joined #salt
15:43 Inveracity joined #salt
15:44 evle1 joined #salt
15:44 tapoxi joined #salt
15:46 pualj joined #salt
16:08 tiwula joined #salt
16:09 onlyanegg joined #salt
16:10 pualj_ joined #salt
16:15 noobiedubie joined #salt
16:26 pualj joined #salt
16:26 pbandark1 joined #salt
16:33 svij2 joined #salt
16:33 edrocks joined #salt
16:36 http_GK1wmSU joined #salt
16:37 Miouge joined #salt
16:38 http_GK1wmSU left #salt
16:39 pualj_ joined #salt
16:43 svij2 joined #salt
16:43 drawsmcgraw joined #salt
16:45 mikecmpbll joined #salt
16:51 stevednd is it possible to send an event to master from within a reactor file?
16:53 whytewolf stevednd: https://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.event.html#salt.runners.event.send
16:53 whytewolf yes
16:57 whytewolf doubletwist: release notes are the first thing generated. they kind of get automaticly generated [generally shortly after the last release.] it isn't until it is tagged in github that it is getting close to release. hopefully 2017.7.1 will be tagged soon.
17:00 doubletwist whytewolf: thanks. For now I was able to manually make the change [fairly simple change] on my 3 clients I'm using as a proof of concept.
17:00 woodtablet joined #salt
17:00 stevednd whytewolf: thanks. Also, when specifying a prefixed command in the reactor with local. is it just then followed by any available module?
17:02 whytewolf stevednd: local.module.function refers to modules on a minion. for a runner it actually is runner.module.function
17:05 whytewolf oh you asked about cmd. [command] which is just a backward compatible alias of local
17:07 stevednd whytewolf: right, that's what I had meant. So basically something like local.elasticsearch.cluster_stats, or runner.manage.bootstrap are both valid(with appropriate args of course) in a reactor file?
17:07 whytewolf yeap
17:09 stevednd do you, or anyone else for that matter know if salt has the ability to A) run a command on only one minion of a group B) run a command with a specific batch size every x seconds?
17:09 astronouth7303 A, yes, B, trickier
17:09 cliluw joined #salt
17:10 astronouth7303 stevednd: the basic problem with B is that the master doesn't select nodes, it just broadcasts the command and nodes select themselves
17:10 whytewolf https://docs.saltstack.com/en/latest/topics/targeting/batch.html
17:10 astronouth7303 so B would require the client to pre-flight check what minions would be of interest and then choose specific ones
17:11 pualj joined #salt
17:11 astronouth7303 nvm, i'm full of it and should just let whytewolf talk
17:12 stevednd astronouth7303:  np, I appreciate the help. What is the flag or arg for A?
17:12 whytewolf i will admit i have no idea how batch actually does what it does
17:13 stevednd whytewolf: is that flag available programatically, like inside an orchestration file?
17:13 astronouth7303 just give it the minion name
17:14 whytewolf stevednd: orchestrations saltmod does have it for some of it's functions. i know salt.state has had it for a long time. i see references to it now in salt.function
17:14 stevednd astronouth7303: I'm talking about a task in which I only want to run on one machine in a group. I don't care which machine. Just one of them needs to execute the task. I don't want to hardcode a specific minion
17:14 whytewolf orchestration is 90% use of https://docs.saltstack.com/en/latest/ref/states/all/salt.states.saltmod.html
17:17 whytewolf humm, stevednd i know that functionally was talked about i don't know if it was ever added.
17:17 stevednd yeah, I've seen the option to batch in there. Are you seeing a way to make the batch wait? I don't see that option
17:17 stevednd I don't think batch wait is in there yet if this issue is any indication: https://github.com/saltstack/salt/issues/41432
17:18 astronouth7303 https://docs.saltstack.com/en/latest/topics/targeting/batch.html has a flag to wait between batches
17:18 astronouth7303 and i think `salt` will wait for all the minions to complete or timeout (by default)
17:18 whytewolf yeah orchestration doesn't have a batch-wait yet.
17:19 whytewolf astronouth7303: basicly he wants a way for the orchestration to pause a select time between the batch runs. the command line option doesn't help with that inside of orchestration
17:19 astronouth7303 ah, yeah
17:21 stevednd it's been two years since I heavily worked on my salt scripts. I'm assuming there's still no way to access the `salt` module dict when templating an orchestration file?
17:23 stevednd basically I'm wondering if I could get a list of minions in a group using mine or something, then template the orch file by iterating over each one, and calling runner.test.sleep after each one
17:23 whytewolf well no clean way. in a master based setup [you can run salt if you are masterless though since orchestration can run on a masterless minion now]
17:23 stevednd but if I remember correctly from before, there's no way to get at the mine inside of the jinja templating in an orch file
17:23 whytewolf however there is the mine runner
17:24 whytewolf see the "see also" on the end of mine.get
17:24 whytewolf https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.mine.html#salt.modules.mine.get
17:25 whytewolf that works in pillar and orchestration for grabbing mine data
17:25 stevednd oh my
17:25 jimklo joined #salt
17:26 stevednd I do believe I can kluge something together with this
17:26 jimklo left #salt
17:26 stevednd any idea what verson that became available in?
17:27 stevednd the runner docs indicate updating the mine became available in 2017.7
17:27 stevednd doesn't say for the get function though
17:29 stevednd looks like it's been in there forever. maybe it just wasn't thought of at the time when I was last working on this
17:31 whytewolf mine.get runner function was there in about 2014.x i want to say. but didn't become usful for jinja will the saltutil.runner function was fixed.
17:31 whytewolf which happened in 2015.x
17:32 seanz joined #salt
17:33 woodtablet i have a question about salt masters with salt cloud.. if a salt master builds a new minion via salt cloud, it creates a new minion key it looks like for this new minion, but when the minion actually comes up it has a different salt key and immediately gets denied. my question is, why does the salt master make a key for the minion ?
17:33 fritz09 joined #salt
17:34 whytewolf woodtablet: humm, sounds like your image you are using has salt already installed on it
17:34 woodtablet nope
17:34 woodtablet oh
17:34 woodtablet but you could be right
17:34 woodtablet about a salt key being deployed
17:34 woodtablet one sec
17:36 woodtablet hmm.. it doesnt look like it
17:36 stevednd whytewolf:  that's probably the case then.
17:36 whytewolf basicly salt-cloud makes a key because it transfers that key over during the bootstrap step. before it starts the minion software
17:36 stevednd thanks for the help
17:36 whytewolf stevednd: no problem :)
17:37 nixjdm joined #salt
17:37 woodtablet the keys are different sizes too, the one on the master is is 799, but the one in the denied folder is 450
17:37 woodtablet so is the master supposed to copy the key to the minion ?
17:37 whytewolf salt-cloud is
17:38 whytewolf as part of bootstrap
17:39 woodtablet ahh, let me go read that script then, thanks =D
17:40 whytewolf you might need to look into parts of saltify also
17:40 whytewolf [which is a part of salt-cloud]
17:40 woodtablet whytewolf: ahh i was about to ask lol
17:45 wendall911 joined #salt
17:56 pualj_ joined #salt
17:59 mikecmpbll joined #salt
18:00 Heartsbane joined #salt
18:00 Heartsbane joined #salt
18:05 fritz09 joined #salt
18:13 woodtablet i want to specify the version of salt to install, so i am trying to pass this to salt cloud but getting errors. salt-cloud --script-args= stable 2016.11.6 -p PROFILE Name-of-box
18:13 woodtablet but i am getting errors
18:13 woodtablet > like [ERROR   ] stable already exists under my-ec2-uswest2b-rh_aws-private-ips:ec2
18:13 DarkKnightCZ joined #salt
18:15 whytewolf might need quotes around stable 2016.11.6
18:17 woodtablet whytewolf:  yep, you got it. i had to remove stable 2016.11.6, and just replaced it with "2016.11.6"
18:18 woodtablet whytewolf: thanks!
18:20 edrocks joined #salt
18:22 DarkKnightCZ joined #salt
18:23 om2 joined #salt
18:25 rewbycraft joined #salt
18:41 DarkKnightCZ joined #salt
18:52 nixjdm joined #salt
18:53 KingJ joined #salt
18:56 simon_c joined #salt
18:59 gmoro joined #salt
18:59 pualj joined #salt
19:01 KingJ joined #salt
19:04 noobiedubie joined #salt
19:16 simon_c left #salt
19:20 pualj joined #salt
19:21 svij2 joined #salt
19:28 om2 joined #salt
19:36 noraatepernos joined #salt
19:43 Hybrid joined #salt
19:43 monjwf_ joined #salt
19:52 nixjdm joined #salt
19:56 monjwf joined #salt
19:58 ChubYann joined #salt
20:08 jholtom joined #salt
20:13 edrocks joined #salt
20:20 sarcasticadmin joined #salt
20:26 hax404 joined #salt
20:27 monjwf_ joined #salt
20:30 blueelvis joined #salt
20:35 edrocks joined #salt
20:39 tiwula joined #salt
20:52 nixjdm joined #salt
21:06 socket-_ Can anyone help me figure out why this is failing. http://apaste.info/XQV5 if i call pkg.install from the module it works, but when i use the state pkg.installed it fails to find the version.
21:13 Neighbour socket-: Don't use 'pkgs:' on line 5
21:15 socket-_ so just pkg.installed:
21:16 socket-_ - winzip:
21:16 socket-_ -version?
21:17 hatifnatt - name: winzip
21:17 hatifnatt - version: ver
21:18 whytewolf https://gist.github.com/whytewolf/427c4d477333da77c2fe7f367c3fb7cc
21:18 whytewolf either of those
21:19 whytewolf after all you are not trying to install a packed named version
21:21 hatifnatt Is there a good way to merge dictionaries like pillar.get(key, default=default.var, merge=True)? I need to merge in defaults but I can't do it at "pillar.get" stage.
21:22 whytewolf https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.pillar.html#salt.modules.pillar.filter_by
21:22 whytewolf which works rather like grains.filter_by
21:23 XenophonF left #salt
21:24 whytewolf not the easyiest function to work with. but it is used for merging defaults [based on a filter] with a merge
21:28 hatifnatt whytewolf: I'm rotating through items from pillar. So I only have variables containig dict data. And also pillar.filter_by "New in version 2017.7.0."
21:32 whytewolf c=b.copy() & a.update(c)
21:32 whytewolf ?
21:32 whytewolf not 100% sure that will work in jinja
21:32 whytewolf untested.
21:35 hatifnatt whytewolf: Thanks I will try.
21:36 whytewolf also not sure how complex your dicts are.
21:39 onlyanegg joined #salt
21:41 hatifnatt whytewolf: not too complex
21:42 hatifnatt {%- set a = defaults.copy() %}
21:42 hatifnatt {%- do a.update(dict_var) %}
21:42 hatifnatt Working fine.
21:43 whytewolf nice
21:46 hatifnatt It's definitely more python question, but I thought may be salt / jinja have something special for this task.
21:46 whytewolf not a direct merge tool no, more of a filter based tool. the pillar.filter_by might be new in 2017 but the grains.filter_by has been there a long time.
21:52 nixjdm joined #salt
21:54 carlwgeorge does dmurphy or anyone on the packaging team hang out in here?
21:54 viq carlwgeorge: is this a survey? ;)
21:55 carlwgeorge nope, just hoping to get eyes on an issue with the Fedora salt package https://bugzilla.redhat.com/show_bug.cgi?id=1478593
21:55 hax404 joined #salt
21:56 viq (which is my response to "does anyone know X" questions. Now that you provided the real question - thank you! - I go back to lurking, or rather not being here ;) )
21:56 whytewolf is there an issue on https://github.com/saltstack/salt-pack pointing to that issue?
21:57 carlwgeorge whytewolf: salt-pack doesn't have the fedora 26 spec file, that only lives in fedora's git
22:00 whytewolf ahhh. nothing like splitting repos to drive someone crazy
22:00 _KaszpiR_ joined #salt
22:01 whytewolf also that update should be made to the redhat/centos spec files as they will most likely move to dnf at some point
22:01 whytewolf might as well get ahead of the curve
22:02 carlwgeorge that is factually correct
22:03 hax404 joined #salt
22:04 pualj joined #salt
22:04 hax404 joined #salt
22:07 hax404 joined #salt
22:07 socket-_ Neighbour: I tried the synatx you mentioned, but i still get an error. https://apaste.info/kFcF  any ideas why this is happening?
22:11 hax404 joined #salt
22:11 whytewolf ... that .... doesn't look right. options should be a dict not a str
22:12 whytewolf what version are you on?
22:12 whytewolf [minion]
22:12 hax404 joined #salt
22:12 wendall911 joined #salt
22:13 wendall9111 joined #salt
22:14 socket-_ 2017-07 something lemme check
22:14 whytewolf 2017.7.0
22:14 socket-_ yeah 2017.7.0(py3)
22:16 socket-_ I switched to: https://apaste.info/NjD7 which was Neighbour's 2nd method mentioned, and that worked.
22:16 whytewolf both should work
22:16 whytewolf i need to see why pkgs didn't
22:17 socket-_ k
22:23 whytewolf humm, looks like win_pkg has trouble parsing the pkgs style info possibly if there is only one package listed in pkgs
22:23 whytewolf but ala report
22:23 seanz joined #salt
22:23 whytewolf bug*
22:30 tapoxi joined #salt
22:32 socket-_ k, i put one in. Thanks for the help.
22:44 noraatepernos joined #salt
22:44 Tgrv joined #salt
22:46 KingJ_ joined #salt
22:48 KingJ joined #salt
22:52 nixjdm joined #salt
22:55 hatifnatt whytewolf: there is a problem with a.update(dict_var), if defaults have some key, but dict_var doesn't have it - resulting dictionary after update() will not have that key.
22:55 hatifnatt So it's more like replace, than merge.
22:57 whytewolf well, sub keys that should the case as there isn't a true merge in python
22:58 whytewolf if you want something more complex you will have to write a more complex setup and add it as a salt module and call that
22:58 Neighbour or just rip the merging code out of pillar.stack and use that :)
22:58 whytewolf eh the merging code there doesn't work on to deep of level either sometimes
22:59 Neighbour Do you have an example of this I could test with?
23:00 hatifnatt whytewolf: one minute.
23:06 hax404 joined #salt
23:10 hatifnatt whytewolf: https://gist.github.com/hatifnatt/099dcbff9dc753fa05b09ba7242aae93
23:10 chowmeined joined #salt
23:12 whytewolf okay, yeah. you need to write a more complex merge tool. for the sharedcmd section to be merged. with the update method it will replace one sharedcmd with the one from the other.
23:15 whytewolf let me see if i can find a cleaner way
23:18 hatifnatt Doh, too complex for me, at least for 2 am :)
23:20 edrocks joined #salt
23:30 Hybrid joined #salt
23:34 hatifnatt Hmm, I'm curious is it possible to call salt.utils from state?
23:34 whytewolf no
23:35 hatifnatt There is what I need https://github.com/saltstack/salt/blob/develop/salt/utils/dictupdate.py
23:37 whytewolf https://gist.github.com/whytewolf/7a113e8a748bb150aa6c97bb35df9929
23:38 whytewolf opps. sorry stripped the slspath part. my testing script doesn't set that salt var so i had to strip it for my testing
23:39 hatifnatt It's not a problem :) I have noticed that change.
23:40 whytewolf opps, and i forgot a level in the returned pillar.
23:40 whytewolf that should be user['userconf']
23:41 edrocks joined #salt
23:48 hatifnatt whytewolf: It's working. But I still need to better understand how :)
23:50 whytewolf normally grains.filter_by will filter on the dict that is setup at that first item, [in this case defaults], and selects a dict with in. but the default setting says if grains value is not able to select a dict key used the default key. and then merge merges what ever is selected with the contents of merge
23:51 whytewolf basicly we are skipping the grains filtering part of it and using the merge part
23:54 Hybrid joined #salt
23:57 hatifnatt whytewolf: Thanks. Although I still need to better sort it all out.

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