Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-07-14

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

All times shown according to UTC.

Time Nick Message
00:00 kerrick joined #salt
00:07 shoemonkey joined #salt
00:08 kerrick joined #salt
00:19 fracklen joined #salt
00:21 censorshipwreck joined #salt
00:22 censorshipwreck joined #salt
00:23 leonkatz joined #salt
00:25 nixjdm_ joined #salt
00:36 shoemonkey joined #salt
00:58 ssplatt joined #salt
01:02 kerrick joined #salt
01:10 joe_n joined #salt
01:21 dendazen joined #salt
01:25 nixjdm_ joined #salt
01:40 jas02 joined #salt
01:46 Shirkdog joined #salt
01:47 gnomethrower joined #salt
01:50 kerrick joined #salt
01:52 joe__n joined #salt
01:57 zerocool_ joined #salt
01:59 nku joined #salt
02:02 mikea Anyone got any tips for creating a state to join a windows domain using adcli or realm?
02:02 mikea I'm thinking adcli to join the domain, then manage sssd.conf with a template
02:03 noobiedubie joined #salt
02:13 mvensky joined #salt
02:24 eichiro joined #salt
02:24 dxiri joined #salt
02:25 nixjdm_ joined #salt
02:26 joe_n joined #salt
02:27 evle joined #salt
02:27 mbuf joined #salt
03:06 dxiri joined #salt
03:25 nixjdm_ joined #salt
03:58 jas02 joined #salt
03:58 onlyanegg joined #salt
04:10 dxiri joined #salt
04:11 dxiri joined #salt
04:11 mvensky joined #salt
04:21 fracklen joined #salt
04:24 auzty joined #salt
04:25 nixjdm_ joined #salt
04:30 onlyanegg joined #salt
04:31 auzty i plan to auto accept with define the autosign.conf , but i run into a problem -> stranger minion can connect to my master if know my autosign.conf hostname pattern, how i solve it?
04:49 onlyanegg joined #salt
05:17 Bock joined #salt
05:18 edrocks joined #salt
05:22 Bock joined #salt
05:25 nixjdm_ joined #salt
05:50 onlyanegg joined #salt
05:51 cyteen joined #salt
05:59 felskrone joined #salt
06:06 donmichelangelo joined #salt
06:24 mbuf Is there an opennms formula to use with Salt?
06:24 mvensky joined #salt
06:24 jas02 joined #salt
06:25 nixjdm_ joined #salt
06:29 do3meli joined #salt
06:29 do3meli left #salt
06:38 joe_n joined #salt
06:39 LeProvokateur joined #salt
06:43 xDamox joined #salt
06:45 cyborg-one joined #salt
06:51 c06 joined #salt
06:52 ahrs joined #salt
06:53 c06 hi all
06:54 c06 is there any way to debug the reactors. i got the beacons in my master node but rector is not getting called.
06:55 hemebond c06: Are you watching the event bus?
06:55 hemebond Are you sure your reactor is matching an event?
06:56 c06 hemebond: yes i am watching one sec i am making those outputs in pastebin
06:59 c06 hemebond: https://pastebin.com/wHc2kNzt
07:00 hemebond So you're trying to do the equivalent of "salt id state.apply service apache2 start"?
07:00 hemebond That doesn't make sense.
07:00 c06 yes whenever apache is down i will check with ps, then i will trigger the reactor
07:01 hemebond Sure, but you're trying to use `state.apply` to restart a service.
07:01 hemebond You should be calling `local.service.restart`
07:02 c06 hemebond: oops initially i used sls file, then i changed to run a command..
07:02 c06 hemebond: ty dude i will change and let you know
07:02 hemebond ????
07:07 iggy auzty: don't use autosign? Do you have some sort of CMDB that you can look up minions in?
07:10 jas02 joined #salt
07:24 JohnnyRun joined #salt
07:26 nixjdm_ joined #salt
07:26 c06 hemebond: i changed to local.cmd.run still it's not getting triggered
07:27 hemebond c06: Have you checked the master log for errors?
07:28 c06 hemebond: but no msgs in trace log
07:29 c06 hemebond: https://pastebin.com/ruuXJHbr
07:29 zulutango joined #salt
07:30 hemebond Try separating your args
07:31 c06 means?
07:31 hemebond Instead of - service apache2 restart
07:31 hemebond - service\n- apache2\n- restart
07:32 c06 dude it will take as a list correct me if i am wrng
07:33 hemebond yeah
07:33 c06 no action dude
07:33 c06 anyway to debug.?
07:34 hemebond You don't see any event in the event bus?
07:34 c06 in event bus i am getting events only reactor is not working
07:35 hemebond You restarted your master after adding the reactor, yeah?
07:35 c06 yeah i did for every changes
07:36 c06 you want to inputs (logs, sls files configuration)
07:36 c06 **any
07:37 hemebond I just noticed the path to your reactor SLS doesn't start with /
07:40 c06 i think someone blocked me..? msg unable to send
07:40 hemebond ?
07:40 c06 this one -> /srv/reactor/starter.sls
07:40 hemebond yeah
07:42 c06 this is the path for my reactor file..  hemebond: ping me once you get into the channel.. :)
07:44 JohnnyRun joined #salt
07:45 hemebond joined #salt
07:47 mpanetta joined #salt
07:48 c06 hemebond: got it syntax error in reactor.conf file -> correct one -> https://pastebin.com/L3bkx0Qf
07:49 c06 i think error log messages have to update in salt-master..
07:51 onlyanegg joined #salt
07:51 jas02 joined #salt
07:53 jas02 joined #salt
07:54 hemebond The path still doesn't have the leading / does it work?
07:55 Rumbles joined #salt
07:57 c06 hemebond: with/without (/) also its working
07:58 hemebond Oh it's all working now? Cool.
07:58 c06 yes only 'tag': (') is the problem.. ty dude
07:59 Mogget joined #salt
07:59 mikecmpbll joined #salt
08:06 permalac joined #salt
08:09 rory joined #salt
08:11 rory left #salt
08:12 pbandark joined #salt
08:13 kyuuri joined #salt
08:25 nixjdm_ joined #salt
08:25 Rumbles joined #salt
08:36 gmoro joined #salt
08:38 preludedrew joined #salt
08:45 aldevar joined #salt
08:46 zha joined #salt
08:46 zha left #salt
08:47 JohnnyRun joined #salt
08:51 fracklen joined #salt
08:52 Ricardo1000 joined #salt
08:54 avasiu joined #salt
09:01 smartalek joined #salt
09:24 cyborg-one joined #salt
09:24 avasiu joined #salt
09:24 Reverend joined #salt
09:25 kyuuri Hi, I am new to SaltStack. I want to write a custom returner to store some returned values from a custom execution module. The data should be stored on the server where the salt-master runs and the master should do the job of writing the data to the database.
09:26 nixjdm_ joined #salt
09:26 kyuuri How can I introduce the custom returner to the salt-master? Is it sufficient to just add a python module to /var/cache/salt/master/extmods/returners and put "extension_modules: /var/cache/salt/master/extmods/" in the master config file?
09:27 high_fiver joined #salt
09:30 cyborg-one joined #salt
09:32 tys_ joined #salt
09:43 peters-tx joined #salt
09:47 Naresh joined #salt
09:48 tys_ joined #salt
09:52 onlyanegg joined #salt
10:02 tys_ left #salt
10:08 tys101010 joined #salt
10:09 J0hnSteel joined #salt
10:12 JohnnyRun joined #salt
10:19 zerocoolback joined #salt
10:21 edrocks joined #salt
10:26 nixjdm_ joined #salt
10:30 colttt hello, is it possible to target like all hosts where tru from this command: salt '*' file.file_exists /foo/bar
10:31 colttt hello is it possible to target minions only when a check before (eg; filie.file_exist)  are true?
10:32 fracklen joined #salt
10:34 c06 colttt: what you actually want to do?
10:35 c06 colttt: https://docs.saltstack.com/en/latest/ref/states/requisites.html -> refer this it will satisfy your requirement
10:36 colttt c06: i want to target only the minios if the following is "true"  salt '*' file.file_exists /foor/bar <- all minion where I am getting a true I will run an other command (rename the file)
10:38 c06 colttt: refer the above link which i shared you can do that one by writing state files(.sls)
10:48 Ricardo1000 joined #salt
10:54 c06 anyone worked with dockerng state modules.?
10:57 c06 using dockerng if i create docker container its get into stop(Exited) state. i used start: and detach: as True but its not working
11:02 high_fiver joined #salt
11:06 zerocoolback joined #salt
11:13 AngelOfDeath joined #salt
11:19 impi joined #salt
11:20 mquin joined #salt
11:24 AngelOfDeath joined #salt
11:26 nixjdm_ joined #salt
11:28 hemebond kyuuri: Returners are used by minions.
11:28 hemebond kyuuri: I think there might be something like a custom job cache backend thing that a master can use.
11:28 smartalek joined #salt
11:29 hemebond kyuuri: https://docs.saltstack.com/en/latest/topics/jobs/external_cache.html
11:31 joe__n joined #salt
11:31 joe_n joined #salt
11:34 colttt c06: ok, but with modules it is not possible, right?
11:34 kyuuri hemebond: Thank you for your response. Yes, I played around with the master_job_cache. But if I reconfigure that one, I think it would pose the problem, that all my returned values would be redirected to that specific returner
11:35 kyuuri (as I understand, one can basically use returners on the master to extend the job cache stuff, but also to transform the returned data as one wishes, see https://docs.saltstack.com/en/latest/ref/returners/#writing-a-returner)
11:35 joe__n joined #salt
11:36 joe__n joined #salt
11:36 c06 colttt: i think so. for my view hemebond is more expert than me
11:36 joe_n joined #salt
11:36 kyuuri hemebond: that's why I wanted to create a custom returner, which I would only call via the `--return my_custom_returner` statement, when I call my custom execution module
11:37 hemebond kyuuri: I'm afraid I don't have any experience with master returners, just regular ones.
11:38 AngelOfDeath joined #salt
11:38 hemebond colttt: Not that I know of. You could write a state that checks for the file and has other states that depend on it. Or just use the check to get a list of minions and use that list for the next command.
11:39 kyuuri hemebond: Alright, thank you nonetheless. :) Maybe someone else has tried the same thing as me and could me
11:41 AngelOfDeath left #salt
11:41 AngelOfDeath joined #salt
11:41 AngelOfDeath left #salt
11:43 jas02 joined #salt
11:44 joe_n Hey all, if anyone is looking for some part-time Salt work on a SaaS project, 100% remote, please PM me for more details
11:45 mquin joined #salt
11:45 AngelOfDeath joined #salt
11:46 AngelOfDeath Hellow
11:46 CrummyGummy Hi!
11:48 AngelOfDeath Would like to ask
11:48 AngelOfDeath How do I do a if, in saltstack
11:48 AngelOfDeath Which depend on a custom variable
11:49 AngelOfDeath Hopefully set from salt master
11:49 c06 https://docs.saltstack.com/en/latest/topics/tutorials/states_pt3.html
11:49 c06 AngelOfDeath: ^^
11:49 AngelOfDeath Ok, but I want to compare against True
11:49 AngelOfDeath not a string
11:50 c06 {% if var == 'True' %} or {% if var %}
11:50 AngelOfDeath I use: sudo salt '<hostname>' grains.setval bootstrap_mysql false
11:50 AngelOfDeath So then: {% if grains['bootstrap_mysql'] == 'True' %}
11:51 AngelOfDeath @c06 Thanks, trying it now
11:52 c06 AngelOfDeath: yw.. :)
11:52 onlyanegg joined #salt
12:00 jas02 joined #salt
12:00 colttt soo I got it:  for i in `salt --out txt '*' file.file_exists /foo/bar |grep True |cut -d ':' -f1` ; do salt $i file.rename /etc/bart /etc/lisa; done
12:05 c06 colttt: shell script + salt... nice first time seeing like this
12:06 citaret joined #salt
12:10 jas02_ joined #salt
12:12 dendazen joined #salt
12:13 jas02_ joined #salt
12:19 colttt c06: I guess that is a compliment, thanks for this! :)
12:21 c06 :)..
12:23 edrocks joined #salt
12:25 nixjdm_ joined #salt
12:26 jas02 joined #salt
12:29 mquin joined #salt
12:31 ssplatt joined #salt
12:32 c06 left #salt
12:35 aboe joined #salt
12:38 edrocks joined #salt
12:42 davidtio joined #salt
12:43 DeuX left #salt
12:43 DeuX joined #salt
12:44 DeuX good morning, afternoon and evening
12:44 DeuX Is there anyone from SaltStack here ?
12:47 jdipierro joined #salt
12:49 XenophonF Nobody here but us chickens.
12:50 XenophonF If you're looking for an official support channel, you can probably get one from SaltStack... for money.
12:51 XenophonF But if you're comfortable with community support, well you've come to the right place!  How can we help?
12:54 nebuchadnezzar joined #salt
13:01 jas02 joined #salt
13:04 jas02_ joined #salt
13:06 edrocks joined #salt
13:06 mbuf XenophonF, haha!
13:06 F30 joined #salt
13:08 flebel joined #salt
13:09 drawsmcgraw joined #salt
13:09 F30 Hi, do any of you know how to make an `onchanges_in` handler dependent on *what* changes happened?
13:09 F30 https://github.com/saltstack/salt/issues/883 mentions something about "states having access to the running dict", but neither do I know what the running dict is, nor can I find docs on that.
13:12 Ricardo1000 joined #salt
13:12 jas02 joined #salt
13:19 evle joined #salt
13:21 Neighbour Hmm, did the yaml-notation for nodegroups get reverted in 2016.11.6? (introduced in 2016.11.0) I'm getting errors on it, and didn't get it in 2016.11.5
13:23 edrocks is it safe to put secrets inside of files that are in your state folder. I know state sls files are viewable by any minion but are regular files? I intend to send it to other minions via `file.managed`
13:23 onlyanegg joined #salt
13:24 Neighbour edrocks: No, that is not safe
13:24 nixjdm_ joined #salt
13:24 Neighbour secrets should be restricted to the pillar
13:25 edrocks Neighbour: are their any docs about this?
13:25 Neighbour probably :)
13:25 edrocks so it isn't safe to say have a cert file be managed just by putting it in `mysaltstates/mycert.key` and using `file.managed`?
13:26 thinkt4nk joined #salt
13:26 ssplatt best practice at the moment is to encrypt it with gpg and put it in pillar
13:26 Neighbour ^
13:27 ssplatt https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.gpg.html
13:34 lclemens joined #salt
13:38 edrocks ssplatt: is there any easy way to load entire files as a pillar key?
13:39 ssplatt uh, you mean like {%- from "crowd/map.jinja" import crowd with context %}
13:40 edrocks I mean import the entire file contents as a string
13:40 edrocks (I have a bunch of files I need to now convert to pillars)
13:40 ssplatt not sure what you mean.
13:40 ssplatt https://github.com/ssplatt/crowd-formula/blob/master/pillar-custom.sls
13:41 ssplatt all gets imported under crowd dict.
13:41 ssplatt so i can {{ crowd.enabled }}
13:41 edrocks I have a bunch of key and cert files
13:41 ssplatt https://github.com/ssplatt/crowd-formula/blob/master/crowd/init.sls#L6
13:42 ssplatt there is a certificate.managed state
13:42 ssplatt that can do - contents:  iirc
13:43 ssplatt but i just put ours in pillar itself.  like    key: |\n    — KEY THINGS —
13:44 ssplatt exactly like the gpg examples on the gpg renderer doc page
13:46 zerocoolback joined #salt
13:51 cgiroua joined #salt
13:57 kyuuri hemebond: Okay, I think I do have to use the returners on the minions... (https://docs.saltstack.com/en/latest/ref/returners/#custom-returners) <- Here they say, one just has to put the returners into `__returners` in the file_roots. I did that, and syncing with the minions worked, but when I call the returner, the minion's log shows "[salt.minion      ][ERROR   ][22086] Returner my_returner.returner could not be loaded: 'my_returner.re
13:58 kyuuri hemebond: But there is a returner function inside the my_returner file. Do you maybe have an idea, why the function is not found?
14:02 sp0097 joined #salt
14:14 fritz09 joined #salt
14:15 deuscapturus joined #salt
14:17 onlyanegg joined #salt
14:22 _JZ_ joined #salt
14:25 nixjdm_ joined #salt
14:28 janshuje joined #salt
14:29 janshuje How does one find out which of the minions in the /etc/salt/minions file dont have a key in the salt-key -L list?
14:33 deuscapturus joined #salt
14:39 mpanetta joined #salt
14:43 fracklen joined #salt
14:45 jdipierro joined #salt
14:54 mpanetta joined #salt
14:58 deuscapturus joined #salt
15:01 lordcirth_work janshuje, you could sort both then diff
15:02 sarcasticadmin joined #salt
15:04 sp0097 joined #salt
15:10 jdipierro joined #salt
15:14 Felgar joined #salt
15:14 btorch joined #salt
15:15 btorch is there a loglevel where a salt highstate only shows the output for what is being changed and not everything ?
15:19 nkuttler btorch: state_verbose
15:19 onlyanegg btorch: maybe you want --state-output
15:19 hatifnatt btorch: --state-output=changes
15:21 hatifnatt Can't understand how to use service.mod_watch does I need separate ID? I simpy need reload instead of restart.
15:23 absolutejam ugh
15:23 absolutejam I'm getting so frustrated
15:25 absolutejam I'm using this custom module https://hastebin.com/gidexarupi.py
15:25 btorch ah cool thanks
15:25 nixjdm_ joined #salt
15:25 absolutejam It basically checks the contents of a pillar (list) against a list of folders
15:27 hatifnatt Looks like I simpy need '- reload: True' in 'service.running'.
15:30 absolutejam so if there's an item called 'banana' in the pillar list and a folder called 'banana', it returns this folder in a list
15:30 absolutejam so, if I run it manually it on a minion, it works
15:30 onlyanegg absolutejam: is that for like globbing pillar files?
15:31 absolutejam eg salt 'minion' utils.match_config_to_folder 'nodegroups' 'somefolder/subdir'
15:31 absolutejam I use it to match entries in 'nodegroups' pillar against folders
15:31 absolutejam so I can deploy config files based on group membership (nodegroups)
15:31 absolutejam Running it manually works
15:32 absolutejam but if I run it in a state (example: https://hastebin.com/pobifebiki.bash)
15:32 absolutejam it returns an extra one that's not matched
15:32 absolutejam but that item isn't in the pillar...
15:33 absolutejam I'm at a loss
15:33 noobiedubie joined #salt
15:37 Inveracity joined #salt
15:39 jdipierro joined #salt
15:40 absolutejam There's a salt-users user group right?
15:40 absolutejam I'll post it there
15:41 deuscapturus joined #salt
15:42 fatal_exception joined #salt
15:42 dxiri joined #salt
15:43 woodtablet joined #salt
15:47 jas02 joined #salt
15:47 JohnnyRun joined #salt
15:58 _KaszpiR_ joined #salt
16:00 fatal_exception joined #salt
16:02 racooper joined #salt
16:10 v3x joined #salt
16:10 jas02 joined #salt
16:11 justan0theruser joined #salt
16:11 jeblair joined #salt
16:11 jas02 joined #salt
16:12 justan0theruser joined #salt
16:14 bob_twinkles joined #salt
16:18 ksk joined #salt
16:24 nixjdm_ joined #salt
16:24 kerrick joined #salt
16:26 sarcasticadmin joined #salt
16:26 tkojames joined #salt
16:30 sjorge joined #salt
16:34 xDamox joined #salt
16:34 edrocks joined #salt
16:36 jdipierro joined #salt
16:38 joe_n joined #salt
16:42 mikecmpbll joined #salt
16:47 jdipierro joined #salt
16:48 deuscapturus joined #salt
16:48 justanotheruser joined #salt
16:49 kerrick joined #salt
16:51 justanotheruser joined #salt
16:53 jas02 joined #salt
16:59 sarcasticadm joined #salt
17:01 sjorge joined #salt
17:06 leonkatz joined #salt
17:18 AvengerMoJo joined #salt
17:24 stomith joined #salt
17:25 sjorge joined #salt
17:25 nixjdm_ joined #salt
17:28 impi joined #salt
17:32 Edgan edrocks: https://fabianlee.org/2016/10/18/saltstack-keeping-salt-pillar-data-encrypted-using-gpg/
17:33 edrocks Edgan: thanks. I'm setting up `file_tree` with `ext_pillar` now
17:34 edrocks is the point of gpg to just make it so that your pillars aren't plain text if you check them into git? Are pillars encrypted when they are sent to a minion if you don't use gpg?
17:35 Edgan edrocks: The transport of data between master and minion is encrypted.
17:35 Edgan edrocks: yes, gpg is about in the git repo. That you could make your git repo public on github, and not worry
17:35 edrocks Edgan: ok, so it's just protecting against plain text in git then
17:36 edrocks Edgan: thanks!
17:37 lclemens joined #salt
17:38 lclemens_ joined #salt
17:44 deuscapturus joined #salt
17:44 fritz09 joined #salt
17:50 stomith I'm interested in putting the server hostname in a file that I'm copying over. How would I assign grains['host'] to a variable? Do I need to assign it to a variable in the sls file?
17:50 stomith in a jinja template, I'm assuming
17:51 jas02 joined #salt
17:51 astronouth7303 Informationally, what are people doing for monitoring/logging of minions? Are there any logging systems that integrate with salt?
17:52 astronouth7303 stomith: `{{grains['host']}}`? I'm not understanding what's hard.
17:52 stomith It's not hard, but I just didn't know how to do it.
17:53 stomith I can just put {{grains['host']}} directly in the template?
17:54 astronouth7303 I'm using something like this, but see https://github.com/saltstack/salt/issues/42145 https://www.irccloud.com/pastebin/9O6APL17/hostname.sls
17:55 astronouth7303 note that the `host` grain is read from the system hostname (ie, the kernel), so you may wish to choose a different grain name if you're explicitly assigning one
17:55 astronouth7303 (i'm using `dns_name`)
17:55 stomith that's probably a better choice, thanks
17:56 astronouth7303 stomith: read up on the jinja templating
17:56 dxiri_ joined #salt
17:56 stomith astronouth7303: I did that before coming here, but it's not exactly making a ton of sense.
17:56 astronouth7303 https://docs.saltstack.com/en/getstarted/config/jinja.html and https://docs.saltstack.com/en/latest/topics/jinja/index.html
18:05 meca Hi, I set up a custom returner in _returners directory at the root of my gitfsremote
18:06 meca when I sync_returners I see it appear
18:06 meca but when I run a command with `--return ..` I see the Error: `Could not LazyLoad...`
18:07 gtmanfred meca: can you run the command with --return on the minion using salt-call, and paste the full stack trace to gist.github.com?
18:07 meca yeah that's what I'm doing
18:07 meca Sure thing
18:10 meca gtmanfred: I just removed `__virtualname__ =`, ran sync_retruner and it worked
18:11 meca I'll let you know if I can reproduce the issue
18:16 gtmanfred `__virtualname__` should be the name of the returner
18:16 meca Right, that's what I had set it as
18:16 gtmanfred and should be what is returned from __virtual__ when the module should be loaded
18:16 meca And then --return <myvirtualname>
18:17 gtmanfred def __virtual__():
18:17 gtmanfred return __virtualname__
18:17 meca Ah ok
18:17 meca Thank you
18:17 meca One more question:
18:17 gtmanfred you can do other checks in there, and return (False, 'Library X needs to be installed)
18:17 gtmanfred if it shouldn't be loaded
18:17 meca It works from the master with a salt-call, but I just ran it on a minion and nothing happened
18:18 gtmanfred https://docs.saltstack.com/en/latest/ref/modules/#virtual-function
18:18 gtmanfred did you run salt \* saltutil.sync_returners?
18:21 meca gtmanfred: Yes I did, and it returned that the returner was loaded
18:22 gtmanfred if you log into one of those other minions, and call salt-call with -l debug does it return an error?
18:22 meca https://gist.github.com/mecavity/e17abd45179af370c0ea19621c7d5966
18:23 gtmanfred hrm
18:23 gtmanfred it looks like it is using it.
18:23 gtmanfred what are you looking at to see that makes you think it isn't working when called from the master?
18:24 meca My redis queue
18:24 meca I just salt-call on the minion
18:24 meca No errors
18:24 meca But nothing added in redis either
18:24 meca It's all on gitfs, could that be an issue?
18:24 nixjdm_ joined #salt
18:25 gtmanfred no, that should be fine
18:25 gtmanfred is there a way to watch redis connections to see if salt is connecting?
18:25 gtmanfred also, add a bunch of log messages in your custom returner
18:25 gtmanfred also
18:25 gtmanfred you can check that it is in /var/cache/salt/minion/extmods/returners
18:25 gtmanfred on the minion
18:26 meca I see it loaded in the cache on the minion /var/cache/salt/minion/extmods/returners/aqreturn.py
18:26 meca you beat me to it :)
18:26 gtmanfred cool, yeah i would throw in some extra log messages
18:28 meca Okay thanks
18:28 cyborg-one joined #salt
18:32 cyteen joined #salt
18:34 xet7 joined #salt
18:36 newb joined #salt
18:38 meca gtmanfred: Sorry for being a pain but when I updated my runner, git push and `saltutil.sync_returners` the cache remains the same
18:38 meca I had this earlier also
18:39 meca it took a long time for the returner cache to update
18:39 gtmanfred make sure you wait for your gitfs cache to update
18:39 gtmanfred or run salt-run fileserver.update backend=git
18:39 meca Even though running `saltutil.sync_returners` shows me in green that it has update that specific returner
18:39 gtmanfred then run your sync_returners
18:40 meca I have tried the `fileserver.update`
18:40 meca same result
18:40 whytewolf meca: here is a orchestration i run that pretty much forces update of everything. https://github.com/whytewolf/salt-phase0-orch/blob/master/orch/sys/salt/update.sls
18:41 whytewolf also. if it is setup in the master. it should be salt-run saltutil.sync_returners. not the salt-call version
18:42 meca whytewolf: Thank you, but I ran these commands by hand
18:42 meca and yes, using `salt-run`
18:42 meca on my master
18:42 gtmanfred you are running salt-run saltutils.sync_returners?
18:43 whytewolf should be both just to be safe
18:43 gtmanfred that will only sync the returners to the master extmod cache, you need to run saltutil.sync_returners on the minion with the execution module to sync them there
18:43 whytewolf was it setup on the master or the minion or both?
18:43 meca Ah!
18:44 meca I understand
18:44 meca I was only using `salt-run` and it only updates the master
18:44 meca My bad
18:44 meca That fixed
18:44 meca it
18:44 gtmanfred cool
18:44 meca Thank you :)
18:44 gtmanfred no problem
18:45 whytewolf thats one of the reasons i wrote that stupid orch. so i don't run those by hand and don't have to think about what needs to be run where anymore :P
18:51 astronouth7303 that's the reason i stole their stupid orch and set it to run every time i pushed to git
18:51 newb left #salt
18:51 deuscapturus joined #salt
18:52 petong joined #salt
18:52 thx4thehelp joined #salt
18:57 sh123124213 joined #salt
18:58 druonysus joined #salt
18:58 druonysus joined #salt
18:59 druonysus_ joined #salt
19:00 jas02 joined #salt
19:00 druonysus_ joined #salt
19:01 preludedrew joined #salt
19:02 jas02 joined #salt
19:03 druonysus joined #salt
19:03 druonysus joined #salt
19:03 druonysus_ joined #salt
19:05 jas02_ joined #salt
19:14 jas02 joined #salt
19:15 StolenToast grain "os_release_info" seems to return a dictionary, three lines starting with '-', but how do I get the indexes?
19:15 StolenToast they aren't named
19:16 jas02 joined #salt
19:18 iggy [0] [1] [2] ?
19:18 StolenToast I tried grains.item os_release_info 1
19:19 StolenToast python error tells me it can't split a string
19:19 jas02_ joined #salt
19:19 StolenToast I also tried os_release_info[0]
19:20 lordcirth_work On my master, I see osrelease_info and it's: - 16 \n - 4
19:20 lordcirth_work ubuntu 16.04
19:20 StolenToast I've got the same thing just with three bits because it's CentOS
19:20 lordcirth_work What's with the underscore difference?
19:20 StolenToast oh I was typing it wrong here, my bad
19:20 lordcirth_work Oh ok good
19:20 StolenToast I have the right grain on my machine
19:21 iggy you can't do that on the command line
19:21 StolenToast I want to check if this node is CentOS 7.2 or 7.3
19:22 StolenToast if I can do this kind of thing in a state then that's good
19:22 lordcirth_work So, in python, eg in jinja, you should be able to just index [1] to get that
19:22 iggy you could do `salt -C 'G@os_release_info:1:2 or G@os_release_info:1:3' .... ` or something
19:22 jas02_ joined #salt
19:22 aldevar joined #salt
19:25 nixjdm_ joined #salt
19:29 sjorge joined #salt
19:30 jas02 joined #salt
19:33 jas02_ joined #salt
19:35 jas02 joined #salt
19:36 oida_ joined #salt
19:37 impi joined #salt
19:40 scottk_ joined #salt
19:41 scottk_ is there a way to copy the output of a salt command to a text file? or a way to keep a log of the command results?
19:44 sh123124213 scottk_: silly solution but works : salt -L minion test.ping > file.log
19:44 lordcirth_work scottk_, salt '*' test.ping | tee file.log
19:44 lordcirth_work it will, however, lose the colors.
19:46 whytewolf if you are not looking for long term solution you could just use the job cache
19:46 scottk_ thanks...colors are pretty helpful. :/
19:46 scottk_ where is the job cache stored?
19:47 whytewolf on the master. in the cache directory
19:47 whytewolf https://docs.saltstack.com/en/latest/topics/jobs/#the-jobs-runner
19:47 scottk_ thanks.
19:47 whytewolf although you could change that
19:52 deuscapturus joined #salt
19:53 whytewolf clear
19:53 whytewolf wrong window
19:53 whytewolf ...
19:55 lordcirth_work Not using ^L? :P
19:55 drawsmcgraw whytewolf: I like ctll-L   :P
19:55 whytewolf ctrl+L doesn't work in my term sessions
19:56 jas02 joined #salt
19:56 whytewolf most likely because of the tmux + ssh
19:57 jas02 joined #salt
19:59 swa_work joined #salt
19:59 scottk_ thanks for the help, I think what i'll do is run salt * test.ping -v, and copy the jid then run salt-run jobs.lookup_jid <jid> | tee file.log
20:03 astronouth7303 hm. I need to look up a couple of Jinja values based on CIDR. What's the best way to do that?
20:04 leonkatz left #salt
20:04 whytewolf define lookup by cidr
20:05 whytewolf or give some pseudo code
20:05 leonkatz joined #salt
20:05 astronouth7303 The minion's IP against a list of CIDRs
20:05 iggy ^ but probably something in the network module
20:06 whytewolf well are you doing a match or do you need the ip?
20:06 whytewolf if match then match.ipcidr if you need the ip then network.ipaddrs
20:07 astronouth7303 it's a datacenter thing
20:07 astronouth7303 i have a few services which have a different IP based on what CIDR you're part of
20:08 whytewolf that sounds like something that should go into different states that get targetted in top by cidr
20:08 whytewolf https://docs.saltstack.com/en/latest/topics/targeting/ipcidr.html
20:09 astronouth7303 the states are otherwise identical, though
20:10 whytewolf is it something that if properly crafted could be done through pillars that are targetted by cidr?
20:10 astronouth7303 oh! probably
20:12 leonkatz_ joined #salt
20:17 astronouth7303 thanks, that's what I was needing
20:17 leonkatz left #salt
20:18 whytewolf I'm just hoping they fixed the cidr targetting. it used to really mess up on some odd cidrs like a single ip cidr or any cidr that was less then /16
20:18 leonkatz joined #salt
20:20 edrocks joined #salt
20:21 astronouth7303 welp i guess i'll find out
20:21 noobiedubie joined #salt
20:21 viq scottk_: you could also look at salt-eventsd
20:23 leonkatz left #salt
20:25 nixjdm_ joined #salt
20:25 leonkatz joined #salt
20:25 leonkatz pillar['test']['myvalues'] is returning the whole dictionary under myvalues instead of just the first key under myvalue, has anyone see this behavior
20:26 leonkatz before
20:26 whytewolf leonkatz: um, that sounds like operating like designed. did you mean to add |first to it?
20:27 leonkatz the diction only has one key thogh
20:27 leonkatz the dictionary only has one key
20:27 leonkatz its got some sub dictionaries
20:27 toastedpenguin joined #salt
20:29 leonkatz so test:  \n myvalues: \n  value1: \n - item1 \n - item2
20:29 leonkatz all i want is "value1"
20:29 leonkatz but im getting a json of the whole thing
20:29 whytewolf yes
20:30 whytewolf because thats what you told it to do. at least with what you told us.
20:31 leonkatz so whats the right way to get that key
20:32 leonkatz i tried pillar['test']['myvalues'].key()
20:32 leonkatz but got an error
20:32 leonkatz and .item
20:32 viq how about [0] ?
20:33 leonkatz thanks let me try that
20:33 viq Also I believe that this syntax is usually recommended: salt['pillar.item']('test:myvalues')
20:36 whytewolf viq: well i did say |first earlyer ;)
20:36 Neighbour I prefer salt['pillar.get'](key, default)
20:38 leonkatz Jinja variable dict object has no element 0
20:39 leonkatz very strange
20:39 whytewolf leonkatz: what error did you get with keys?
20:39 leonkatz pillar['test']['myvalues'][0]
20:39 leonkatz is that correct
20:39 leonkatz i think the same
20:39 leonkatz no element keys
20:40 whytewolf did you try key or keys?
20:40 whytewolf it should be keys
20:40 whytewolf [or really keys()|first
20:41 leonkatz key()
20:41 leonkatz pillar['test']['myvalues'].key()
20:41 whytewolf yeah, key doesn't exist
20:41 whytewolf it is keys()|first
20:42 leonkatz thanks let me try that
20:42 xMopxShell Aside from jobs.active, is there a way to tell if a given job is running or not?
20:42 censorshipwreck joined #salt
20:43 whytewolf xMopxShell: you could look up the jid
20:44 whytewolf i guess you could use saltutil.is_running <possable command that started said job>
20:44 leonkatz thank you that did the trick
20:46 xMopxShell whytewolf: with something like jobs.lookup_jid? I didn't see a flag that looked like a completion flag from that's output
20:46 xMopxShell jobs.print_job appears to have a result section, i guess I could check if that is populated or not
20:47 whytewolf lookup_jid should have the result section also
20:49 xMopxShell Ah yep
20:49 tkojames We have an issue here where we will do a salt-minion update using salt for all our minions. Sometimes the minion service does not restart and we have to log into a  bunch of servers and restart the service. Does anybody else have this issue and if so any solutions?
20:50 kerrick joined #salt
20:50 whytewolf simple solution is to restart the minion twice.
20:51 deuscapturus joined #salt
20:51 viq tkojames: at.at to restart minin?
20:54 stomith how would you only display the first octet of an grains['ipv4'] in jinja?
20:55 stomith grains['ipv4'][1] gives the first range that's not localhost.. I'm wondering if split helps.
20:58 whytewolf you emean something like salt.grains.get('ipv4')[1].split('.')|first
20:59 whytewolf man i hate using the ip grains. not sure why everyone goes to them first
21:00 whytewolf the network module is just so much cleaner
21:01 aldevar1 joined #salt
21:09 astronouth7303 i use `network.ipaddrs` instead of `grains['ipv4']`
21:10 whytewolf and my headache thanks you for it :P
21:10 astronouth7303 the network module is pretty great
21:10 mquin joined #salt
21:10 astronouth7303 dnsutil's reliance on `dig` is annoying af
21:11 astronouth7303 especially since i so want to use it from jinja, before salt has a chance to install dig
21:12 scottk_ how can i count how many minions i have?
21:14 viq salt-key -L  ?
21:14 astronouth7303 how many minions are currently answering, how many the master thinks are up/down?
21:14 astronouth7303 how many you've had ever?
21:15 astronouth7303 i use (respectively) test.ping, manage.status, or manage.alived
21:16 whytewolf salt-key -l acc | tail -n +2 | wc -l
21:23 fracklen joined #salt
21:24 nixjdm_ joined #salt
21:28 drawsmcgraw left #salt
21:39 deuscapturus joined #salt
21:44 leonkatz joined #salt
21:50 pbandark1 joined #salt
21:53 aldevar joined #salt
22:02 kerrick joined #salt
22:14 aldevar left #salt
22:24 deuscapturus joined #salt
22:25 nixjdm_ joined #salt
22:28 kerrick joined #salt
22:35 jas02 joined #salt
22:38 brianthelion joined #salt
22:40 dendazen joined #salt
22:47 jas02 joined #salt
22:51 _KaszpiR_ joined #salt
22:53 jas02 joined #salt
22:57 stomith network module, check
23:02 kerrick joined #salt
23:03 heaje_ joined #salt
23:11 kerrick joined #salt
23:11 jas02 joined #salt
23:13 deuscapturus joined #salt
23:13 jas02_ joined #salt
23:14 armguy joined #salt
23:15 jas02_ joined #salt
23:23 nixjdm_ joined #salt
23:29 TheoSLC joined #salt
23:46 jas02 joined #salt
23:48 armguy joined #salt
23:52 jas02 joined #salt
23:55 edrocks joined #salt
23:57 DeuX I am trying to purchase saltstack enterprise, but response from the team seems to be slow

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