Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2018-03-06

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

All times shown according to UTC.

Time Nick Message
00:01 zerocoolback joined #salt
00:07 curio_casual joined #salt
00:09 onlyanegg joined #salt
00:49 sxar joined #salt
01:00 justan0theruser joined #salt
01:01 justan0theruser joined #salt
01:11 aviau joined #salt
01:12 druonysus joined #salt
01:12 druonysus joined #salt
01:25 tiwula joined #salt
01:47 tiwula joined #salt
01:54 hsfh joined #salt
01:56 cyborg-one joined #salt
01:58 cyborg-one left #salt
02:36 zerocoolback joined #salt
02:57 ilbot3 joined #salt
02:57 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.9, 2017.7.4 <+> RC for 2018.3.0 is out, please test it! <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic, and https://saltstackcommunity.herokuapp.com (for slack) <+> We are volunteers and may not have immediate answers
03:14 shiranaihito joined #salt
03:32 exarkun joined #salt
03:34 zerocoolback joined #salt
03:35 zerocoolback joined #salt
03:35 zerocoolback joined #salt
03:36 zerocoolback joined #salt
03:37 zerocoolback joined #salt
03:38 nielsk joined #salt
03:41 nielsk joined #salt
03:47 nielsk joined #salt
04:04 ddg joined #salt
04:23 masber joined #salt
04:51 racooper joined #salt
04:52 evle joined #salt
05:34 onlyanegg joined #salt
05:56 amy joined #salt
06:32 evle2 joined #salt
07:05 wongster80 joined #salt
07:17 permalac joined #salt
07:25 amy joined #salt
07:31 tuxawy joined #salt
07:38 zerocoolback joined #salt
07:41 Dejv joined #salt
07:42 ddg joined #salt
07:45 tuxawy joined #salt
08:05 zerocoolback joined #salt
08:06 zerocoolback joined #salt
08:06 zerocoolback joined #salt
08:07 zerocoolback joined #salt
08:08 zerocoolback joined #salt
08:13 Tucky joined #salt
08:26 Hybrid joined #salt
08:27 Ricardo1000 joined #salt
08:27 netcho joined #salt
08:28 pualj joined #salt
08:34 cbosdonnat joined #salt
08:34 cbosdonnat Hello
08:35 cbosdonnat I want to write a libvirt event reporting system, what would be preferred? an ever running loop registering libvirt listeners and send salt events or a beacon that runs super frequently?
08:38 Pjusur joined #salt
08:39 babilen Beacon sounds right in the context of Salt. I'm also not sure what "an ever running loop of […] libvirt listeners" entails exactly
08:40 babilen Hmm, registering might be important. Registering with what?
08:42 cbosdonnat babilen, libvirt has an even loop that clients can register on
08:44 cbosdonnat than all that small libvirt client would need to do it call an event.send
08:45 cbosdonnat the beacon option has the disadvantage to force maintaining a cache state and diffing the current state with it (and having a delay between the VM state change and the event)
08:46 babilen cbosdonnat: Which client would you register?
08:46 cbosdonnat babilen, a small one I would write ;)
08:47 babilen right
08:47 babilen That doesn't sound bad either
08:48 cbosdonnat the libvirt loop option sounds less salty though ;)
08:49 oyvindmo joined #salt
09:04 yidhra joined #salt
09:05 rgrundstrom Good morning everyone
09:07 babilen cbosdonnat: What granularity are you after? If you want events to be send right away, I'd suggest writing your small client that hooks into the event loop.
09:07 rgrundstrom I would like to target minions based on what network they are on (ex 192.168.1.0/24). Is it possible?
09:08 Sauvin joined #salt
09:08 babilen It is, look at S@ on https://docs.saltstack.com/en/latest/topics/targeting/compound.html
09:08 rgrundstrom babilen: Oh nice. Thank you
09:09 cbosdonnat babilen, ideally the shorter the better: mostly if this is monitored in a web UI: like someone pushes the start VM button, he'll expect the state to be changed rather soon ;)
09:09 cbosdonnat :q
09:09 cbosdonnat oops
09:13 rgrundstrom babilen: So I tested the -S (salt -S '192.168.1.0/24' test.ping) and it works like a charm. But how would i convert it to salt code? Example: grains['id'] == 'hostname' look like ??
09:15 rgrundstrom babilen: Let me explain what im doing. I want to target minions in my pillar so it sets diffrent parameters for diffrent networks
09:15 babilen I'd target that in the top.sls as a "match: compound"
09:17 onslack <netcho> moin all
09:17 Naresh joined #salt
09:18 babilen If you want to do something like that in jinja (which might add a lot of state to your, well, states .. You can use https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.network.html#salt.modules.network.ip_in_subnet
09:19 babilen onslack: moin moin
09:19 netcho onslack, lol :D
09:19 tuxawy joined #salt
09:20 netcho last week i ran this satte without any issues, nothing was changed and now i get https://hastebin.com/hinirafeju.sql
09:21 saltnoob58 joined #salt
09:22 babilen "Error rendering error message. Abort"
09:24 cewood joined #salt
09:25 babilen netcho: The first thing I check in situations like this are: 1. Any recent salt-* upgrades? 2. salt-{master,minion} version mismatch
09:27 onslack <netcho> ha
09:27 onslack <netcho> i found it
09:29 babilen What was the issue?
09:29 onslack <netcho> sec
09:30 onslack <netcho> i had ext_pillar for salt-cmdb configured for testing purposes
09:30 onslack <netcho> it has never been used
09:30 onslack <netcho> so mysql instance was terminated yesterday
09:31 onslack <netcho> ```[CRITICAL][7093] Pillar render error: Failed to load ext_pillar mysql: (2005, "Unknown MySQL server host 'salt-cmdb' (0)")```
09:50 oyvindmo joined #salt
10:01 nielsk joined #salt
10:03 rgrundstrom babilen: Hmm would it be something like this?? {% elif salt['network']['ip_in_subnet']({{ 'grains.fqdn_ip4' }},'192.168.1.0/24') %}
10:04 rgrundstrom Cause this does not work
10:04 babilen network.ip_in_subnet would be the function
10:05 babilen And you don't need {{ ... }} within {% ... %}
10:05 babilen Once again, I'd recommend to target those states in top.sls (or different configuration in the top.sls in your pillar, which would be even better)
10:06 onslack <mts-salt> this seems somewhat complex, what is it that you're trying to achieve?
10:07 babilen My guess would be "Run slightly different states for minions in different subnets", but that's impossible to say without seeing the actual SLS
10:08 onslack <mts-salt> if it's as simple as run a state or not then cidr matching would be best. if it's run a state with different config then cidr-based pillar may well be best
10:08 rgrundstrom babilen: im setting NTP servers depending on what subnet they are on. Hang on ill go thru the code and look if i can gist it
10:09 babilen You could configure the actual ntp servers via pillars and then target the value in the pillar's top.sls
10:10 onslack <ryan.walder> Should `.*` perms for the api give access to all endpoints (`minions`, `keys`, `jobs` etc..)?
10:10 babilen Maybe provide a sensible default in map.jinja (or even the SLS itself, but that mixes states with, well, configuration values again)
10:11 Kelsar joined #salt
10:12 onslack <mts-salt> rgrundstrom: cidr pillar sounds like exactly what you want
10:15 rgrundstrom babilen: https://gist.github.com/Robert-Grundstrom/f245e4cdad9b29039315c8321d9fcc0c#file-gistfile1-txt
10:17 babilen brb
10:17 onslack <mts-salt> rgrundstrom: i'd split these up into different state files and target based on the filters, rather than having one state file with conditional content like that
10:17 babilen Exactly
10:17 babilen And provide the configuration in pillars
10:18 onslack <mts-salt> put simply: salt can do the filtering for you
10:18 rgrundstrom onslack: That would generate a lot of sls files but I understand your point
10:18 babilen And targeting/selecting really is best one in top.sls
10:19 onslack <mts-salt> that's normal, yes. try asking people with large installations just how many files they have
10:19 rgrundstrom babilen: Ok thanks I will work towards that
10:19 rgrundstrom and onslack :)
10:19 onslack <mts-salt> i'd certainly prefer multiple files than try to work my way through a fewer large ones with complex filtering. it'd be horrendous to maintain
10:21 babilen Exactly
10:22 babilen I see every conditional in a SLS as a potential code smell
10:22 onslack <mts-salt> that and it would be more difficult to tell what should be applied at a glance
10:22 onslack <ryan.walder> You must love the official users formula then ;)
10:23 onslack <mts-salt> never looked, probably never will :p
10:23 babilen I make heavy use of defaults.merge in map.jinja these days as in: http://paste.debian.net/1013357/
10:24 babilen Quite easy to integrate different grains and the dictionaries can be imported from yaml files if they get too large
10:28 masber joined #salt
10:35 Hybrid joined #salt
10:37 inad922 joined #salt
11:19 mattfoxxx joined #salt
12:00 smead joined #salt
12:05 zerocoolback joined #salt
12:12 Mattch joined #salt
12:18 tuxawy joined #salt
12:27 lompik joined #salt
12:39 smead joined #salt
12:40 dlloyd joined #salt
12:45 bebeszi hello, it's me once again with this git_pillar stuff
12:46 bebeszi is there any tutorial besides documentation that can help with setting that git_pillar from step one to the end?
12:49 bebeszi because right now I have a git branch with two files: test.sls (containing pillar values) and top.sls with structure
12:49 bebeszi base:
12:49 bebeszi '*':
12:49 bebeszi - test
12:49 bebeszi in my config I have
12:49 bebeszi - git:
12:50 bebeszi - master:base ssh://git@10.30.1.1/pillar/test.git
12:50 bebeszi of course ext_pillar at the top
12:50 bebeszi I do update pillar with salt-run, it goes with True result
12:51 bebeszi then saltutil.refresh_pillar with also True result
12:51 bebeszi but none of the pillar items appear in the minion when listed: salt '*' get.items
12:52 bebeszi (git branch name is master)
12:52 bebeszi what have I missed? should I have local top.sls file?
12:53 bebeszi should I restart salt-minion service?
12:57 babilen Can you clone the repository using that reference as the user your master runs as?
12:58 smead joined #salt
12:59 babilen And that specification looks weird, which of the schemes on https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.git_pillar.html did you follow?
13:01 bebeszi babilen: yes, I can
13:01 bebeszi babilen: config before 2015.8.0 because I use gitpython
13:04 babilen And which of those schemes?
13:05 babilen I think you're after "- git: master:base ssh://git@10.30.1.1/pillar/test.git", but I'd like to check if I'm missing something
13:05 babilen Also .. is this the first time you use git pillars at all?
13:07 nku joined #salt
13:07 babilen You could also start easy and try "- git: master ssh://git@10.30.1.1/pillar/test.git"
13:08 bebeszi babilen: should my top.sls still be valid?
13:08 babilen That looks fine
13:09 bebeszi babilen: yeah, my first time
13:09 nku mh, i'm trying to install the trusty packages from repo.saltstack.com, but there are missing dependencies. "salt-common : Depends: python-tornado (>= 4.2.1) but 3.1.1-1ubuntu2 is to be installed"
13:10 nku doesn't seem like they are installable on trusty, or am i missing something
13:11 babilen apt-cache policy for those packages and the complete output on one of http://paste.debian.net, https://gist.github.com, http://sprunge.us, … would help, I guess
13:11 babilen (in particular the ones that can't be installed)
13:11 nku not much to see, really http://paste.debian.net/1013410/
13:12 nku hrm, maybe they assume i have trust-backports or something..
13:13 nku nope, only appears in xenial
13:13 nku matching python-tornado..
13:16 nku meh, that appliance only comes as a trust vm as well :\
13:20 babilen And "apt-cache show salt-minion" has what as dependency for python-tornado ?
13:21 nku Depends: init-system-helpers (>= 1.13~), sysv-rc (>= 2.88dsf-24) | file-rc (>= 0.8.16), python:any, salt-common (= 0.17.5+ds-1), python-m2crypto, python-crypto, python-msgpack, python-zmq (>= 13.1.0), dctrl-tools
13:22 babilen And salt-common?
13:22 babilen (sry, should have checked the dependency chain earlier)
13:22 nku python (>= 2.7), python (<< 2.8), python:any (>= 2.7.1-0ubuntu2), python-jinja2, python-yaml, python-pkg-resources
13:22 nku np
13:22 nku not sure why tornado would be needed anyway..
13:23 armyriad joined #salt
13:23 babilen It's a dependency of salt-common in Debian .. had assumed Saltstack's Ubuntu packages follow that
13:23 nku hm
13:24 nku those were the deps for 0.17.5+ds-1
13:24 nku not sure how to show them for a specific version
13:24 babilen Ah, yeah .. those are not the dependencies we're looking for *wave hand*
13:25 babilen apt-cache show salt-common -- should show both
13:25 nku oops. terminal was too small. right
13:25 nku Depends: python:any (>= 2.7.5-5~), python:any (<< 2.8), python, python-dateutil, python-jinja2, python-msgpack, python-apt, python-yaml, python-pkg-resources, python-requests (>= 1.0.0), python-tornado (>= 4.2.1), python-tornado (<< 5), python-psutil
13:25 nku yeah
13:26 babilen Looks as if Saltstack "forgot" to include backports for 4.2.1 in their repo
13:26 netcho_ joined #salt
13:26 nku possibly, yeah
13:27 babilen How annoying
13:28 babilen https://github.com/saltstack/salt/issues/27437
13:37 dendazen joined #salt
13:38 nku oh well. i guess i can live without salt on one machine..
13:38 nku we're working on a feature that will replace it anyway
13:38 Sauvin joined #salt
13:39 CrummyGumy_ joined #salt
14:03 CrummyGumy_ left #salt
14:12 edrocks joined #salt
14:16 amy joined #salt
14:16 Crummygummy_ joined #salt
14:19 Crummygummy_ Hi, can any of you help me with the mysql formula? I've been at this for weeks. There seems to be a timing issue where the operations happen on mysql before it is up. My state works because I can run it on my staging env ok. It breaks though on my live env which is a bit more powerful. Error is as follows.
14:20 Crummygummy_ InternalError: (1130, u"Host '127.0.0.1' is not allowed to connect to this MySQL server")
14:20 Crummygummy_ If I run this a second time it works without any issues
14:22 Crummygummy_ is there a way I can maybe delay a line of my top file for a few seconds to check if mysql has properly initiated? Any other ideas? This is driving me nuts
14:25 nku Crummygummy_: hrm, you could have a cmd.run or somesuch that does a sleep...
14:26 nku but somehow this doesn't sound right, if mysql is listening it should be configured, right?
14:26 nku do you import some data or something in your state?
14:28 Crummygummy_ nku, nothing wierd at that point. I create a file for root access, then I run mysql.server, mysql.saltuser, mysql.user
14:29 Crummygummy_ I'll try cmd sleep 30 to see if that works, just to experiment
14:31 tuxawy joined #salt
14:38 cgiroua joined #salt
14:58 aviau joined #salt
14:58 racooper joined #salt
15:01 spiette joined #salt
15:15 tuxawy joined #salt
15:20 colegatron joined #salt
15:23 aldevar joined #salt
15:29 fignew joined #salt
15:30 amy joined #salt
15:32 fignew joined #salt
15:40 doubletwist joined #salt
15:47 jrenner joined #salt
16:04 tiwula joined #salt
16:14 rjc joined #salt
16:16 mage_ joined #salt
16:37 motherfsck Crummygummy; I think I've ran into that error in the past when root/mysql user authenticaiton was required, but someone failed to stick the password needed in the pillar data.
16:41 Psi-Jack joined #salt
16:42 __number5__ joined #salt
16:43 edrocks joined #salt
16:47 egilh joined #salt
16:50 mrBen2k2k2k_ joined #salt
16:53 Psi-Jack joined #salt
16:57 colegatron left #salt
17:41 xet7 joined #salt
17:47 tuxawy joined #salt
17:57 nixjdm joined #salt
18:00 tuxawy joined #salt
18:04 sjorge joined #salt
18:08 onlyanegg joined #salt
18:14 xet7 joined #salt
18:24 cewood joined #salt
18:33 Trauma joined #salt
18:37 pcn What platform are you on? debian and derivatives like to startup services before there is configuration - you have to do extra work to avoid that.
18:37 __peke__ joined #salt
18:41 shoogz joined #salt
18:43 shoogz joined #salt
18:45 pcn Crummygummy_: ^^^
18:45 edrocks joined #salt
18:48 jesk_ joined #salt
18:48 vaelen joined #salt
18:48 fignew joined #salt
18:51 fignew joined #salt
18:54 jesk joined #salt
18:54 jesk hiho
18:54 jesk I'm a noob and want to start to learn and use Salt
18:54 jesk got my minions and server running
18:55 aldevar joined #salt
18:55 jesk and now I want to change the DNS resolvers on all Linux hosts
18:55 jesk can anyone point me to a working approach?
18:58 onlyanegg joined #salt
19:06 ymasson joined #salt
19:09 lordcirth_work jesk, eg, get all your hosts to use a different DNS server?  Or use a different resolver software?  Also what distros?
19:13 Edgan jesk: yes, but lordcirth_work's questions are good
19:21 schemanic joined #salt
19:24 schemanic I'm having a devil of a time with a state balking with an expected character warning
19:24 edrocks joined #salt
19:25 schemanic can anyone help me figure out what's going wrong with this state render error?
19:25 schemanic https://gist.github.com/anonymous/a3a22504fbc81fe2070718910bef8b4d
19:27 DammitJim joined #salt
19:29 dendazen joined #salt
19:31 DammitJim I'm using Ubuntu 16 and having a hard time using a salt state to create a service
19:31 DammitJim salt executes the state, but the service doesn't work until after rebooting the server
19:32 DammitJim I'm suing: service.running: -enable: True
19:33 wryfi hey all, working on a boron->nitrogen upgrade, and since updating salt-cloud i can no longer provision machines. i get various strack traces that all end with something like "SmartConnect() got an unexpected argument 'b64token'". i'm using the newest pyvmomi 6.5.0.2017.5-1 (both before and after the salt upgrade).
19:34 jesk lordcirth_work: all using same resolvers, and mostly centos, with little amount of debians.
19:35 jesk making it work on centos would be already very good, debian is nice to have
19:42 Gareth joined #salt
19:42 Miuku Use the resolver-formula?
19:51 J0hnSteel joined #salt
19:51 aldevar joined #salt
19:58 onlyanegg joined #salt
20:09 tuxawy joined #salt
20:15 ksa joined #salt
20:16 inad922 joined #salt
20:47 ksa joined #salt
20:50 curio_casual joined #salt
20:52 inad922 joined #salt
20:52 edrocks joined #salt
20:57 rjc joined #salt
21:10 MTecknology schemanic: doesn't it tell you?!  That leading * is used for pointers.
21:13 druonysus joined #salt
21:13 druonysus joined #salt
21:15 cgiroua joined #salt
21:15 MTecknology schemanic: If you're curious- dpaste.com/39KBG2R
21:19 sh123124213 joined #salt
21:23 sh123124213 2016.11.9 does not support python3.x right ?
21:25 sh123124213 nvm
21:28 aldevar left #salt
21:38 onlyanegg joined #salt
21:46 syd_salt joined #salt
21:49 inad922 joined #salt
22:02 dendazen joined #salt
22:03 johnclyde joined #salt
22:05 edrocks joined #salt
22:22 druonysus joined #salt
22:22 druonysus joined #salt
22:40 druonysuse joined #salt
22:40 druonysuse joined #salt
22:50 masber joined #salt
22:55 masuberu joined #salt
23:09 jose1711 joined #salt
23:10 jose1711 hello, why is it impossible to have 2 or more times of file.managed under one state id?
23:11 jose1711 like.. i want to call my state "2 files" and have /tmp/file1 and /tmp/file2 managed
23:12 curio_casual jose1711: I'd suggest using "- names:" https://docs.saltstack.com/en/latest/ref/states/highstate.html#names-declaration
23:13 jose1711 thank you, so the general rule of thumb.. no more than one module name inside a single state_id, correct?
23:15 curio_casual generally yeah-- tbh I wasn't aware there was a problem defining more than 2 since I've never had cause to try
23:19 onlyanegg joined #salt
23:22 hemebond "no more than one module._function_ combo in a state"
23:22 MTecknology jose1711: the requisite system would have no way of knowing which one is the correct requisit.
23:23 hemebond Wait, what I said was wrong.
23:24 MTecknology also- I tend to find that if that's something you need, then you're probably doing something that could use lots of optimization.
23:26 MTecknology jose1711: or are you saying you want to manage two different files using the same state?
23:32 curio_casual MTecknology: https://gist.github.com/curiositycasualty/df82e8d14ca7968a02d3b2937e30f7fc ?
23:33 pcdummy I thought two 'file' in one state doesn't work.
23:33 jose1711 MTecknology: that is correct, yes. i do not see a need for extra ID though
23:33 exarkun joined #salt
23:34 MTecknology jose1711: that's easy peasy- {% for fname in ['file1', 'file2'] %} /etc/salt/minion.d/{{fname}}: file.managed: - source: salt://etc/salt/minion.d/{{fname}} {% endfor %}
23:36 jose1711 i was thinking this.. but that does not work: https://pastebin.com/hYZT8Mu1
23:36 MTecknology wowzers.. no
23:37 jose1711 one is supposed to be just a single file, the other is a directory structure
23:37 jose1711 bad practice at its best?
23:37 MTecknology that's two different states, then
23:37 MTecknology you're managing the state of two different things
23:38 jose1711 understood
23:39 toastedpenguin joined #salt
23:40 jose1711 does it automatically mean that i need 2 sls files? or i can still put it into one .sls file but with two IDs?
23:41 MTecknology You can have as many states in an sls file as you want
23:42 jose1711 thank you
23:42 MTecknology fwiw- if that's really what you cared about, it would have saved you a lot of time if you'd started with that question first.
23:44 jose1711 well.. it's often a problem.. to place the correct question :-)
23:44 MTecknology heheh, I can get that, and the time wasn't wasted anyway, since you learned other things too.
23:44 sayyid9000 joined #salt
23:46 jose1711 true
23:50 MTecknology Doesn't salt have aliases so that you can target an alternate minion id?
23:51 jose1711 wow... that file.recurse is seriosly inefficient for many small files :-/
23:52 dendazen joined #salt
23:52 eculver joined #salt
23:52 MTecknology depends on how you're getting the files there, but ya, probably
23:52 MTecknology I tend to avoid file.recurse
23:52 jose1711 via salt:// protocol
23:52 jose1711 so you do tar and then untar via cmd.run?
23:53 MTecknology heck no!
23:53 jose1711 then.. git? :-)
23:53 jose1711 as a file backend
23:53 MTecknology I'm an admin, not a devops
23:53 MTecknology ya, git is my choice
23:54 jose1711 thanks for the tip, i will give it a shot tomorrow. raspberry pi is a good client to test.. differences stand out easily when comparing minutes :-)
23:54 MTecknology rpi3?
23:54 whytewolf I only tend to use file.recurse if i need them to go through a template render system. other wise so many other options that are faster. also don't need cmd.run to untar an archive
23:55 lkthomas gtmanfred, you around ?
23:55 jose1711 no, zero logged via openvpn on 3g modem
23:55 MTecknology heheh... I have git.latest with a .gitignore that doesn't include files I manage manually.
23:56 MTecknology that excludes*
23:56 jose1711 okok.. modules.archive.. so many things to read
23:57 MTecknology whytewolf: I swear we had aliases for minions?! Where did it go? :(
23:57 MTecknology Oh! am I thinking nodegroups?
23:57 whytewolf i think you are thinking nodegroups
23:58 MTecknology So then I'll just have one group for every minion... that works
23:58 sh123124213 joined #salt
23:59 zerocoolback joined #salt
23:59 MTecknology I'm getting ready to rename all of my minions to a standardized naming scheme that I just got approved. I'm going to leave the hostname unchanged because that would break dang near everything, then update all the states, and finally be able to start migrating pillar data and states to some level of sanity.

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