Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2015-08-17

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

All times shown according to UTC.

Time Nick Message
00:11 catpig joined #salt
00:24 claytron_ joined #salt
00:38 Aidin joined #salt
00:40 dthom91 joined #salt
00:48 edrocks joined #salt
00:57 mvensky joined #salt
01:06 ITChap joined #salt
01:18 ajw0100_ joined #salt
01:19 viq joined #salt
01:22 favadi joined #salt
01:27 claytron_ joined #salt
01:47 TronPaul_ joined #salt
02:01 al joined #salt
02:13 claytron_ joined #salt
02:19 pppingme joined #salt
02:21 TronPaul_ I'm having a multi-env pillar issue https://gist.github.com/TronPaul/4df07b105e97d543d9a8
02:23 TronPaul_ this is on 2015.8. I've been debugging all night, but I can't seem to figure out why it won't pick up the file from my second ext_pillar location
02:23 TronPaul_ it even caches the file, but it returns nothing
02:36 mosen joined #salt
02:38 evle joined #salt
02:41 mapu joined #salt
02:43 Furao joined #salt
02:44 jeadr joined #salt
02:45 zwi joined #salt
02:48 viq joined #salt
02:53 Furao joined #salt
03:10 al joined #salt
03:17 claytron_ joined #salt
03:18 jeadr joined #salt
03:38 snaggleb joined #salt
03:45 claytron_ joined #salt
03:49 jeadr joined #salt
03:51 ChesFTC joined #salt
03:57 ajw0100 joined #salt
03:58 ChesFTC left #salt
03:58 zer0def joined #salt
03:59 ITChap joined #salt
04:00 jeadr joined #salt
04:22 writtenoff joined #salt
04:25 ramteid joined #salt
04:28 claytron_ joined #salt
04:33 jeadr joined #salt
04:39 jalbretsen joined #salt
04:55 jeadr joined #salt
04:57 Fiber^ joined #salt
05:02 hasues joined #salt
05:03 hasues left #salt
05:07 rdas joined #salt
05:08 rkramerbsd joined #salt
05:09 rkramerbsd Hi all
05:09 rkramerbsd I have problems here, related to my FreeBSD repository. Can't fetch, downlaod, install any package
05:10 catpigger joined #salt
05:11 rkramerbsd message I receive, whenever I try to install any package by pkg install FreeBSD command:
05:13 claytron_ joined #salt
05:14 rkramerbsd pkg: Error parsing: /etc/pkg/FreeBSD.conf: error while parsing /etc/pkg/FreeBSD.conf: line: 11 column: 43  'delimiter is missing' , character 'l'
05:15 rkramerbsd No active remote repositories configured
05:15 rkramerbsd hope anyone can help me with this issue
05:17 TyrfingMjolnir joined #salt
05:21 llua does it happen when you use pkg(8) normally on that system?
05:21 llua ah, too slow.
05:30 calvinh joined #salt
05:53 TyrfingMjolnir joined #salt
05:54 favadi joined #salt
05:59 claytron_ joined #salt
06:05 colttt joined #salt
06:14 revellion joined #salt
06:15 revellion Hello. Can anyone here give me a hint or throw me in the right direction on a problem i have with a salt state and jinja?.
06:16 revellion I have googled and read the documentation to my end. The case i'm trying to solve is to grab one of the items out of a salt['network.default_route'] module call. Particularly the gateway IP. But my lack of jinja-skills got me a bit of gray hair.
06:17 revellion closest i've gotten so far is  to use .iteritems but i only wanna grab a key or two out of it at most.
06:17 malinoff joined #salt
06:19 favadi can you post the return data of network.default_route?
06:20 AndreasLutro joined #salt
06:22 dopesong joined #salt
06:25 katyucha joined #salt
06:26 revellion saltminion:
06:26 revellion |_
06:26 revellion ----------
06:26 revellion addr_family:
06:26 revellion inet
06:27 revellion destination:
06:27 revellion 0.0.0.0
06:27 revellion flags:
06:27 revellion UG
06:27 revellion gateway:
06:27 revellion 10.17.200.253
06:27 revellion interface:
06:27 revellion eth0
06:27 revellion netmask:
06:27 revellion 0.0.0.0
06:28 whytewolf yikes, please use gist if posting something that long
06:28 revellion whytewolf: sorry, my bad. should've pastebined or equal in retrospect.
06:29 whytewolf if you set that into a variable you can use <variablename>[0]['gateway'] to get the result
06:30 whytewolf https://gist.github.com/whytewolf/d640e88cf2d9725552c9 kinda like that
06:31 bluenemo joined #salt
06:31 whytewolf won't work with ipv6 of coarse since there is multiple gateways
06:38 whytewolf just updated that gist
06:38 whytewolf with another way
06:40 illern joined #salt
06:43 claytron_ joined #salt
06:55 fredvd joined #salt
06:56 jeadr joined #salt
06:57 Ztyx joined #salt
07:00 revellion whytewolf: aaah, thanks for the tow out of the mud for me :)
07:01 revellion whytewolf: i imagined some kind of 2-stage for it but i got stuck on the possibility to use 1 single statement for it. But the 2 stager i could break apart the array to feed other grains in the state.
07:01 revellion whytewolf: kudos to you :)
07:02 SVQTQ joined #salt
07:02 harkx joined #salt
07:04 kawa2014 joined #salt
07:07 KermitTheFragger joined #salt
07:13 absreality joined #salt
07:28 lb1a joined #salt
07:29 edrocks joined #salt
07:33 linjan_ joined #salt
07:35 ljt joined #salt
07:45 gcfhvjbkn joined #salt
07:48 markm joined #salt
07:51 raakesh joined #salt
08:02 ITChap Hi everyone
08:02 ITChap I get: https://bpaste.net/show/3886d0abd52a all time on my master
08:02 ITChap that's very weird
08:03 ITChap I have less than 25 minions
08:03 ITChap my master has 8 cores and 4GB of RAM and I use the default worker setting
08:03 ITChap do you have any idea ?
08:06 Flusher joined #salt
08:10 babilen Which version of salt? (paste "salt --versions-report" to one of http://refheap.com, http://paste.debian.net, https://gist.github.com, http://sprunge.us, http://dpaste.de, …)
08:11 s_kunk joined #salt
08:13 malinoff joined #salt
08:17 GreatSnoopy joined #salt
08:19 Grokzen joined #salt
08:20 Xevian joined #salt
08:20 ITChap https://bpaste.net/show/4b45ac671596
08:21 MadsRC How does salt do shceduling? If I set 2 minions to have a 30 minute schedule to run highstate, and I restart 1 minion after 15 minutes, will they still run highstate on the same time (Like they would if you used cron) or is it 30 minutes from the minion started?
08:24 ITChap babilen: looks like some of my pillars had errors and couldn't compile
08:25 babilen Bad pillars!
08:25 ITChap my bad :D
08:26 N-Mi joined #salt
08:29 claytron_ joined #salt
08:30 BigBear joined #salt
08:33 quasiben1 joined #salt
08:36 kukacz joined #salt
08:37 denys joined #salt
08:39 dopesong_ joined #salt
08:41 krak3n` joined #salt
08:44 jeadr joined #salt
08:46 yomilk joined #salt
09:10 MadsRC To answer my own question, the time set on a schedule is from the when the daemon started and not like cron (where 5 minutes would be 00, 05, 10 etc)
09:12 claytron_ joined #salt
09:13 evle Is vmware cloud module anywhere near stable?
09:13 bitc01d joined #salt
09:16 ljt joined #salt
09:17 evle I'm getting this on latest git: https://bpaste.net/show/dfc2f226ee92
09:17 kbyrne joined #salt
09:31 fredvd joined #salt
09:33 TyrfingMjolnir joined #salt
09:34 seenae joined #salt
09:34 seenae Hey Guys I am writing a grains module
09:34 seenae The script is working fine  outside
09:35 seenae However when I am adding as a grains module I am getting ImportError: No module named boto.ec2
09:35 seenae Looks like module is not available with salt ?
09:40 Furao you need to install boto in root $PYTHONMODULES
09:40 Furao https://github.com/bclermont/states/blob/master/_grains/ec2_info.py for a version of your script that don’t need boto (I guess what you’re trying to do)
09:41 TyrfingMjolnir joined #salt
09:43 wnkz joined #salt
09:59 claytron_ joined #salt
10:04 denys joined #salt
10:06 nika_ joined #salt
10:12 Aidin joined #salt
10:12 Nika__ joined #salt
10:18 Nika__ joined #salt
10:18 Nika__ Hi
10:19 thefish joined #salt
10:20 Nika__ joined #salt
10:20 Nika__ Hi
10:23 Nika_ joined #salt
10:23 thefish can anyone help with this please? I'm trying to set up zabbix (monitoring) with salt, it will be used with salt-minion as well as salt-ssh. I need to set up zabbix proxies and clients to point to the right proxy or server, based on their region. There is no name that can determine region, and with salt-ssh I dont seem to be able to persist custom grains - i was wondering about setting grains in a state, so have a state for region A, set a grain for th
10:23 Nika_ hi
10:23 kukacz_ joined #salt
10:23 Nika_ joined #salt
10:23 Nika_ hi
10:24 giantlock joined #salt
10:26 Tiriel joined #salt
10:27 Tiriel Hi, I'm wondering what's the preferred way to target two different minions within a state while using roles
10:29 Tiriel For example, let's say I'm deploying a webservice and a reverse proxy, and each component goes on a different minion
10:30 Tiriel what I want to do is target the minion with the webserver role and deploy the webservice, but then the webservice state figures that it needs to configure the reverse proxy somewhere else
10:30 Tiriel Am I making sense?
10:31 thefish Tiriel: I'd have a state for each of those, target them in the top file and then just get them to highstate - maybe you can look at orchestration if you need them to be timed. (but I'm no salt expert!)
10:32 calvinh joined #salt
10:33 dopesong joined #salt
10:35 Tiriel The thing is that because of the way we do deployments, we don't use highstate (don't ask), so we're looking for a way, if it exists, to do something like salt 'webserver' state.sls webservice and get both the webservice and the proxy deployed
10:36 Tiriel This may not be possible while using that targeting, come to think of it
10:37 calvinh_ joined #salt
10:37 kukacz joined #salt
10:39 AndreasLutro Tiriel: maybe you could use reactors, and re-configure the reverse proxy when a webserver-related event fires
10:40 kukacz joined #salt
10:41 Tiriel AndreasLutro: Interesting, I'll read about reactors, see if that does what I want. Thanks
10:44 claytron_ joined #salt
10:45 CeBe joined #salt
10:50 Aidin joined #salt
11:01 aurynn Tiriel, yea, you want reactors or the orchestrator
11:12 giantlock joined #salt
11:13 Aidin joined #salt
11:20 mschiff It seem I am having a bit of trouble with properly terminating a "- contents: |" Block ....
11:21 mschiff I am getting error messages like "... contains multiple state declarations of the same type" when "- contents:|" ist the last list item for a file managed state
11:21 AndreasLutro mschiff: care to share the state in a gist or similar?
11:21 mschiff AndreasLutro: lets see.. mompl
11:22 evle joined #salt
11:23 sakaYK joined #salt
11:24 mschiff AndreasLutro: http://pastebin.com/dZyGfikD
11:24 BigBear joined #salt
11:24 williamthekid joined #salt
11:25 AndreasLutro looks like you're missing a space on the first line after the |
11:25 AndreasLutro indentation is extremely important in yaml
11:25 aqua^c joined #salt
11:25 mschiff AndreasLutro: no, thats a paste error, look at the "source" of the paste ;-/
11:25 AndreasLutro oh I see :)
11:25 mschiff or an error how the paste is displayed in the browser...
11:26 AndreasLutro well, your error is probably elsewhere
11:26 AndreasLutro the "contains multiple state declarations of the same type" error usually means you have a single state ID with multiple states of the same type
11:28 claytron_ joined #salt
11:29 mschiff AndreasLutro: yes, but when I comment the second state you see in the paste it works...
11:31 AndreasLutro hmm. could be that jinja is messing up the formatting of the yaml file but hard to tell
11:31 AndreasLutro btw {% set _dummy = ... %} can be replaced  with {% do ... %}
11:32 mschiff AndreasLutro: do... thanks for the hint!
11:32 ITChap joined #salt
11:33 nyx_ joined #salt
11:36 seenae Guys I have my s3 credentials in pillar data
11:37 seenae I have a working state module where I am retrieving the pilllar data using def homedir(name):  key_id=__salt__['pillar.get']('s3:keyid')  key_val=__salt__['pillar.get']('s3:key')
11:37 seenae the above code
11:37 seenae But now I am trying to use the similar method in grains module that is
11:38 jeadr joined #salt
11:38 seenae creds['access_key']=salt['pillar.get']('s3:keyid')     creds['secret_key']=salt['pillar.get']('s3:key')
11:39 AndreasLutro grains are loaded before pillars
11:39 AndreasLutro so you can't use pillars in grains
11:39 seenae AndreasLutro: Oh ok
11:39 seenae AndreasLutro: Thanks
11:42 yomilk joined #salt
11:46 giantlock joined #salt
11:54 jeadr joined #salt
11:55 funzo joined #salt
12:12 wnkz joined #salt
12:13 claytron_ joined #salt
12:17 lothiraldan joined #salt
12:19 ljt joined #salt
12:19 CeBe joined #salt
12:23 mschiff when doing something like this "{% set somefiles = salt.cmd.run('find /foo') %}"... is there an easy way to make somefiles a dict with each element being a line of output?
12:25 revellion the require_reboot kwarg in network.system. What does it actually accomplish?. I've been searching through the source-code and have yet to find an answer. I'm currently looking at using to apply some network configuration changes a bit "softly" and to have the configs changed merely and to for them to take effect on reboot (in this case after the kickstart is done)
12:26 revellion Any help is highly appreciated. Since it seems like a fairly distro-neutral way to work with the network config using network.managed and network.system instead of doing some ugliness with distro-specific file.managed on the network config files themselves.
12:26 roger_ joined #salt
12:29 roger_ Greetings, is it possible to automatically execute highstate on a specified host group sequentially?
12:29 icflournoy joined #salt
12:29 dyasny joined #salt
12:31 daemonkeeper How could jinja_trim_blocks: True ever break a state like this: http://paste.debian.net/295427/   (Rendering SLS my.state.users failed, render error: expected '<document start>', but found '<block mapping start>')
12:31 DanyC joined #salt
12:31 revellion roger_: looked into the -b (batch mode) flag?. Might be able to set it to -b 1 or so to cause that?, Disclaimer: not entirely sure on the answer.
12:32 revellion roger_: -b 1 if my logic works right it should run the highstate on the hosts in batch mode with 1 host at a time
12:32 revellion roger_: rather than lets say -b 10 which would cause it to run it on 10 hosts at a time
12:32 David_B55 joined #salt
12:33 DanyC hi all, i'm going to start playing wiht reactors, any idea how i can find a list of events which are going to be fired by minions? In doc it mention about "which watches for minion_start events, which each minion fires when it first starts up and connects to the master." but doesn't mention how i can get all events type
12:34 DanyC basically is all down to "All minions that attempte to authenticate will match the tag of salt/auth" how do i get a list of this tags so i know what to stick into reactor.conf
12:38 subsignal joined #salt
12:38 DanyC I'm aware of the eventlist.py script but thought is an easy way of doing it?
12:40 roger_ revellion: Thanks for the answer. Is it also possible to configure that somewhere beforehand? It's quite a pity if I update a database cluster parallel. After they restart on the same time, it's not possible for the cluster to reconnect itself with all nodes. So that would be a nice feature.
12:40 Tiriel Another question. I have several states that modify very similar files, how can I extract this to avoid duplication?
12:40 the_lalelu DanyC: there is also a runner "state.event"
12:41 DanyC or the alternative is to use "salt-run state.event pretty=True" but then i'd like to see a full list of events
12:41 Tiriel Example, I have states A, B, C, which modify /etc/system/A/file.conf /etc/system/B/file.conf /etc/system/C/file.conf
12:42 the_lalelu DanyC: state.event takes a tagmatch kwarg and if that kwarg is "*" then you will see all events iirc
12:42 Tiriel I'd rather just have a common.sls file that manages file /etc/system/{{ var }}/file.conf and reuse that
12:43 Tiriel But I'm having problems setting the {{ var }} value
12:43 AndreasLutro Tiriel: {% for var in ['A', 'B', 'C'] %} maybe?
12:44 Tiriel no, these are independent states that happen to share tasks
12:45 Tiriel i.e. they do similar things but are not necessarily run at the same time
12:45 AndreasLutro then you're worse off, you can perhaps reduce duplication by having a jinja template that states A, B and C extend
12:45 AndreasLutro I do that for different types of nginx vhosts
12:45 DanyC the_lalelu: thanks but if i run what you said from master "salt-run state.event '*' " then what it does it will latch on the message bus and listen for events. What i'm looking after is to see dumped a list of all events w/o waiting for any activity
12:45 DanyC the_lalelu: have i misunderstood your reply ?
12:45 rodio_ua joined #salt
12:46 rodio_ua left #salt
12:47 icflournoy joined #salt
12:48 di5dude left #salt
12:48 DanyC the_lalelu: this is what i was looking after ;) http://docs.saltstack.com/en/latest/topics/event/master_events.html#event-master-events thx for your reply btw, appreciated !
12:49 the_lalelu DanyC: erm ... maybe i misunderstood you? ;)
12:49 the_lalelu DanyC: ah ok, you wanted a list of possible events?
12:49 DanyC the_lalelu: correct
12:50 DanyC the_lalelu: so i know what do i put in the reactor.conf when it says in the example "'salt/cloud/*/created':" and my internal reaction was "but i'm not using salt-cloud, what do i have to replace with" :) anyway we got to the bottom of it :)
12:51 daemonkeeper Can I let salt display the state file after rendering (YAML)?
12:51 daemonkeeper i.e. for states with jinja in it
12:53 BigBear joined #salt
12:54 pm90_ joined #salt
12:55 jeremyr joined #salt
12:55 Tiriel AndreasLutro: I managed using jinja includes instead of salt includes :S
12:57 claytron_ joined #salt
12:57 pm90__ joined #salt
12:58 babilen daemonkeeper: http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.state.html#salt.modules.state.show_sls
12:58 subsignal joined #salt
12:58 daemonkeeper thanks babilen!
12:59 babilen (also show_top and http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cp.html#salt.modules.cp.get_file )
12:59 harkx joined #salt
13:00 SVQTQ joined #salt
13:05 Furao joined #salt
13:07 scoates joined #salt
13:07 breakingmatter joined #salt
13:07 Furao joined #salt
13:07 Aidin joined #salt
13:09 lrojas joined #salt
13:10 kawa2014 joined #salt
13:11 DammitJim joined #salt
13:12 kawa2014 joined #salt
13:13 rdutch joined #salt
13:14 aqua^c joined #salt
13:14 drawsmcgraw joined #salt
13:17 XenophonF left #salt
13:18 racooper joined #salt
13:21 dthom91 joined #salt
13:23 cpowell joined #salt
13:23 ingslovak joined #salt
13:24 Deevolution joined #salt
13:25 che-arne joined #salt
13:26 funzo joined #salt
13:27 TronPaul_ can anyone help me with a multi-env pillar issue? https://gist.github.com/TronPaul/4df07b105e97d543d9a8
13:27 jdesilet joined #salt
13:28 calvinh_ joined #salt
13:28 mohae joined #salt
13:28 TronPaul_ I've done a lot of debugging but I can't seem to figure out why my non-base ext_pillar is being thrown out of pillar_roots halfway through `show_pillar`
13:30 keekz joined #salt
13:30 Avonis joined #salt
13:32 murrdoc joined #salt
13:34 dthom91 joined #salt
13:37 ksj joined #salt
13:38 murrdoc is file.contains a thing ?
13:38 murrdoc search
13:43 CeBe1 joined #salt
13:44 mapu joined #salt
13:44 ekristen joined #salt
13:47 hasues joined #salt
13:47 hasues left #salt
13:49 kawa2014 joined #salt
13:50 pravka joined #salt
13:50 sroegner joined #salt
13:53 DammitJim joined #salt
13:55 keekz joined #salt
13:59 sakaYK joined #salt
13:59 absreality left #salt
14:00 gcfhvjbkn joined #salt
14:01 otter768 joined #salt
14:06 tpaul joined #salt
14:07 tpaul I've just cloned a VM that already had a minion, how can I re-minion-ify this new VM?
14:07 Avonis left #salt
14:07 ThomasJ tpaul: remove /etc/minion_id and restart
14:08 ThomasJ restart salt-minion that is
14:09 tpaul ThomasJ: that's easy, thanks!
14:09 cachedout joined #salt
14:12 andrew_v joined #salt
14:12 Bryson joined #salt
14:13 Akhter joined #salt
14:15 pancakes9 joined #salt
14:15 pancakes9 Hi, I used the SaltStack Bootstrap script (curl -L https://bootstrap.saltstack.com -o install_salt.sh && sudo sh install_salt.sh -M -N -P -L) to install Salt 2015.5.3 (Lithium) on a master node but using 'salt-cloud' returns 'command not found'. The documentation says it should be included -- any idea why it's not?
14:23 DammitJim joined #salt
14:23 JoeJulian_ joined #salt
14:24 numkem joined #salt
14:24 teryx510 joined #salt
14:27 funzo joined #salt
14:28 kaptk2 joined #salt
14:29 nyx_ joined #salt
14:31 vandemar joined #salt
14:31 keekz joined #salt
14:38 twork i'm still cargo-culting from the bind formula. it's working; now i need to populated it with zones. we have many, so a pillar like the one in the example is going to be tedious and error-prone. i'm trying to come up with specific questions around this but so far, uh... guidance?
14:39 dthom91 joined #salt
14:39 twork difficulty: new to salt and templates, past DNS experience was limited to about two domains at a time. and long ago.
14:41 PredatorVI joined #salt
14:42 zerthimon joined #salt
14:42 lothiraldan joined #salt
14:44 jeadr joined #salt
14:47 Jimmy_Rustler joined #salt
14:49 mschiff http://docs.saltstack.com/en/latest/ref/states/all/salt.states.smtp.html states, message swill be sent via XMPP? Is this a typo?
14:51 Furao joined #salt
14:52 adelcast left #salt
14:55 _JZ_ joined #salt
14:56 DanyC All, i just put this one in my reactor    /srv/reactor/startup_orchestration.sls startup_orchestrate:   runner.state.orchestrate:     - mod: orchestration.startup
14:57 jeadr joined #salt
14:57 malinoff joined #salt
14:58 DanyC and i can see through the event.state the errror https://bpaste.net/show/d7e28594a3a8
14:58 cachedout joined #salt
14:58 DanyC i guess i'm missing a param and trying to find it in the docs, no luck so far
15:02 supersheep joined #salt
15:03 funzo joined #salt
15:04 cpowell does anyone know of a good way to through an error in a state file?
15:04 cpowell specifically in jinja templateing in a state file
15:06 adelcast joined #salt
15:07 jalbretsen joined #salt
15:09 drawsmcgraw cpowell: Can you paste the error?
15:09 drawsmcgraw 9/10 times it's a syntax error in my experience.
15:09 cpowell I don't have an error, I want to create one :)
15:09 drawsmcgraw ah!
15:09 drawsmcgraw Then introduce a syntax error :D
15:09 drawsmcgraw oh! oh oh, okay
15:10 drawsmcgraw I read "good way to through and error" and thought you were asking how to troubleshoot an existing error
15:10 drawsmcgraw You want to *throw* an error in Jinja
15:10 cpowell yes
15:10 cpowell sorry, typo
15:10 drawsmcgraw Not that I'm aware of. Sorry :)
15:10 drawsmcgraw If you need that much logic, I'd recommend creating a custom module
15:11 drawsmcgraw cpowell: It's not as hard as it sounds: https://docs.saltstack.com/en/develop/ref/modules/index.html
15:11 drawsmcgraw In short - Write a file, foo.py, that contains a method 'bar'.
15:12 cpowell yeah, but not always needed. I am creating a contrived example now. I will paste in a few minutes.
15:12 drawsmcgraw fair enough
15:13 sdm24 joined #salt
15:14 DanyC anyone has any idea on the runner.state.orhcestrate issue ?
15:14 whytewolf DanyC: - mods : not - mod: http://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.state.html#salt.runners.state.orchestrate
15:14 mpanetta joined #salt
15:15 mpanetta joined #salt
15:16 DanyC whytewolf: and as usual you came and resuce my blindness ...i've been 2 times on that bloddy documentation (i guess the param didn't have a high / bold font already :) )
15:16 cpowell Here is an example: https://gist.github.com/powellchristoph/846b69bc39cd84ca5d5d
15:16 cpowell drawsmcgraw: ^
15:16 drawsmcgraw cpowell: thanks. Looking now
15:16 DanyC whytewolf: *rescue and ...yes thanks !
15:16 lothiraldan joined #salt
15:17 whytewolf DanyC: no problem
15:17 drawsmcgraw cpowell: I see now. And you'd want this in the return data for the job, right?
15:17 drawsmcgraw Just dumping it to the log file wouldn't be helpful?
15:18 cpowell I just want to throw some type of error that would cause the state to fail
15:18 cpowell preferably with some output included
15:18 cpowell could I call one of the salt errors directly in Jinja?
15:19 cpowell like the SaltRenderError
15:19 zer0def joined #salt
15:20 drawsmcgraw If you can, I'm not aware of it...
15:21 Brew joined #salt
15:21 drawsmcgraw cpowell: If you're running, say, a script or a command, you could use cmd.script() or cmd.run() with 'stateful: true'
15:21 drawsmcgraw Then the state could return a 'failed' value
15:22 drawsmcgraw which would cause that state to be seen as a failed state. And the (hypothetical) script would print something to stderr with an actual message.
15:22 drawsmcgraw But that's as close as I can think of.
15:22 cpowell yeah, that would work but its quite a hack
15:26 drawsmcgraw cpowell: I agree. It's not elegant
15:26 drawsmcgraw I've found that things seldom are, though :)
15:26 murrdoc http://i.imgur.com/eoF76hj.gifv
15:26 drawsmcgraw lol
15:27 pancakes9 Hi, I used the SaltStack Bootstrap script (curl -L https://bootstrap.saltstack.com -o install_salt.sh && sudo sh install_salt.sh -M -N -P -L) to install Salt 2015.5.3 (Lithium) on a master node but using 'salt-cloud' returns 'command not found'. The documentation says it should be included -- any idea why it's not?
15:29 Furao joined #salt
15:30 hasues joined #salt
15:31 hasues left #salt
15:32 BigBear joined #salt
15:33 denys joined #salt
15:34 dezertol joined #salt
15:35 rdutch pancakes9: I just did the same, used this: sh install_salt.sh -M -P -L git v2015.5.3, no problem. Keep in mind that the bootstrap salt-cloud install does not create the cloud folders under /etc/salt
15:35 denys joined #salt
15:35 pancakes9 rdutch: so do I just create them myself?
15:36 cpowell drawsmcgraw: https://github.com/saltstack/salt/issues/10723
15:36 saltstackbot [#10723]title: Controlled fail in state definitions | Hello, puppet has mechanism to deliberately fail if some conditions are not met (i.e. os_family is not supported) like:...
15:36 cpowell thats what I want
15:36 rdutch yes, but in order to test the salt-cloud command you dont need too
15:36 dezertol pancakes9: that's what I did and it worked fine
15:38 drawsmcgraw cpowell: Wow. Interesting. That would be really handy if it was pulled off
15:39 murrdoc cpowell:  test states
15:40 murrdoc saltstackbot help test state
15:41 XenophonF joined #salt
15:44 ageorgop joined #salt
15:44 dthom91 joined #salt
15:44 iggy cpowell: failhard + test.*
15:45 iggy !salt states.test
15:45 saltstackbot http://docs.saltstack.com/en/latest/ref/states/all/salt.states.test.html
15:47 Bryson joined #salt
15:48 PredatorVI I'm just starting to look into using salt.orchestrate and while the overall concept seems straight forward I am unsure how to handle multiple environments.  It seems that I'll have to create different orchestration scripts for each enviornment with just changes to the 'tgt' values.  Is there a different/betterway to use the same orchestration in different environments?
15:49 dezertol PredatorVI you should be doing all the env specific stuff in your pillars.
15:49 PredatorVI I do that.
15:50 PredatorVI But normally I'm targeting the proper minions via the salt call.
15:50 dezertol are you using the -C or just by name i.e. -L
15:51 jeadr joined #salt
15:51 XenophonF i wish salt-api supported oauth2 or something like that
15:52 murrdoc but it do
15:53 dthom91 joined #salt
15:53 PredatorVI So let's say I have a 3 node rabbitmq cluster.  in the 'dev' environment, the nodes would be 'myapp-dev01', 'myapp-dev02', 'myapp-dev03' with similar naming in the other 3 environments.  I would typically do `salt 'myapp-dev*` state.highstate`.  The 'dev' servers pull pillars for 'dev' and so on.  I now want the orchestrate to do the highstate on dev01 first, then dev0[2,3] which seems easy to do but the minion 'tgt' would be hard coded.
15:54 DammitJim joined #salt
15:55 _mel_ joined #salt
15:55 XenophonF murrdoc: salt-api supports oauth2? i don't see that among the current list of authentication backends
15:55 iggy PredatorVI: you can pass saltenv and extra pillar data to orchestrate... should be able to do what you want with that
15:55 murrdoc XenophonF:  but u can write it in ;)
15:55 PredatorVI iggy: ok, I'll look at that. Thanks.
15:56 XenophonF murrdoc: true. the pki backend might do what i want, but i'm not sure how to use it from my rest api client
15:58 whytewolf PredatorVI: basicly in pillar, tag the servers with a pillar item like role: rabbit-master and role:rabbit-slave then in orch tgt: 'role:rabbit-master' tgt_type: pillar and tgt: 'role:rabbit-slave' tgt_type: pillar
15:58 icflournoy joined #salt
15:58 rdutch left #salt
15:59 claytron_ joined #salt
15:59 aparsons joined #salt
16:00 PredatorVI whytewolf:  I do that today but I have a node called role:primary_rabbit in 'dev', 'acc', 'int', 'stage', and 'production' environments, but when I am doing the high state, only want to target minions in one environment at a time.
16:01 whytewolf salt-run state.orch <orch sls> saltenv=dev
16:02 supersheep joined #salt
16:02 rodio_ua joined #salt
16:02 otter768 joined #salt
16:02 rodio_ua left #salt
16:02 PredatorVI But I think that would apply the 'dev' pillar configuration to all nodes with the roles as defined.  the roles are not currently environment specific.
16:02 aparsons_ joined #salt
16:03 PredatorVI Maybe I'm doing roles wrong
16:03 dthom91 joined #salt
16:05 wendall911 joined #salt
16:06 isomarcte joined #salt
16:06 isomarcte What is the idomatic way to keep minons up to date, using salt?
16:07 wnkz_ joined #salt
16:07 AndreasLutro joined #salt
16:08 isomarcte Would it just be to add a cron job saying something like "salt-call pkg.upgrade"?
16:08 iggy kill it with fire and respin
16:09 XenophonF isomarcte: i wouldn't put pkg.upgrade into a cron job
16:10 XenophonF unless you can tolerate brokenness from minions updating out of sync
16:10 isomarcte XenophonF: So would the idomatic way be to just call pkg.upgrade from the master?
16:10 icflournoy joined #salt
16:10 tedski joined #salt
16:11 XenophonF yes, and update the master first, and only kick it off in concert with your release engineering/operations management practices
16:11 PredatorVI whytewolf:  We currently assign the roles to our minions in the 'base' environment.  All our state SLS files are also in the 'base' environment.  this is because we also use salt-formulas via GitFS and can't share the same Git Branch across multiple environments.  If we put the minion role assignments into specific environments, then they can't see the salt formulas.
16:11 favadi joined #salt
16:12 isomarcte I see
16:12 isomarcte XenophonF: Thanks
16:12 PredatorVI whytewolf: So currently only pillars are environment-specific.
16:13 jwokaty joined #salt
16:14 XenophonF hm, do i have to authenticate against the salt-master to kick off something in reactor...
16:16 PredatorVI whytewolf (et.al): I opened the issue https://github.com/saltstack/salt/issues/26309 to possibly address the sharing of gitfs_remotes but until then I will try to inject custom pillars via the command-line.
16:16 saltstackbot [#26309]title: Ability to map a shared gitfs_remote branch with multiple environments... | When using file_roots, if I have "shared' states to be included in multiple environments, I can repeat that file root:...
16:19 teryx510 joined #salt
16:20 * PredatorVI makes shameless plug for folks to vote on issue https://github.com/saltstack/salt/issues/26309
16:20 saltstackbot [#26309]title: Ability to map a shared gitfs_remote branch with multiple environments... | When using file_roots, if I have "shared' states to be included in multiple environments, I can repeat that file root:...
16:21 zsoftich2 joined #salt
16:22 kitplummer joined #salt
16:23 jeadr joined #salt
16:26 jwokaty is it possible to use pip3 rather than pip in salt formulas?
16:27 quique joined #salt
16:29 mattiasr joined #salt
16:29 rideh joined #salt
16:29 iggy yes
16:31 Gareth morning morning
16:33 jwokaty how can i do that? i didn't see a pip3 state or a parameter.
16:33 writtenoff joined #salt
16:33 tiadobatima joined #salt
16:34 ekristen joined #salt
16:34 iggy jwokaty: bin_env
16:35 iggy "or absolute path to a pip executable"
16:35 jwokaty ok, thanks, iggy
16:36 anotherZero joined #salt
16:38 adelcast1 joined #salt
16:39 adelcast1 left #salt
16:41 bmcorser joined #salt
16:43 Brew1 joined #salt
16:44 claytron_ joined #salt
16:48 DanyC PredatorVI: funny that is what i need to do with Rabbit and why i moved to Orchestrator ...glad i'm not the only one trying to come up wiht s'thing  ;)
16:48 icflournoy joined #salt
16:48 Smoked_Duck joined #salt
16:48 writtenoff joined #salt
16:49 PredatorVI DanyC: Awesome...do you have a working solution yet?
16:49 DanyC PredatorVI: if i had you think i wouldn't have shared it wiht you by now? ;)
16:49 PredatorVI Um...maybe ;)
16:49 linjan_ joined #salt
16:50 venu0336 joined #salt
16:51 DanyC all what is the best/ simple way to say - check if file is present, if it is, delete and then create a sym link?  Currently i'm going blind on just doing file.symlink: - target: /tmp/test . I'd prefer not to create 2 blocks : 1 for file.absent and 1 for file.symlink
16:52 KyleG joined #salt
16:52 KyleG joined #salt
16:53 DanyC i just need to use force: True ... lool :)
16:54 PredatorVI DanyC:  Is this related to your states to install RabbitMQ?  If so, I can send you my scripts.  I have them working (at least for my config).
16:54 PredatorVI I just don't have the orchestration part yet
16:56 DanyC PredatorVI: nope is part of Consul... Cause i'm using Consul for Service discover/ DNS and there was the problem i was looking at
16:57 PredatorVI ok
17:04 forrest joined #salt
17:06 jeddi joined #salt
17:11 whytewolf DanyC: file.symlink has a force option that will delete the symlink if it exists
17:12 dthom91 joined #salt
17:12 whytewolf !salt states.file.symlink
17:12 saltstackbot http://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.symlink
17:13 whytewolf oh wait. that does say "if the file is not a symlink
17:13 whytewolf still worth a try
17:14 lothiraldan joined #salt
17:17 lahwran joined #salt
17:18 breakingmatter joined #salt
17:19 TyrfingMjolnir joined #salt
17:20 DanyC whytewolf: it doesn't work .. hmm
17:20 dthom91 left #salt
17:20 DanyC :q!
17:21 phw joined #salt
17:21 phw How can I write a "file.managed" and a "file.directory" into the same statement?
17:25 Ryan_Lane scoates: depends on the public ip
17:25 dingo phw: you can share a state
17:25 dingo file_and_directory_state:
17:25 Ryan_Lane if you want your asg to have public IPs by default, that's possible
17:25 dingo file.managed:
17:25 dingo - name: is required (...)
17:25 dingo file.directory:
17:25 AndreasLutro dingo: you can't have two states of the same "type" in the same state ID
17:25 dingo - name: ALSO REQUIRED
17:25 scoates Ryan_Lane: looks to me like it's not possible via salt cloud + boto because it's missing from boto.
17:25 dingo OH yeah, that's right AndreasLutro, they're both 'file.'
17:25 dingo shucks
17:25 AndreasLutro for some reason
17:25 Ryan_Lane scoates: depends on what you're doing
17:26 dingo i learned that too
17:26 dingo its because of require/etc are done by their base type
17:26 scoates Ryan_Lane: I want to set a subnet to "auto assign public IP"
17:26 scoates https://github.com/boto/boto/pull/3111
17:26 saltstackbot [#3111]title: Issue 2646. Adding support for VPC ModifySubnetAttribute API | Add support for the ModifySubnetAttribute API so that AWS allocates public IPs for instances in the subnet....
17:26 dingo 'require: file: name' -- 'file' is the first unique lookup key
17:26 Ryan_Lane scoates:       - associate_public_ip_address: True
17:26 AndreasLutro shrug
17:26 Ryan_Lane in launch config
17:26 Ryan_Lane that's a per-instance or per-launch config setting
17:26 GreatSnoopy joined #salt
17:26 AndreasLutro if you need to require each specifically, split them into two states - the require system needing you to specify the state type is a bit odd
17:26 scoates ah, not per-subnet, but instead per-instance? I can live with that if its that easy.
17:27 scoates doing it in actual boto is a headache.
17:27 Ryan_Lane otherwise you need to attach EIPs per instance
17:27 scoates (or at least was)
17:27 whytewolf phw: if you are just wanted to create the directory that a file will be placed in while puting the file file.managed has makedirs and dir_mode
17:27 Ryan_Lane and EIPs are horrible
17:27 Ryan_Lane you can't tag them or name them. there's no way to handle them idempotently
17:27 scoates Ryan_Lane: associate_public_ip_address is only for ASG + LC, no?
17:28 Ryan_Lane I think so. but why use anything other than an ASG? :)
17:28 scoates (yeah, I know you think we should put everything into a ASG, but I'm just trying to get stuff done now.)
17:28 Ryan_Lane the asg module lets you define the launch config inside of it
17:28 phw whytewolf that is good to know, but in this case i want to create an empty directory
17:28 Ryan_Lane and it'll ensure changes to the launch config apply too
17:28 shaggy_surfer joined #salt
17:28 Ryan_Lane by creating new ones, attaching them, then deleting the old ones
17:29 scoates I don't actually want my salt master to autoscale, for example, because I want to remount the EBS disk if the node itself fails, whenever possible.
17:29 quique joined #salt
17:29 Ryan_Lane so it's just as easy as using single instances
17:29 Ryan_Lane scoates: lock your asg to max/min/desired 1
17:29 claytron_ joined #salt
17:29 ekristen joined #salt
17:29 scoates Ryan_Lane: it'll still cycle if the node fails in that case, no?
17:30 Ryan_Lane in general if you don't setup scaling policies and alarms the ASG will never grow or shrink
17:30 numkem joined #salt
17:30 Ryan_Lane scoates: yes, but you can also disable that feature
17:30 Ryan_Lane though in general you probably don't want to
17:30 scoates I appreciate what you're saying, but I can't get this done in time if I have to change the architecture like this, now.
17:30 Ryan_Lane gotcha
17:31 shaggy_surfer joined #salt
17:31 Ryan_Lane there's unfortunately no boto_ec2 module for single instances, I think
17:31 Ryan_Lane so you're stuck with salt-cloud, which I think is a bit limited
17:32 scoates yeah. I've got all of that working so far. except flipping the public IP bit for VPC subnets is missing from boto and thus from salt cloud… yak yak. etc.
17:32 Ryan_Lane hm. I'm surprised the boto_asg docs don't show how to use launch configs
17:32 Ryan_Lane scoates: it should be an option for building the instance
17:32 scoates I don't see it in the salt source
17:33 scoates the way you do it with boto is far from simple…
17:33 scoates ( http://paste.roguecoders.com/p/d6baaa5e00c6972f913e03ccc14394af.txt )
17:33 DammitJim joined #salt
17:33 Zachary_DuBois joined #salt
17:36 Ryan_Lane yeah
17:36 Ryan_Lane scoates: using asgs is really really easy :)
17:36 Ryan_Lane hm
17:36 Ryan_Lane you actually need salt-cloud for the master/minion connection, don't you?
17:38 scoates yes, until we start pre-building AMIs with packer
17:38 scoates ( :soon: but not yet )
17:40 ajw0100 joined #salt
17:42 scoates oh, nice https://github.com/saltstack/salt/pull/26312 merged
17:42 saltstackbot [#26312]title: allow vpc_name instead of vpc_id for boto_secgroup | When creating a VPC with `boto_vpc.present`, the remote end (the AWS API) determines the `vpc_id`. To make further additions in `boto_vpc`, you can use the `vpc_name` instead of the `vpc_id` because the `vpc_id` is not known (declaratively)....
17:43 baweaver joined #salt
17:44 aqua^c joined #salt
17:44 numkem joined #salt
17:44 X67r joined #salt
17:46 baweaver joined #salt
17:46 Ryan_Lane nice :)
17:46 Heartsbane Can someone explain the difference in salt-call between event.send and event.fire
17:46 Ryan_Lane scoates: thanks for that contribution, btw, we've wanted that for a while
17:47 scoates Ryan_Lane: I hope to find time to do it to the others (other resources by name) because I have a bunch of hackery now.
17:47 Ryan_Lane :D
17:47 Ryan_Lane yeah
17:47 dthom91 joined #salt
17:47 Ryan_Lane scoates: is continued work dependent on your proof of concept?
17:48 Deevolution left #salt
17:48 scoates more like dependent on me actually finishing this and not quitting computers and starting a brewery
17:48 Deevolution joined #salt
17:48 scoates (-;  actually more dependent on having the time to fix stuff up starting next month
17:50 druonysus joined #salt
17:51 Ryan_Lane hahaha
17:51 Ryan_Lane well, I'm definitely around for reviews, when you need them
17:52 Ryan_Lane or help with implementation details
17:52 Ryan_Lane we don't have a ton of time for the current modules right now, since they're mostly in good shape from our perspective
17:52 pravka joined #salt
17:53 numkem joined #salt
17:53 * scoates nods
17:53 zer0def joined #salt
17:53 scoates cool; thanks. I appreciate all of your help.
17:56 joeskyyy joined #salt
17:58 pm90_ joined #salt
17:59 beautivile joined #salt
18:00 numkem joined #salt
18:00 pm90__ joined #salt
18:00 numkem joined #salt
18:01 gadget-girl joined #salt
18:01 Ryan_Lane yw
18:01 gadget-girl has here used salt in their CI system
18:01 repl1cant quick raet question
18:02 repl1cant can you specifiy on the minion which udp port to use for raet?
18:02 repl1cant i can't find anything in the default config
18:02 Ryan_Lane gadget-girl: I'm using it, but probably not in the way you're asking about :)
18:03 PredatorVI joined #salt
18:06 dingo yeah, me too. dunno
18:06 dingo i've salted build agents, and i have build agents doing jobs of spinning up vm's and running salt inside them, that's CI right
18:09 agend joined #salt
18:09 gadget-girl how are you using it Ryan_Lane
18:10 Ahlee mayhaps you should ask what you want to do, and we can offer insights
18:10 Ahlee a lot of us have tied salt into our CI in a lot of ways
18:10 thefish joined #salt
18:11 dingo saltstack itself is tested with CI
18:11 Ryan_Lane gadget-girl: I use masterless, so the CI calls salt-call
18:12 dingo sounds like gadget-girl just got an assignment to use CI and salt and is freaking out? ;p
18:12 Ryan_Lane or she's just trying to see how other people are using it.
18:12 dingo CI and salt go hand in hand in determinism
18:12 dingo if you're freezing versions, binaries, and able to track everything back to source and reliably reproduce such binaries
18:13 dingo salt is a good friend for such occasions
18:13 Ryan_Lane gadget-girl: our use is mostly for orchestration. we also use salt to build our docker images and to orchestrate docker.
18:13 dingo you can salt machines and bit-for-bit have the exact same determined state, time and time again -- with the exception of tirtuary factors (time itself, being one of them)
18:14 jeadr joined #salt
18:14 Ryan_Lane for instance, we have some QA nodes that run sets of services together, by having salt launch the containers, then write into etcd to track which of these boxes is in which state and is owned by which people
18:15 micko joined #salt
18:16 gadget-girl cool
18:16 Ahlee that is a really good idea
18:16 * Ahlee steals it
18:16 murrdoc so chicago right now
18:17 venu0336 joined #salt
18:17 Ryan_Lane Ahlee: if you use docker run, run salt, then docker commit, you can replace docker files
18:17 Ryan_Lane you can even volume mount salt in, so that you don't need to install it in each image
18:18 dingo optimization
18:18 Ryan_Lane (you do need python, though
18:18 Ryan_Lane )
18:18 Ahlee no docker
18:18 Ahlee but, yeah, i can see that allure
18:18 Ryan_Lane sure. could use systemd-nspawn :)
18:18 dingo i volume mount salt too, in whichever hypervisor
18:18 dingo i think currently kvm and nfs :)
18:18 Ryan_Lane heh. nfs is evil :)
18:19 Ahlee ^
18:19 dingo its kvm, dunno -- its that or rsync
18:19 dingo at least this one, i can vi from within the hypervisor for a quick change test
18:19 Ryan_Lane openstack swift
18:19 dingo and then commit it from the outer world
18:19 Ryan_Lane object storage :)
18:19 dingo yeah i salt deploy openstack on arch linux clusters of all things
18:19 dingo vroom
18:19 murrdoc woooo
18:19 dingo i'm in the clouds
18:19 Ryan_Lane :D
18:19 murrdoc we talking sdb
18:20 Ahlee one of these days I'll sit down and actually figure out the container virtualization stuff, and see just now bad multicast performance is
18:20 Ahlee but that day is not today
18:20 gadget-girl how in sls could tell salt to make a zip file
18:20 dingo cmd.run, likely.
18:21 Ahlee http://docs.saltstack.com/en/latest/ref/states/all/salt.states.archive.html#module-salt.states.archive
18:21 baweaver joined #salt
18:21 Ahlee oh, that's exctract
18:21 Ahlee not compress
18:21 Ryan_Lane http://docs.saltstack.com/en/latest/ref/states/all/salt.states.archive.html
18:21 Ryan_Lane ah. right.
18:21 Ryan_Lane heh
18:21 ageorgop joined #salt
18:21 Ahlee cmd.run it is.
18:22 murrdoc dont do it
18:22 Ryan_Lane make sure to use unless: or onlyif: with that
18:22 Ahlee bah murrdoc
18:22 Ahlee cmd.run is love, cmd.run is life
18:22 murrdoc ball is life
18:22 murrdoc command run is regret
18:23 murrdoc i regret that saltstack didnt wrap this functionality up, i must cmd.run
18:23 Ryan_Lane I use cmd.run all the time :)
18:23 Ryan_Lane but only with unless or onlyif
18:29 Ahlee same
18:30 breakingmatter joined #salt
18:30 Ahlee interesting, it appears this _grain/ is being loaded in twice
18:31 Jimmy_Rustler joined #salt
18:31 Ryan_Lane grains are loaded/reloaded often
18:32 Ahlee so it appears
18:33 gadget-girl ls
18:33 gadget-girl opps
18:33 claytron_ joined #salt
18:34 beautivile working on an pillar/state combination to generate the node-groups.conf as well as provide data about specific nodes for access via other states, and having an issue creating an array/dict from nothing as nodegroups['NODEGROUPNAME'][NODENAME] = NODENAME, wondering if anyone here has done anything similar
18:34 ageorgop joined #salt
18:35 timoguin joined #salt
18:36 iggy Ahlee: there's a config option to cache grains
18:38 thefish joined #salt
18:40 Ahlee last thing i want is more fucking caching
18:41 Ahlee at least, hte API doesn't play well with the existing caching, and likes to add in down minions into grain/pillar targets, presumably due to caching
18:41 Ahlee s/API/net api/
18:43 cape joined #salt
18:43 murrdoc what version are u on
18:43 murrdoc i am on 2014.7 and am getting judged
18:43 iggy 0.1.0
18:43 murrdoc Oh.Ahlee
18:44 * AndreasLutro judges harshly
18:44 Ahlee i reproduced the issue on 2015.5.2, i think.
18:44 Ahlee next time I roll forward i'll have more time to test
18:44 forrest Ahlee: Can you create an issue if you confirm?
18:44 cheus joined #salt
18:44 Ahlee of course.
18:45 forrest Sweet
18:45 numkem joined #salt
18:46 Ahlee How bad of an idea is it if I call into __salt__['core.os_data']() for values in my custom _grain?
18:46 Heartsbane So does anyone have time to talk about the salt event reactor. Namely if I use "salt-call event.send 'bob/loves/goats' " that just pops up in the arguements not in any type of tag for the event
18:46 gimpy2938 I'm trying to find a way to set the prod/dev status of my minion...I have this info in a DB, I can write a Python script to query it to get that info, but what should I do with it then?  Stick it into each minions pillar?  How would one add info to a pillar?
18:47 cape Can I add more things to the default rendering context? I'm looking through the development documentation, but all I can find is the SLS variable reference which details what is already there (http://docs.saltstack.com/en/latest/ref/states/vars.html)
18:47 Heartsbane I have built a state that triggers off a tag similar to that but it doesn't seem to work.
18:47 Ahlee gimpy2938: environment: in minion config
18:48 gimpy2938 Ahlee: I can't have the minions do this though, it must be the master - hence why I was looking at pillars instead of grains
18:49 iggy #!py renderer pillar?
18:49 Ahlee it's less a grain, more a configuration variable
18:49 Ahlee but, yeah. ext_pillar can query your DB directly
18:49 iggy but the minion config is still editable by the minion
18:49 iggy ext_pillar isn't exactly necessary
18:49 Ahlee but that won't seperate the environment from salt's perspective
18:50 iggy true story
18:50 impi joined #salt
18:50 gimpy2938 The minion configs are all static and pretty much default, I can't change them.
18:52 Ahlee To use salt's built in environments, you'd need to set it in the config. If you can't modify the config, you can use ext_pillar to reach out to your database to identify the hosts without issue, but they'll still see the same file_root
18:54 iggy So... basically if you are talking about using Salt's environments, you can't do it that way... but if you just need something to key off of, then you can do it with ext_pillar/#!py pillars/etc
18:55 Ahlee got a link to #!py pillars?
18:55 Ahlee this sounds relevant to my interests
18:55 murrdoc !#py pillar is any python code, that returns a dictionary
18:56 iggy Ahlee: same as the normal python renderer... just in pillar files
18:56 gimpy2938 iggy: Yea, don't care about Salt's environments, anything to key off of is fine ... still not clear on how to do it though, haven't found a clear example
18:56 * Shirkdog just had a salt epiphany...I am not hooked :)
18:56 Shirkdog s/not/now/
18:56 iggy http://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.py.html
18:56 iggy gimpy2938: Ahlee: ^
18:57 iggy then use whatever python you want to in there
18:57 gadget-girl how do can work with file paths in salt
18:57 katyucha joined #salt
18:58 gimpy2938 iggy: That skips over some simple things....like where to put that Python file
18:58 gimpy2938 I really wish the docs catered to stupid people more
18:59 iggy gimpy2938: anywhere you want... you target it the same as your other sls files
19:00 iggy ext_pillar is another option
19:01 gimpy2938 Ok, I'm confused.  So I can make a dev_or_prod.sls that is Python code to query my DB, call it like 'salt box.example.com state.sls dev_or_prod' it returns a dict ... then what?
19:01 Ahlee gimpy2938: i hear ya. Salt goes from "Here's the tutorial...and now you're running a marathon"
19:01 joeskyyy ^5
19:01 XenophonF cape: you can write your own module, if you want to add stuff isn't normally accessible from jinja
19:03 XenophonF cape: for an example see https://github.com/irtnog/salt-states/blob/development/_modules/irtnog.py and https://github.com/irtnog/salt-states/blob/development/apache/map.jinja#L62
19:03 cape XenophonF: ah, it's all modules? great, thanks! :)
19:04 XenophonF wherein i wanted to use salt's dictupdate function but couldn't because the namespace it's in doesn't get imported into jinja
19:04 XenophonF I don't know what the security implications of working around things like that are.
19:07 iggy gimpy2938: no, you'd assign it in the pillar top file
19:09 gimpy2938 iggy: Do you have an example?  Another annoying part fo salt docs: it gives you 1 piece of the 400 piece puzzle
19:10 DanyC joined #salt
19:11 DanyC whytewolf: do you have any other idea since symlink didn't cut through?
19:12 timoguin joined #salt
19:13 iggy gimpy2938: no... because most people don't document their pillars... seeing as it's usually not info you want people to know
19:14 lrojas joined #salt
19:14 lrojas left #salt
19:14 lrojas joined #salt
19:15 murrdoc iggy:  vote for my request https://github.com/saltstack/salt/issues/26350#issuecomment-131932493
19:15 saltstackbot [#26350]title: [Feature Request] Ability to Retry state function calls | As a feature request i would like the ability to have retry as a parameter on states. For eg sometimes in orchestrate, i have to gate the orchestrate state with a test.ping to only try and work if the minion is responding to a test.ping. So the ability to do the following would be awesome. ...
19:16 gimpy2938 This is very frustrating...salt really has no simple way of saying "for minion id box.example.com set 'foo:bar' in its pillar"?  You have to use a renderer or build your own ext_pillar?
19:16 claytron_ joined #salt
19:16 murrdoc it does
19:16 timoguin joined #salt
19:16 murrdoc do u have a top.sls for pillars ?
19:17 gimpy2938 murrdoc: Yes
19:17 murrdoc or did u want to do it in a state
19:17 murrdoc cos both work
19:17 DanyC asking again hopping others who just joined might have an idea:  what is the best/ simple way to say - check if file is present, if it is, delete and then create a sym link?  Currently i'm going blind on just doing file.symlink: - target: /tmp/test . I'd prefer not to create 2 blocks : 1 for file.absent and 1 for file.symlink
19:18 murrdoc {%if salt['file.file_exists'']('path') %} file.absent: - name: path {% endif %}
19:18 murrdoc then file.symlink
19:18 murrdoc forrest:  vote for my request https://github.com/saltstack/salt/issues/26350
19:18 saltstackbot [#26350]title: [Feature Request] Ability to Retry state function calls | As a feature request i would like the ability to have retry as a parameter on states. For eg sometimes in orchestrate, i have to gate the orchestrate state with a test.ping to only try and work if the minion is responding to a test.ping. So the ability to do the following would be awesome. ...
19:19 gimpy2938 murrdoc: idk, I just need a way to put a prod/dev field into salt in a way that in a state file I can say 'if state == prod' or whatever.  Here's my current pillar stuff: https://gist.github.com/anonymous/79f18e23f0ee53fc5bd7
19:19 forrest Does that actually get anything done murrdoc?
19:19 iggy no
19:19 forrest Salt doesn't really operate on a popularity contest from what I've seen
19:20 iggy There are issues open with 100s of comments and +1's that the devs could care less about
19:20 bregalad forrest: when I see issues with lots of comments, I bump up the priority
19:21 forrest bregalad: In your projects?
19:21 forrest bregalad: That may be true, but it's not the case for Salt.
19:21 forrest iggy: Yeah I was trying to find one like that as an example
19:21 murrdoc damn u iggy and forrest
19:21 bregalad forrest: no, I mean for salt
19:21 murrdoc just help a brother out
19:21 forrest bregalad: Oh sorry, I didn't know you worked for salt
19:21 murrdoc u cynical bastards
19:21 murrdoc "D
19:22 bregalad yeah, my irc nick sucks, sorry :)
19:22 forrest murrdoc: We aren't cynical, we've just been working on the project for like 3 years, lol
19:22 forrest iggy might have more than that
19:22 murrdoc i been here for a year
19:22 iggy nope
19:22 murrdoc i still dont hate
19:22 forrest murrdoc: It's not hate
19:22 iggy ~2 I think
19:22 iggy I don't hate your idea, just you
19:22 * iggy runs
19:22 murrdoc i hate you too
19:23 forrest lolbregalad:
19:23 murrdoc but i need dem votes
19:23 forrest bregalad: Who are you on github?
19:23 murrdoc my next plan is to write a really bad version of it
19:23 bregalad forrest: I'm jfindlay
19:23 murrdoc and make thatch hate fix it
19:23 forrest bregalad: oh okay, that makes sense.
19:23 forrest murrdoc: No
19:23 forrest murrdoc: He needs to finish the damn masterless reactor first
19:23 iggy lol
19:23 forrest before your small use case feature dammit
19:23 murrdoc no fu
19:23 bregalad lol @ hatefix
19:23 murrdoc or bregalad will hate fix
19:24 murrdoc someone will hate it enough
19:24 Ahlee lol
19:24 murrdoc i just want the feature
19:24 forrest murrdoc: And I want masterless reactor
19:24 murrdoc eugh
19:24 bregalad murrdoc: you mean the state retry?
19:24 murrdoc bregalad:  yeah
19:24 murrdoc its easy to di t
19:24 murrdoc do *
19:25 murrdoc i do it all the time at work
19:25 quique joined #salt
19:25 supersheep joined #salt
19:25 murrdoc commit ugly code to someone else's code if they dont 'have time'
19:25 forrest murrdoc, trolling features since 2014
19:25 murrdoc somehow magically they do have time
19:26 murrdoc cheayh
19:26 murrdoc hey if u a drama mama, and u are blocking my work and i know the trigger , i will texas it
19:26 murrdoc altho i dont think anyone in saltstack is like that
19:27 Arendtsen If I have defined a list of grains on a minion like this http://pastebin.com/GLXM5Wmr. How would I check for the specific role? salt['grains.get']('roles:mailserver') ?
19:28 bregalad forrest: is there an issue for masterless reactor?
19:28 forrest bregalad: Yep
19:28 forrest https://github.com/saltstack/salt/issues/15265
19:28 saltstackbot [#15265]title: Bring reactor system to minions | Right now reactors are a master-only feature, but it would be really nice to be able to react locally to events, especially if not using a master. For instance, it would be really awesome to react to udev events or to etcd events.
19:29 forrest Tom finished part of it, and basepi checked in with him about it last week, he's just busy and hasn't had time to finish it.
19:29 shaggy_surfer joined #salt
19:31 forrest murrdoc: Really I should comment 'this would be useful, but these 600 other issues would be MORE useful'
19:31 forrest then ask github to add a troll emoticon
19:31 bregalad forrest: I was at the thrift store with my daughter last weekend, (DI if you live in or near Utah), and I saw a girl with a toy Jake
19:31 forrest so I can use it
19:31 bregalad I think I was more jealous than my daughter
19:31 forrest bregalad: lol
19:31 forrest bregalad: I've been to Utah for saltconf but that's it.
19:32 DanyC murrdoc: thx for the snippet, i'll try it now
19:34 bregalad forrest: I updated the priority on the masterless reactor issue
19:34 forrest bregalad: Thanks.
19:34 bregalad keep bugging me if we forget about it :)
19:34 forrest murrdoc: I comment on your issue.
19:35 forrest bregalad: Will do. There should probably be an issue created for the functionality that exists with a master versus without that collects all the related issues so that they can be implemented if possible. Since masterless is gaining more traction.
19:35 forrest murrdoc: *commented
19:35 forrest Arendtsen: Sorry, yeah that should work
19:35 mrwboilers ok, maybe a stupid question, but a few minutes of googling hasn't found the answer.
19:36 bregalad forrest: good idea
19:36 mrwboilers When salt minion is installed via the bootstrap script, how do I uninstall it?
19:36 manfred mrwboilers: depends on how you installed it with the bootstrap script
19:36 manfred if you used git or pip, then pip uninstall it
19:36 manfred otherwise uninstall the packages
19:36 Deevolution When writing an execution module is it possible to have it return a verbose return AND a return code that Salt interprets?
19:37 sbogg joined #salt
19:37 mrwboilers thanks
19:37 Arendtsen forrest: hmm... doesn't look like it works
19:37 forrest Arendtsen: Are you trying to reference this as part of an if statement in a state or what?
19:37 DanyC joined #salt
19:37 manfred Deevolution: you could maybe modify how hte output looks using an outputter
19:38 Arendtsen forrest: correct
19:38 forrest Arendtsen: do it like this {% if 'mailserver' in grains['roles'] %}
19:39 forrest Arendtsen: or {% if 'mailserver' in salt['grains.get']('roles') %}
19:39 Deevolution manfred: I'll look into that.  Thanks.
19:39 murrdoc forrest:  i scratch your back, where is your masterless reactor ticket so i can go comment on it and be like this is useless
19:39 murrdoc :D
19:39 Arendtsen forrest: arh... like that of course.
19:39 Arendtsen forrest: thanks!
19:40 iggy Deevolution: there's nothing that says you can't, but I think it's probably more natural to do that state modules
19:40 forrest Arendtsen: Yeah np
19:40 forrest murrdoc: https://github.com/saltstack/salt/issues/15265
19:40 saltstackbot [#15265]title: Bring reactor system to minions | Right now reactors are a master-only feature, but it would be really nice to be able to react locally to events, especially if not using a master. For instance, it would be really awesome to react to udev events or to etcd events.
19:40 Deevolution iggy: Makes sense, but this is not going to be a state by design.
19:41 iggy Deevolution: see https://github.com/saltstack/salt/blob/develop/salt/modules/file.py#L3487 for an example
19:41 baweaver joined #salt
19:43 Deevolution Iggy:  Ah!  Thanks!
19:49 PredatorVI Interjecting a (hopefully) quick question about pillars...can I somehow reference pillars from within pillars?  I have a pillar myapp/init.sls that I want to use to define some shared values (user permissions, base path information,etc.) that I want to reference in a pillar included as part of init.sls.
19:49 PredatorVI Can this be done?
19:49 manfred PredatorVI: it is iffy
19:49 manfred because the pillars are rendered on the master
19:50 PredatorVI I think that would be okay for my use case.
19:50 iggy don't
19:50 manfred and then passed to the minion, I was always told that you would end up with the wrong pillar data if you did that, but I have seen some instances where it was fine
19:50 manfred yeah, i wouldn't
19:50 manfred it isn't really how they are meant to be used
19:50 iggy it kind of works sometimes, but for the most part, it's a terrible idea
19:50 excise joined #salt
19:50 manfred and I still don't think the top.sls file is loaded in order 100% of the time
19:50 baweaver joined #salt
19:50 iggy you can however use jinja to include files/etc
19:50 manfred https://github.com/saltstack/salt/issues/14723
19:50 saltstackbot [#14723]title: Top files aren't ordered | At minimum the pillar top files aren't ordered, but I'd imagine this also goes for the state top file. This is an issue with target ordering. I haven't tested with file inclusion within a target, but I'd imagine that works fine, since it's a list.
19:51 vstoniest joined #salt
19:51 PredatorVI The scope is only within a single pillar folder contolled by the init.sls
19:52 manfred if it works for you, then by all means, but it doesn't always work
19:52 PredatorVI Regardless, should the '{{ pillar.myapp.* }}' syntax work?
19:52 manfred maybe
19:52 manfred it depends on how it is all loaded
19:52 manfred if it is actually loaded in order
19:52 manfred because pillars top files are not ordered
19:53 manfred so you can't be 100% sure it is loaded in that order all the time
19:53 jeadr joined #salt
19:53 manfred I have also never gotten a clear explaination if all the jinja is rendered on the master or not, but I think pillar. might work
19:53 PredatorVI I'm limiting the scope to a single pillar folder
19:53 manfred but salt['pillar.get'] probably won't cause that makes a call as the minion
19:53 PredatorVI The only ordering would be in the init.sls
19:53 Ryan_Lane manfred: you can use order: x in the pillar top file
19:54 Ryan_Lane also, I thought pillar tops are now ordered?
19:54 manfred PredatorVI: why not just use yaml?
19:54 manfred Ryan_Lane: your bug was still open?
19:54 manfred https://github.com/saltstack/salt/issues/14723
19:54 saltstackbot [#14723]title: Top files aren't ordered | At minimum the pillar top files aren't ordered, but I'd imagine this also goes for the state top file. This is an issue with target ordering. I haven't tested with file inclusion within a target, but I'd imagine that works fine, since it's a list.
19:54 Ryan_Lane https://github.com/saltstack/salt/issues/14723
19:54 saltstackbot [#14723]title: Top files aren't ordered | At minimum the pillar top files aren't ordered, but I'd imagine this also goes for the state top file. This is an issue with target ordering. I haven't tested with file inclusion within a target, but I'd imagine that works fine, since it's a list.
19:54 Ryan_Lane heh
19:54 manfred that is why i thought it wasn't always ordered
19:54 Ryan_Lane I opened that :D
19:54 manfred yar
19:54 PredatorVI manfred:  I probably could...I've not used much YAML.
19:55 manfred PredatorVI: using yaml or jinja variables to include it would be better imo
19:55 PredatorVI kk
19:55 manfred PredatorVI: https://github.com/gtmanfred/salt-states/blob/master/website/mysql.sls#L4-8
19:55 manfred like that or something
19:55 manfred then - <<:* unwraps that
19:55 druonysus joined #salt
19:57 iggy pillarstack ?
19:58 claytron_ joined #salt
20:00 mapu joined #salt
20:02 druonysuse joined #salt
20:04 otter768 joined #salt
20:04 quique joined #salt
20:06 joeskyyy Alright, super high level question here, and I'm pretty sure the answer resides somewhere in the realm of ext_pillar. Let's say I have an organisation, and each of those has departments. I want to be able to execute a change from a top level organisation to all departments, or from a top level to given departments. Each department will have dynamic resources being created/removed. Is an ext_pillar the best way for this?
20:06 joeskyyy Or did I miss the point of an ext_pillar entirely.
20:07 dingo no that's sortof ok
20:07 joeskyyy To clarify, each department has it's own salt master talking to the minions for it's group
20:07 dingo i mean it would be nice if they all pointed to the same ext_pillar, and whatever magic that is, identifies the person's department and supplies their given pillar data
20:07 PredatorVI manfred:  Tried jinja in pillar: `{% set web_user_name = 'myuser' %}` then in my init.sls pillar AND the pillars included by init.sls I simply used '{{ web_user_name }}' but I get a rendering error that is not helpful.
20:08 dingo PredatorVI: variable 'sets' do not include, do they guys?
20:08 dingo code is not shared between rendered state
20:09 dingo included.sls contains yaml, is rendered, the rendered result is included by file-that-includes.sls
20:09 dingo - include is nothing like "#include" where "everything in that file is in place here as source form" -- only its rendered form is included
20:09 dthom91 joined #salt
20:10 dingo re-executing the same code logic could maybe have side effects, possibly indeterminstic ones, gah
20:10 PredatorVI The order I'm doing things currently 1) define variables 2) use variables 3) include other sls that uses variables
20:10 joeskyyy dingo: Thanks. Is that over complicating it in any way? I've looked into environments, and of course grains, but I don't think that quite fits in this situation.
20:10 rideh joined #salt
20:11 dingo joeskyyy: well if your 'departments' are pillar data of things, and every unique department execution chose its proper department github repository for example, you wouldn't need ext_pillar (custom module)
20:12 dingo you could just use grains, roles, yup
20:13 dingo but PredatorVI: i would try to push as much as i can into pillar, and do cheap computation in the state/yaml/jinja, duplication of complex 'set' statements may be necessary
20:13 numkem joined #salt
20:13 joeskyyy_ joined #salt
20:13 dingo there is a way i think to compute a result, which a downstream state may use, i don't recall, just researched the idea once before
20:13 PredatorVI dingo:  I am doing this in the pillar to try to share a data value in other pillar contexts.
20:14 joeskyyy_ dingo: Interesting, I think I need to dig a little more before I go on asking meaningless questions haha
20:14 joeskyyy_ Thanks a bunch (:
20:14 iggy PredatorVI: you could do it similar to how states use map.jinja/etc
20:14 dingo sorry PredatorVI, i thought we were talking all about state rendered stuff. pillars render once per context, don't they?
20:15 dingo i just had a flub recently about context that was insightful, wish i didn't have a vacation since, i'd share it ;p ttyl
20:15 joeskyyy_ Follow up question for anyone familiar with syndics, is there a way to tell a command which syndic to direct towards? I've found it simpler to just have a salt master/minion running to target minions in a MoM setup when I only want to target specific minions without using pattern matching.
20:16 PredatorVI dingo:  'once per context' is really all I need (assuming I really  understand what that means :)
20:16 arthoo joined #salt
20:17 TronPaul_ hey, could someone help me with a ext_pillar issue I'm running into? https://gist.github.com/TronPaul/4df07b105e97d543d9a8
20:17 iggy still think you should look at pillarstack/reclass/etc
20:17 PredatorVI I have a web service with properties that uses a rabbitmq user/password combo to connect.  I also have a rabbitmq pillar for configuring the rabbitmq users.  This all exists within a single pillar folder.  I simply want to define the usernames/passwords in on place and insert them in their context-specific pillars.
20:18 TronPaul_ for whatever reason it seems my 'prod' env disappears when the top file is being processed, but it successfully caches the data prior to running the top.sls (I can see this in the debug logs)
20:19 XenophonF left #salt
20:20 TronPaul_ when pillars get merged, do their options (ie file_roots) get merged? I think that's what might be happening (and thus my prod env file_root is being eaten by the base ext_pillar)
20:21 PredatorVI TronPaul_: What does your master config look like for your environments?
20:22 PredatorVI (file_roots)
20:22 quique joined #salt
20:22 adelcast so, my understanding from the documentation is that grains are bits of information that is static, meaning it is loaded only once on minion start-up
20:23 adelcast however, if I do "salt-call netwrok.mod_hostname blah" then do "salt-call grains.items", I can see my hostname changed
20:23 adelcast are network settings special or am I misunderstanding grains?
20:24 PredatorVI adelcast:  I'm a n00b, but grains can change.  I think it will depend on how they are implemented, but you definitely want grains to change that have dynamic values (mem usage, disk space, certificate expiration, etc.) New ones can be even be assigned during state transition.
20:25 scoates joined #salt
20:25 PredatorVI We currently assign grains (roles) in our top file based on the name of the minion, then state.highstate will provision the minion based on the role.
20:26 adelcast PredatorVI: yeah, I am getting that impression...I am designing a system where I have a bunch of information that is HW specific and I am debating if I should set some of that information as grains or not
20:26 aqua^c joined #salt
20:26 PredatorVI Sounds like a good use of grains.
20:27 jeremyr1 joined #salt
20:27 adelcast for things like mem usage, disk space, I am leaning towards using a beacon, as that's information that I need to poll on
20:28 PredatorVI If you are targeting minions based on those grain values, then it seems to fit.
20:28 iggy adelcast: they are read/executed quite frequently actually
20:29 adelcast well, I am not using the grains to target minons, I am using them to harvest info from my (embedded) device, for things like ethercat configuration
20:29 adelcast iggy: yeah, mm, sounds like the documentation might be outdated then
20:30 iggy where does it say that?
20:30 adelcast http://docs.saltstack.com/en/latest/topics/targeting/grains.html
20:30 adelcast "It is important to remember that grains are bits of information loaded when the salt minion starts, so this information is static. This means that the information in grains is unchanging, therefore the nature of the data is static. So grains information are things like the running kernel, or the operating system"
20:31 iggy open an issue, that's definitely not correct
20:31 adelcast iggy: ok, will do, thanks
20:32 shaggy_surfer joined #salt
20:32 iggy I _think_ that may refer to the fact that the data is available earlier than most, but even then it's misleading
20:32 murrdoc gaise
20:32 murrdoc salt of the earth ?
20:34 PredatorVI iggy, adelcast:  It could also be in reference to grains defined in the minion config.  Those seem to be static and prevent any other grains to be assigned dynamically later on (at least from what experienced).
20:35 druonysus joined #salt
20:35 adelcast mm, yeah, maybe on the beginning that was one of the first uses of grains...then the documentation might have gotten out of sync
20:36 gadget-girl joined #salt
20:36 gadget-girl how to update my _states
20:36 Zachary_DuBois joined #salt
20:37 adelcast on a different topic, I need to get notifications on my master when there is an ip change (I believe the ZeroMQ channel stays on even with an IP change)
20:37 iggy PredatorVI: good point... still could use some clarification
20:38 adelcast I am thinking on using an inotify-based beacon, on the file that keeps the ip (I think there is one?)
20:38 adelcast does that sound sane? or has someone tried something similar?
20:38 TronPaul_ PredatorVI, sorry was working on something https://gist.github.com/TronPaul/4df07b105e97d543d9a8
20:38 TronPaul_ added more of my master config
20:39 TronPaul_ fileserver.envs claims both base and production exist
20:40 dingo 20:16 < PredatorVI> dingo:  'once per context' is really all I need (assuming I really
20:40 dingo i hope i'm write, i had a vacation and don't remember any salt stuff clearly :)
20:40 TronPaul_ I plan on shoving the pillar stuff into regular pillar roots and see if that fixes it later today
20:41 dingo right, rather
20:41 dingo let us know
20:41 dingo it might be: renders once, only once, for the context (on each salt-call/minion run)
20:42 dingo has anybody done salt state "coverage" tools? I've juggled the idea in my head and I'm confident it is possible
20:42 adelcast https://github.com/saltstack/salt/issues/26403
20:42 saltstackbot [#26403]title: Grains documentation incorrectly states they are static | From http://docs.saltstack.com/en/latest/topics/targeting/grains.html:...
20:42 dingo if somebody wants to pay me i'll do it open source for'yall hehe
20:42 claytron_ joined #salt
20:42 PredatorVI TronPaul_:  Do you have branches in your gitfs_remotes called "production"?
20:43 dingo i plan to write documentation that cross references the states as identified in show_highstate yaml output, and i could go the extra mile to backtrack that to the file and line number for 'show source', which would be neat... and then you have all the components of a coverage tool at the ready for yaml output of salt-call state.highstate
20:44 dingo one could then use 'coverage combine'-like tool for the CI runs of salt states across contexts and nodes, and see how their testing coverage is
20:44 dingo heck, probably find all kinds of unused states in any large library of states
20:45 dthom91 joined #salt
20:45 TronPaul_ PredatorVI, yes, in the first gitfs_remote
20:46 iggy need it in all of them
20:47 TronPaul_ really? that seems pretty counter intuitive
20:47 PredatorVI TronPaul_:  I entered an issue to allow a single gitfs branch to multiple environments for shared states.  https://github.com/saltstack/salt/issues/26309
20:47 saltstackbot [#26309]title: Ability to map a shared gitfs_remote branch with multiple environments... | When using file_roots, if I have "shared' states to be included in multiple environments, I can repeat that file root:...
20:47 PredatorVI *branch to map to*
20:49 TronPaul_ isn't the file server supposed to check for the file in the current environment, then try base if it doesn't exist?
20:49 TronPaul_ thought I read that in the docs somewhere
20:49 TronPaul_ (plus my issue is on the pillar side of things)
20:52 shaggy_surfer joined #salt
20:53 X67r joined #salt
20:55 saltycharles joined #salt
20:56 TronPaul_ ah damn, you're right. Didn't take into account the 'This example' disclaimer at the end of http://docs.saltstack.com/en/latest/ref/file_server/file_roots.html#directory-overlay
20:57 PredatorVI TronPaul_: Yeah, which is was the catalyst for the issue I entered.  With file_roots you can list multiple directories (and even repeat them) in each environment, but with gitfs_remotes you can't do that currently.  However, for pillars, there is a mechanism that might allow you to work around this.
20:59 jeadr joined #salt
20:59 quique is there a way to get an error if a pillar key doesn't exist?
21:00 TronPaul_ quique, in what context, salt states, via the command line, etc
21:00 quique TronPaul_: in salt states
21:00 druonysus joined #salt
21:00 PredatorVI TronPaul_:  I've not tried it but you can use ext_pillar to map branch to environment.  See http://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.git_pillar.html
21:01 quique TronPaul_: i'm calling a pillar with contents_pillar and getting a blank file
21:01 TronPaul_ if you do pillar[key] instead of salt['pillar.get'](key)
21:02 quique TronPaul_: can i do contents_pillar: pillar[key]?
21:02 Deevolution left #salt
21:02 Deevolution joined #salt
21:04 TronPaul_ quique, you'd want to do `contents: {{pillar[key]}}`
21:04 TronPaul_ that should blow up with a KeyError if the key doesn't exist
21:04 clintberry joined #salt
21:09 DammitJim man, why would I be getting this error: No matching sls found for 'tomcat7.init' in env 'base'
21:10 murrdoc cos u dont have an sls
21:10 iggy because it'd just be tomcat7
21:10 murrdoc called tomcat7.init
21:10 murrdoc in your
21:10 murrdoc env
21:10 murrdoc base
21:10 murrdoc damnit
21:10 murrdoc jim
21:11 iggy (dir/init.sls would be automatically changed to dir)
21:11 DammitJim I'm an idiot
21:11 DammitJim I just have to call tomcat7
21:11 dingo 21:01 < TronPaul_> if you do pillar[key] instead of salt['pillar.get'](key)
21:11 dingo second
21:11 dingo i'm fighting against use of pillar.get, coworkers have been aliasing 'set pget =...' to pillar.get for a long while
21:12 dingo without ever requiring the use of the 'default=None' 2nd argument of pget.
21:12 tpaul left #salt
21:12 dingo a KeyError is a good thing!
21:13 ranomore1 left #salt
21:13 dthom91 joined #salt
21:13 pravka joined #salt
21:15 murrdoc that is a terrible idae
21:16 murrdoc but u should do it
21:17 Alan_S joined #salt
21:17 TronPaul_ sometimes defaulting to None and not erroring is a bad idea
21:18 murrdoc better to check returns
21:18 murrdoc does suck that u have to deal with it
21:18 CeBe joined #salt
21:21 jeadr joined #salt
21:21 jeffspeff on windows, does salt start running the highstate when the system boots or does it wait for the user to log in?
21:22 jeffspeff my state files are pretty large, so it's kinda hard to tell when it starts the process.
21:23 iggy it runs when you tell it to... is the minion service running before someone logs in?
21:26 evilrob grumble grumble....  using keystone states with a require for package python-keystone client, and they still die because the client isn't installed.
21:27 iggy can you paste the states?
21:27 ranomore joined #salt
21:32 jeadr joined #salt
21:32 dezertol joined #salt
21:37 linjan joined #salt
21:48 ranomore left #salt
21:49 shaggy_surfer joined #salt
21:50 ingslovak joined #salt
21:54 jeadr joined #salt
21:56 evilrob iggy: I'll come back to it.  fighting fires just now.
21:59 baweaver joined #salt
22:05 otter768 joined #salt
22:05 druonysus joined #salt
22:05 druonysus joined #salt
22:08 claytron_ joined #salt
22:09 s_kunk joined #salt
22:11 jalbretsen joined #salt
22:16 pm90_ joined #salt
22:16 JordanRinke joined #salt
22:18 pm90__ joined #salt
22:20 jalbretsen joined #salt
22:24 droweappature joined #salt
22:27 evilrob https://paste.ee/p/w35pd
22:28 evilrob and that is from a file that is included by a file with the pkg.installed right above the include. https://paste.ee/p/UI7KF
22:29 pravka joined #salt
22:30 shaggy_surfer1 joined #salt
22:30 voileux joined #salt
22:31 droweappature If I'm overriding a state module function in _states and want to call the core function I'm overriding (as you would with super in a class), can I use __salt__['function_name'] or does that refer to the overriding definition?
22:33 iggy evilrob: python -c "from keystoneclient.v2_0 import client"
22:34 evilrob No module named keystoneclient.v2_0
22:34 iggy droweappature: python's loader won't load the "overridden" class, so there would be no super to run
22:34 iggy evilrob: there's your problem (I guess)
22:34 evilrob I know this.  shouldn't the require on that state cause salt to go install it?
22:34 iggy evilrob: can you import keystoneclient at all?
22:34 evilrob no
22:34 evilrob it's not installed
22:35 iggy what if you try to install it manually?
22:35 evilrob I'm trying to get the state to isntall it for me
22:35 evilrob then it's all fine and dandy everything works wonderfully
22:35 druonysus joined #salt
22:35 druonysus joined #salt
22:35 baweaver joined #salt
22:36 iggy no clue then, it looks okay
22:37 iggy although I have to admit to not using include's like that
22:37 evilrob ok.  I'm not losing my mind then.  I'm going to add a pkg.installed inside the include even though I'm trying to keep config in a separate file.
22:37 iggy I would do it the other way around, have the keystone tennants sls file have the include of the other file at the top
22:38 evilrob I'll try that first.  cleaner than multiple pkg.installed statements
22:39 iggy I could swear at one point the docs said includes had to be at the beginning of an sls file, but I've never been able to find anything to verify that
22:40 evilrob well they're sure executed first
22:41 evilrob so may as well put them there
22:43 evilrob re-organizing the includes got it past that issue.
22:43 ipmb joined #salt
22:47 baweaver joined #salt
22:51 evilrob well I've got it so all the states complete.  tomorrow I'll see what I missed in the config.
22:51 evilrob iggy: thanks for the idea to re-org the includes.  it "shouldn't matter"(tm) but apparently it does.
22:54 claytron_ joined #salt
22:56 evilrob except for ordering....  looks like I'm adding 13 more require statements tomorrow. they don't run the first time, but the second highstate of the box, they run fine
22:56 Akhter joined #salt
22:57 isomarcte joined #salt
22:58 isomarcte Is there a way to match on grains in a sls file that is not the top.sls file? When I try to use the syntax I see in the docs e.g. 'os:Debian', I get an ID 'os:Debian' is not a dictionary message.
22:58 bfoxwell joined #salt
22:58 breakingmatter joined #salt
22:59 evilrob isomarcte: we're doing this in an init.sls for user/group setup https://paste.ee/p/oiCfw
23:00 evilrob the 'os' grain may contain the text 'Debian'
23:04 zsoftich2 joined #salt
23:06 isomarcte evilrob: thanks I'll take a look!
23:07 boargod joined #salt
23:08 mosen joined #salt
23:10 Aidin joined #salt
23:10 iggy isomarcte: if you don't figure it out, paste the states for us to look at
23:11 dthom91 joined #salt
23:13 evilrob is there a pastebin equiv that does yaml highlighting?
23:13 Aidin left #salt
23:19 conan_the_destro joined #salt
23:20 sakaYK joined #salt
23:20 TronPaul_ joined #salt
23:20 iggy gist?
23:21 iggy http://yaml-online-parser.appspot.com/
23:24 sunkist joined #salt
23:27 scoates joined #salt
23:27 enarciso joined #salt
23:29 isomarcte left #salt
23:38 otter768 joined #salt
23:38 druonysus joined #salt
23:38 druonysus joined #salt
23:55 gthank joined #salt
23:55 gthank joined #salt
23:59 claytron_ joined #salt

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