Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-09-20

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

All times shown according to UTC.

Time Nick Message
00:17 _aeris_ joined #salt
00:24 shoemonkey joined #salt
00:31 colegatron joined #salt
00:43 bcat_ joined #salt
00:50 smead joined #salt
00:50 tiwula joined #salt
00:52 teratoma joined #salt
00:53 ry joined #salt
00:58 onlyanegg joined #salt
01:12 GMAzrael joined #salt
01:33 GMAzrael joined #salt
01:37 swills joined #salt
01:37 swills joined #salt
01:55 ilbot3 joined #salt
01:55 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.7, 2017.7.1 <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic <+> We are volunteers and may not have immediate answers
01:59 hasues joined #salt
02:01 kukacz_ joined #salt
02:02 zerocool_ joined #salt
02:04 oida_ joined #salt
02:07 GMAzrael joined #salt
02:07 zerocoolback joined #salt
02:08 zerocoolback joined #salt
02:09 justanotheruser joined #salt
02:10 zerocoolback joined #salt
02:12 onlyanegg joined #salt
02:12 cgiroua joined #salt
02:26 Hybrid joined #salt
02:37 jmb13562 joined #salt
02:41 zerocoolback joined #salt
03:00 ivanjaros joined #salt
03:09 telecode101 joined #salt
03:12 jmb13562 joined #salt
03:14 telecode_101 joined #salt
03:14 icebal joined #salt
03:18 stanchan joined #salt
03:18 dendazen joined #salt
03:27 telecode_101 joined #salt
03:30 hasues left #salt
03:32 telecode101 joined #salt
03:33 ozialien joined #salt
03:35 telecode101 joined #salt
03:37 jmb13562 joined #salt
03:40 _JZ_ joined #salt
03:46 jmb13562 joined #salt
03:50 _JZ__ joined #salt
03:52 evle joined #salt
03:56 Cumulo741 joined #salt
04:05 Hybrid joined #salt
04:23 zerocool_ joined #salt
04:26 zerocool_ joined #salt
04:35 zerocoolback joined #salt
04:36 zerocoolback joined #salt
04:37 shoemonkey joined #salt
04:38 zerocoolback joined #salt
04:49 golodhrim|work joined #salt
04:51 tru_tru joined #salt
04:54 zerocoolback joined #salt
04:57 gawainlynch joined #salt
04:58 felskrone joined #salt
05:07 zerocoolback joined #salt
05:10 aneeshusa joined #salt
05:12 Rubin joined #salt
05:13 zerocoolback joined #salt
05:16 Bock joined #salt
05:25 zerocoolback joined #salt
05:38 eseyman joined #salt
05:45 GMAzrael joined #salt
06:07 jas02 joined #salt
06:08 jas02 joined #salt
06:09 Naresh joined #salt
06:13 do3meli joined #salt
06:13 ivanjaros joined #salt
06:15 do3meli left #salt
06:27 aldevar joined #salt
06:34 Ricardo1000 joined #salt
06:35 usernkey joined #salt
06:37 shoemonkey joined #salt
06:45 jas02 joined #salt
07:00 debian1121 joined #salt
07:05 Hybrid joined #salt
07:08 JohnnyRun joined #salt
07:10 johnj joined #salt
07:15 zulutango joined #salt
07:29 nledez joined #salt
07:29 nledez joined #salt
07:30 robman joined #salt
07:34 kwork joined #salt
07:35 kwork joined #salt
07:48 _KaszpiR_ joined #salt
07:50 o1e9 joined #salt
07:55 DanyC joined #salt
07:57 DanyC joined #salt
08:11 johnj joined #salt
08:22 vb29 joined #salt
08:25 vb29 Hi
08:25 vb29 I have a configuration file which looks like this:
08:25 vb29 com.work.dir=G:/work/programs/agents/br_sbt_gda_delivery/work
08:25 vb29 com.type.name=sample_name
08:25 vb29 I am trying to read the two parameters and trying to store the value using a jinja format. Any suggestions on how to achieve this?
08:31 Mattch joined #salt
08:35 sarcasticadmin joined #salt
08:38 shoemonkey joined #salt
09:03 schasi joined #salt
09:04 schasi Hello everyone
09:06 pbandark joined #salt
09:10 johnj joined #salt
09:15 vb29 joined #salt
09:35 yidhra joined #salt
09:53 smead joined #salt
10:07 nickadam joined #salt
10:11 johnj joined #salt
10:39 shoemonkey joined #salt
10:40 _ssn_06_ joined #salt
10:49 _ssn_06_ Hello guys is someone dealing with azura cloud ? I'm getting error like "[ERROR   ] Error creating newinstance on Azure.  The Virtual Machine could not be created. If you are using an already existing Cloud Service, make sure you set up the `port` variable corresponding to the SSH port exists and that the port number is not already in use. The following exception was thrown when trying to run the initial deployment:  Not Found"
10:49 _ssn_06_ could some one help me please with it ?
10:50 _ssn_06_ <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>ResourceNotFound</Code><Message>The hosted service does not exist.</Message></Error> Error: There was a profile error: Failed to deploy VM
10:50 Kelsar joined #salt
10:57 obi__ joined #salt
11:06 obitech joined #salt
11:07 obitech hey guys
11:07 obitech Got a quick question: how can I target a directory unpacked from a .tar where I don't know the exact name? Let's say I have a foo.tar.gz which will unpack into foobar/, but depending on the version of the archive it could be foobar2 foobar2.1/ etc.. is there a way to handle different cases?
11:12 johnj joined #salt
11:19 skrobul joined #salt
11:25 smead joined #salt
11:38 netcho joined #salt
11:38 netcho joined #salt
11:38 netcho hi all
11:48 dendazen joined #salt
11:56 evle1 joined #salt
12:02 haam3r_ obitech: what I do for dokuwiki: https://gist.github.com/haam3r/6d90ef81c617db2bd38a92268bc15246 maybe that helps?
12:03 obitech thanks hamm3r_ that looks promising. but could you break down for me what  "salt['archive.list']('https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz')|first" does?
12:05 zer0def joined #salt
12:06 obitech I'm quite new to Jinja
12:08 haam3r_ basically it lists the file inside the tgz found on the url...takes the first item in that list and assigns it to the variable that can later be used in the file.rename
12:08 haam3r_ s/file inside/files inside/
12:09 haam3r_ maybe not the most elegant way, but it did the job.
12:09 obitech aah that makes sense
12:09 obitech I think that could work, thank you!
12:10 haam3r_ you're welcome :)
12:13 Nahual joined #salt
12:13 johnj joined #salt
12:14 Hybrid joined #salt
12:15 toastedpenguin joined #salt
12:29 ccha hello, It looks like gitfs is not uptodate. no error for master log. how can I force gitfs to be uptodate ?
12:33 edrocks joined #salt
12:34 rojem joined #salt
12:37 wavded joined #salt
12:38 haam3r_ ccha: take a look at https://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.fileserver.html#salt.runners.fileserver.update
12:40 shoemonkey joined #salt
12:41 sahama joined #salt
12:52 GMAzrael joined #salt
12:58 numkem joined #salt
13:00 schasi When using file.blockreplace, how can I use a marker_end that looks like this: marker_end: "# *.err;kern.warning;auth.notice;mail.crit    /dev/console"
13:00 zerocoolback joined #salt
13:11 schasi Problem with the marker seems to be the '*' in the pattern
13:14 johnj joined #salt
13:16 cyteen joined #salt
13:20 obitech hamm3r__ do you know if I can use jinja variables in the above statement? like {% set dir_path = salt['archive.list']({{ pillar['filepath'] }}) %} ? it always throws errors if I try it like that
13:22 coredumb obitech: cause you use {{ }} when you're already in a jinja context
13:23 coredumb try salt['archive.list'](pillar['filepath']) instead
13:24 jb__ joined #salt
13:26 Cumulo741 joined #salt
13:26 jb__ left #salt
13:26 Brew joined #salt
13:27 bartuss7 joined #salt
13:27 haam3r_ schasi: single qoutes around the line?
13:28 racooper joined #salt
13:31 haam3r_ schasi: and/or blackslashes to escape special characters
13:31 bartuss7 left #salt
13:32 bartuss7 joined #salt
13:33 bartuss7 left #salt
13:35 bartuss7 joined #salt
13:37 bartuss7 Hello. I run very long state (about 1-2h), but I get on master message: Minion did not return. It is possible to increase timeout or something like that?
13:39 schasi haam3r_: I tried escaping, didn't change. Single quotes don't change anything either
13:42 haam3r_ schasi: What's the specific error you get?
13:42 schasi haam3r_: CommandExecutionError: Unterminated marked block. End of file reached before marker_end.
13:44 squishypebble joined #salt
13:45 shoemonkey joined #salt
13:45 haam3r_ schasi: Can you match only on part of the line? It uses the the python in operator for each line, so only a part of the line should also work if it's unique for that file
13:46 schasi That is good to know. I'll try
13:47 Ricardo1000 left #salt
13:47 Ricardo1000 joined #salt
13:52 cruscio joined #salt
13:54 schasi Doesn't seem to do what I want. I still get the error
13:55 cruscio By default, where/how is cached pillar data stored on the minion? Is it in a file similar to grains or in memory? is it encrypted on the minion or just in transit? And is there any chance it could end up in a log file in plain text on the minion (e.g. if used in a state file, is the rendered state file logged somewhere by default)
13:57 schasi haam3r_: How did you learn that it is using the python "in" operator?
13:58 impi joined #salt
13:58 haam3r_ schasi: the wonders of open source: https://github.com/saltstack/salt/blob/develop/salt/modules/file.py#L2531
14:00 schasi Well yes, I have read some of the source too, but why did you dig into it?
14:00 haam3r_ cruscio: take a look at this file path on a minion: "/var/cache/salt/minion". Depends on the logging level for the minion. Tha's configurable in "/etc/salt/minion". If it's info or debug then yes it might
14:01 haam3r_ you asked a question about it, so to understand what might be going on I went and looked at the source
14:01 _KaszpiR_ joined #salt
14:01 edrocks joined #salt
14:04 schasi Oh I see. Nice. Thank you :)
14:05 jas02 joined #salt
14:06 schemanic joined #salt
14:09 cruscio haam3r_: Thanks!
14:10 msn joined #salt
14:10 haam3r_ cruscio: small correction. I think pillar data is actually not stored on the minion now that I come to think of it.
14:11 schasi haam3r_: Thanks for your help, it works now
14:11 mikecmpbll joined #salt
14:12 cruscio haam3r_: any idea what saltutil.refresh_pillar is for if pillar data isn't stored on the minion? https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.saltutil.html#salt.modules.saltutil.refresh_pillar
14:13 mchlumsky joined #salt
14:15 johnj joined #salt
14:17 cgiroua joined #salt
14:18 tiwula joined #salt
14:21 tapoxi joined #salt
14:23 DammitJim joined #salt
14:23 Cumulo741 joined #salt
14:25 jRome741 joined #salt
14:25 XenophonF cruscio: saltutil.refresh_pillar refreshes the minion's cached copy of the Pillar data
14:25 JawnAuz joined #salt
14:28 schemanic Hello
14:28 schemanic I need to compute some variables from pillar keys passed into map.jinja
14:29 schemanic I'm wondering exactly the best way to do that.
14:31 pualj joined #salt
14:37 c4t3l joined #salt
14:37 XenophonF I tend to structure things like FreeBSD ports---I have a bunch of variables that I compose as needed in my SLS files, with the default values of said variables coming from defaults.yaml and O/S-specific (and Pillar data) overrides in map.jinja.
14:38 XenophonF so e.g., I might have package_settings.version and package_settings.prefix
14:38 c4t3l hello all.  can someone point me to an example orchestration that uses conditional logic to fail the orch (ie stop its execution)?
14:38 XenophonF and I might put them together in a state using Jinja's format filter
14:39 XenophonF like so: {{ '%s-%s'|format(something_settings.prefix, something_settings.version)|yaml_encode }}
14:39 schemanic XenophonF, I know how to do it that way, but I'm running into a situation where I need a completely other set of states to get information from *another program's pillar/map data
14:39 schemanic so I'm filling out a config file that does things with apache, tomcat, and liquibase
14:40 XenophonF what's stopping you from importing their map.jinja files (or whatever?)
14:40 XenophonF e.g., https://github.com/irtnog/salt-states/blob/development/tomcat/shibboleth-idp.sls
14:40 kbaikov joined #salt
14:40 schemanic Nothing at all. My point is that I'm computing a bunch of variables for liquibase INSIDE the liquibase state, and I need those computed variables wherever the liquibase map is imported
14:40 XenophonF that pulls in the map.jinja files from both tomcat-formula and shibboleth-formula
14:41 schemanic I dont want to re-define these variables again in my deploy code state
14:41 XenophonF what's stopping you from importing their map.jinja variables in the liquidbase map.jinja file?
14:41 schemanic I don't understand. The variables don't exist outside the state sls. They're not importable
14:42 schemanic also I don't know how map files actually work
14:42 schemanic I like, understand roughly what they're doing when I read them
14:42 schemanic but I've never written one from scratch
14:42 schemanic I do know that what I ultimately want is to define and add those computed variables to the dict that map.jinja produces
14:44 schemanic XenophonF, your example is what I'm already doing. I'm saying the computed values need to already be in the mapfile before they're imported
14:44 XenophonF cruscio: well, I learned something new today - https://docs.saltstack.com/en/latest/ref/configuration/minion.html#minion-pillar-cache
14:45 omie88877777 joined #salt
14:47 schemanic I'm sorry if I'm not making sense
14:47 socket- So I am trying to use the bootstrap script to install salt-minion on an ubuntu14 (32bit) os. It looks like it fails because salt-common depends on python-tornado 4.2.1, but looks like only 3.1.1 is available for install. Any ideas on how to upgrade the minion, its soo old it doesn't let me do state.apply
14:47 XenophonF cruscio: so I guess the minion isn't caching Pillar data unless you tell it to
14:48 XenophonF sorry schemanic I'm having a difficult time following you
14:48 XenophonF can you post example code somewhere?
14:48 schemanic uh sure
14:48 XenophonF socket-: state.apply is just an alias for state.sls
14:50 XenophonF socket-: if you're using salt-formula, running something like `state.sls salt.pkgrepo` followed by `pkg.upgrade` should net you the lastest salt-minion release
14:52 socket- i was doing "curl https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | bash"
14:53 XenophonF oh god
14:53 socket- never tried salt-formula
14:53 XenophonF never ever ever do that ever
14:54 XenophonF socket-: manual install instructions here - http://repo.saltstack.com/#ubuntu
14:54 socket- Oh? whats the point of the bootstrap script if its not to be ran?
14:54 XenophonF never download | bash
14:54 XenophonF always download, glance over the script to make sure it isn't obviously evil, then execute
14:55 XenophonF even better, double check file hashes/signatures
14:55 XenophonF curl | sh makes baby Jesus cry
14:55 socket- XenophonF: i also followed these steps, it fails on step 4 when i dod apt-get install salt-minion
14:56 schemanic XenophonF, here you go: https://gist.github.com/anonymous/f8208852a2105eb4c37c5eb04025abec
14:56 XenophonF socket-: can you post the error message verbatim to gist or something?
14:56 apofis joined #salt
14:57 XenophonF worst case, do service salt-minion stop; apt-get remove salt-minion; apt-get autoremove; apt-get install salt-minion; service salt-minion start
14:57 XenophonF you can uninstall the minion and preserve the config, then re-install safely
14:57 socket- sure ill post it one sec
14:57 XenophonF schemanic: lqqing
14:59 XenophonF schemanic: I'd move the `set liquibase` and `set liquibase_root` Jinja code to a file that I could import in the other file.
15:00 schemanic why can't I just do that in the map.jinja?
15:00 XenophonF That's what I'm telling you to do.  :)
15:01 schemanic YES BUT IM ASKING YOU HOW
15:01 socket- XenophonF: https://apaste.info/48cO
15:01 schemanic that's what I've been asking
15:01 XenophonF OH
15:01 XenophonF sorry schemanic
15:01 schemanic like, HOW do you define custom vars IN the mapfile and make sure they exist in the dict that map.jinja provides?!
15:01 XenophonF so literally take lines 17 and 19 of your gist and put them into a file named liquibase/map.jinja
15:02 schemanic okay
15:02 XenophonF (am making assumptions about paths and stuff in your state tree)
15:02 schemanic sure sure
15:02 XenophonF oh and line 30 too
15:03 schemanic k
15:03 schemanic and then what?
15:03 XenophonF and at the top of the liquibase and deploy code SLS files put something like {% from "liquibase/map.jinja" import liquibase, liquibase_root, jdbc_drivers %}
15:03 XenophonF or {% from "liquibase/map.jinja" import liquibase, liquibase_root, jdbc_drivers with context %}
15:04 XenophonF I can't remember the semantics of "with context" so I'm not sure if you need it.
15:04 schemanic I see, so you're saying 'don't try to make your variables keys of the dict that map.jinja provides'
15:05 schemanic I was kindof hoping to do something like 'liquibase.liquibase_root = stuffandjunk'
15:05 XenophonF well in my example i went with minimal code changes to make things easier to understand
15:06 schemanic Sure sure, and I do really appreciate that
15:06 XenophonF but generally what you specified as pillar data I'd put into liquibase/defaults.yaml
15:06 schemanic right
15:06 XenophonF assuming those are sensible defaults
15:07 schemanic bring defaults into map, do the thing that changes vars based on OS, and then it does something to merge the defaults, OS vars, and the pillar data together
15:07 XenophonF and then i'd write a map.jinja file that imports the defaults.yaml file, merges that with O/S-specific settings, merges THAT with Pillar data (structured identically to the dictionary in defaults.yaml), and exports that as whatever_settings
15:07 jas02 joined #salt
15:07 ssplatt joined #salt
15:07 schemanic right, so how do I go about injecting things into whatever_settings?
15:07 XenophonF you don't have to go that crazy if you don't want to
15:08 schemanic XenophonF, well I kindof want to so I understand how mapfiles work
15:08 schemanic Is there a guide to how to write mapfiles?
15:09 XenophonF I think so, maybe in the "writing formulas" section of the docs
15:09 schemanic I don't really understand how the merging stuff works
15:09 XenophonF Here's how I do it: https://github.com/irtnog/openssh-formula/blob/master/ssh/
15:09 XenophonF it has the default settings for the *ssh* SLS
15:10 XenophonF sorry defaults.yaml has the default settings for the *ssh* SLS
15:10 XenophonF and map.jinja reads that file in at line 34
15:12 XenophonF lines 36-68 create a dictionary that's structured the same way, only with O/S-specific settings (different package names for different operating systems, in this case)
15:12 XenophonF and line 70 merges those O/S-specific settings with the default settings
15:13 XenophonF and lines 72-76 merges the defaults+O/S specific settings with whatever's in Pillar
15:13 schemanic Cool, I think I see whats happening. You import the defaults and leave them for now. Then grains.filter_by picks which data structure applies to the os. do ... .update overwrites key values for the OS, then you define a new var which grabs the pillar, sets the defaults to the default_settings.ssh dict, and says to merge both values
15:13 schemanic Sorry lol. you were explaining it to me, and I was busy writing what I thought I was seeing
15:13 XenophonF so Pillar data override O/S-specific settings which override the defaults
15:13 XenophonF yup you got it!
15:14 schemanic Okay. That all makes sens
15:14 schemanic sense
15:14 schemanic But now about my scenario
15:14 schemanic in your mapfile, how and where would you go about computing a variable and adding it to the ultimate ssh_settings dict?
15:16 socket- XenophonF: have you had a chance to see the paste i sent yet?
15:16 schemanic I think I found it
15:16 johnj joined #salt
15:17 schemanic {% do data['location']=node.location %}
15:17 XenophonF that's one way
15:17 schemanic Is there a better way?
15:17 XenophonF but I tend to combine settings as I go, like so - https://github.com/irtnog/shibboleth-formula/blob/master/shibboleth/idp/init.sls#L50
15:18 XenophonF or I will set a convenience variable after the import that does the calculation, like so - https://github.com/irtnog/comanage-formula/blob/master/comanage/registry/init.sls#L33
15:18 XenophonF that's solely to improve readability
15:19 schemanic XenophonF, but if I follow you, it means that everything that imports has to define it's own convenience vars
15:19 XenophonF yes, but I generally only have three files defining an SLS - defaults.yaml, map.jinja, and init.sls
15:19 schemanic So if I import liquibase into state X and state Y separately, and X and Y both need the same computed variable, they both have to make it themselves
15:20 XenophonF true
15:20 schemanic I see, your assertion is that your states don't structure dependencies on other states
15:20 XenophonF I try to avoid that, yes.
15:20 schemanic mmm
15:20 XenophonF But I do write states that glue things together
15:20 XenophonF er SLSes I mean
15:21 XenophonF like this one - https://github.com/irtnog/salt-states/blob/development/tomcat/shibboleth-idp.sls and https://github.com/irtnog/salt-states/blob/development/tomcat/files/idp.xml
15:21 XenophonF now I cheated on that XML file
15:21 schemanic That method does make sense. You want things to be clean and discrete
15:21 XenophonF what I will do Real Soon Now is have it import shibboleth/idp/map.jinja and use the install prefix instead of the hard coded path to the WAR file
15:21 schemanic I think in my case, the reason I want to do it this way is that liquibase on it's own needs the computed vars too, but then other things do as well
15:22 XenophonF yeah, completely understandable
15:22 schemanic coolcool
15:22 XenophonF do what makes the most sense to the version of you six months down the road who's completely forgotten about all of this ;)
15:22 schemanic Hey I'm sorry if I seemed aggressive earlier. I really just meant to express emphasis and exultation once you understood.
15:22 XenophonF no worries!!!
15:23 schemanic Lol. Thanks so much XenophonF
15:23 XenophonF sorry I wasn't being clear :)
15:23 schemanic It's cool. I was doing something way off book
15:25 XenophonF OK socket- let me take a look at your paste
15:28 XenophonF socket-: You're installing on i686 but you're pointing APT at the amd64 repo.
15:28 XenophonF crap - it doesn't look like 32-bit packages are available
15:28 socket- i think the problem is that python-tornado doesn't have 32bit libs
15:28 XenophonF that sucks
15:29 XenophonF it isn't just python-tornado
15:29 XenophonF looks like the official SaltStack repos don't support 32-bit Ubuntu :(
15:29 bartuss7 left #salt
15:29 XenophonF so let's look at the bootstrap script again
15:30 choke joined #salt
15:30 XenophonF btw if you have more than one of these 32-bit minions to deploy, you might want to look at salt-pack
15:30 pualj_ joined #salt
15:31 socket- yeah, this is more just a proof of concept for people using older machines, if we can manage them or not
15:33 XenophonF man that's super lame - you'll have to build salt from source
15:33 XenophonF salt-pack is probably your best bet but frankly, if this is just a PoC, I'd try to get a 64-bit version of Ubuntu installed somewhere, like in a VM
15:33 XenophonF if you can
15:33 XenophonF otherwise you'll waste a lot of time on packaging
15:34 socket- yah, i tried the git develop one too
15:34 XenophonF hang on let me see if they have a 32-bit version for something else like Fedora or CentOS
15:34 XenophonF although IIRC CentOS is 64-bit only too
15:34 _KaszpiR_ joined #salt
15:35 XenophonF CentOS 6 has a 32-bit version of Salt available.
15:36 XenophonF sorry socket- wish i had a better solution for you
15:36 XenophonF FreeBSD would work - I think the official pkg repo has the latest version now but let me double check.
15:39 XenophonF yeah FreeBSD/i386 11.1-RELEASE includes Salt 2016.11.7 in the default repository, and you can switch to the latest repository to get 2017.7.1.
15:40 XenophonF (FreeBSD does quarterly package releases by default.)
15:40 XenophonF alright i need to get work done instead of hanging out on IRC
15:40 socket- k, thanks for all the help. Ill keep that in mind
15:40 XenophonF np good luck
15:45 euidzero joined #salt
15:47 fullstop joined #salt
15:48 edrocks joined #salt
15:52 ivanjaros joined #salt
15:52 JawnAuz joined #salt
15:58 jas02 joined #salt
16:13 apofis joined #salt
16:16 fatal_exception joined #salt
16:17 yagnik joined #salt
16:17 johnj joined #salt
16:26 ivanjaros joined #salt
16:29 motherfsck Does anyone here have a good example of how they manage specific versions of many packages across different distributions?
16:29 motherfsck I'm trying to figure out the most easily maintained way to do it at scale.
16:29 motherfsck Right now it seems easist to lay out pillar data with 'package: version' nested under distribution names.  Then do a 'pillar.get' with grains data.
16:30 bushelofsilicon joined #salt
16:31 onlyanegg joined #salt
16:32 motherfsck That leaves several long lists with a lot of items that would be nearly duplicates.  I'm wondering how I can de-duplicate that list with a map file.
16:33 bushelofsilicon is it possible to send local.state.apply with queue : True? https://docs.saltstack.com/en/latest/topics/reactor/#passing-event-data-to-minions-or-orchestration-as-pillar
16:34 ivanjaros joined #salt
16:40 it_dude joined #salt
16:46 zerocoolback joined #salt
16:48 cruscio XenophonF - sorry for the delayed response, thanks for that info! it's exactly what I (or my security compliance guy, really) needed
16:49 Heartsbane joined #salt
16:49 Heartsbane joined #salt
16:53 jRome741 joined #salt
16:55 edrocks joined #salt
16:58 NV joined #salt
17:04 quantumsummers joined #salt
17:05 quantumsummers Hello. Is anyone using grafana4 module with salt-ssh in version 2017.7.1 having issues with {'retcode': 0, 'stderr': 'Passed invalid arguments: string indices must be integers, not str. ?
17:05 quantumsummers the invocation is simple enough
17:05 quantumsummers salt-ssh grafana-node grafana4.get_orgs
17:06 quantumsummers the profile exists and is accessible to that node
17:06 quantumsummers in pillar
17:06 quantumsummers also tested in master config too
17:06 quantumsummers I think I am missing some crucial todbit here.
17:07 quantumsummers I wonder if basepi has seen this before
17:08 quantumsummers I get this same ret for any invocation, I should add. Not just get_orgs
17:09 sh123124213 joined #salt
17:10 babilen quantumsummers: Look into the master/minion debug logs. Might be a bug, but that should make it more obvious as to what is going wrong
17:11 quantumsummers nothing in the master log
17:11 quantumsummers nothing in ssh log
17:12 ikarpov joined #salt
17:12 quantumsummers `[DEBUG   ] Could not LazyLoad grafana4.get_users: 'grafana4.get_users' is not available.`
17:12 quantumsummers I see that sort of thign when I `-ltrace` to the invocation
17:14 whytewolf quantumsummers: what version os salt do you have installed?
17:14 babilen (on both master and minion)
17:14 quantumsummers 2017.7.1
17:14 quantumsummers this is salt-ssh
17:15 quantumsummers so it's the same on master/minion
17:15 babilen So you are *not* seeing any error in the logs when you run that command?
17:15 babilen I typically see state runs on the minion :-/
17:15 quantumsummers I am not
17:16 babilen How exactly did you enable debug logs?
17:16 quantumsummers hmm, adding print stmts to the code, it's not print anything
17:16 sh123124213 does saltstack provide a solaris package if support is purchased ?
17:16 quantumsummers salt-ssh grafana-node grafana.get_user profile='myprofile' -ldebug
17:17 quantumsummers or -ltrace
17:17 quantumsummers same deal either way
17:18 babilen Ah, salt-ssh
17:18 quantumsummers we use salt-ssh extensively. It's good, generally.
17:18 whytewolf quantumsummers: does the system you are trying to run the module on have python requests installed
17:18 quantumsummers essentially it's just the same as masterless
17:18 johnj_ joined #salt
17:18 quantumsummers yeah, it has requests installed
17:18 whytewolf actually it isn't the same.
17:19 quantumsummers essentially, pretty close
17:19 quantumsummers it invokes salt-call --local
17:20 quantumsummers SALT_ARGV is basically that, with some extra fun
17:20 c4t3l hello all.  does anyone know if the service module should return status after its execution?
17:21 c4t3l I ran into a situation this morning with an orchestration failing to "failhard" after a service.restart reported False
17:21 lordcirth_work c4rc4s, like salt 'minion' service.restart apache2 ?
17:21 whytewolf quantumsummers: have salt keep the tmp system in place, and use it to run the local commands with -l trace
17:21 c4t3l lordcirth_work: yes
17:21 quantumsummers whytewolf: that is precisely what I am about to do! :D
17:21 lordcirth_work It will report True on success, and False on failure
17:21 heyimawesome joined #salt
17:22 c4t3l when I run it with --summary it reports no failures on any states.
17:22 lordcirth_work However, some services will fork, causing systemctl to return 0, then crash later
17:22 c4t3l true
17:23 cruscio left #salt
17:23 c4t3l I ended up changing out the service module call for cmd.run as it reports error status on the restart
17:24 c4t3l I just wanted to be sure that I wasn't mis-understanding the nature of service.restart
17:24 c4t3l I'm using 2017.0 and it looks like its never supposed to "fail", just report True|False
17:25 whytewolf c4t3l: false is a fail
17:25 c4t3l whytewolf: in that case maybe I found a bug
17:26 whytewolf or you found a service that is not failing properly. and is returning 0 even though it failed
17:26 whytewolf a sort of soft fail
17:27 shoemonkey joined #salt
17:27 c4t3l hmm... I've isolated it via local systemctl calls and it reports correctly
17:27 whytewolf use cmd.run_all on the command when you try it with cmd.run
17:27 whytewolf run_all will return all of the output data including exit code whihch is what salt watches
17:28 c4t3l ok.  cmd.run works with failhard in my orchestration example. so thats a valid working confi
17:29 whytewolf i meant as a troubleshooting step to find out why service.restart isn't reporting false
17:29 c4t3l ok
17:30 nixjdm joined #salt
17:32 quantumsummers whytewolf: this is a bit surprising, but salt-call, when run for a module, cannot find salt.scripts
17:32 quantumsummers literally ImportError: No module named salt.scripts
17:33 lordcirth_work What does salt.scripts do?
17:33 whytewolf it is an internal module
17:33 quantumsummers ah, it looks like the the --config-dir points to the wrong location
17:34 quantumsummers not deep enough
17:34 quantumsummers salt.scripts is the entrypoint called by salt-call to run salt
17:34 quantumsummers hmm, adjusting that does not fix ...
17:35 quantumsummers it is notable that states run just fine
17:35 quantumsummers let me try another module
17:37 ivo_ joined #salt
17:38 morissette joined #salt
17:39 JawnAuz So quick question: if I do salt-run fileserver.file_list and my GitFS shows I have - x, -y, -z  ... Then shouldn't I be able to target those things with salt://x-path ? Or is there something else when using salt:// I'm missing?
17:39 JawnAuz Attempting to use cp.get_file, in this case.
17:39 whytewolf JawnAuz: cp.list_master will show you the path
17:40 whytewolf it is possable that those files are under different enviroments
17:40 whytewolf but yes a file of -x shiuld be salt://x
17:43 JawnAuz That worked! Thanks. :)
17:44 edrocks joined #salt
17:50 sarcasticadmin joined #salt
17:54 quantumsummers oh this is interesting
17:54 quantumsummers py2/salt/modules/grafana4.py", line 82, in get_users
17:54 quantumsummers '{0}/api/users'.format(profile['grafana_url']),
17:54 quantumsummers TypeError: string indices must be integers, not str
17:55 astronouth7303 i wish i could wildcard file watches...
17:55 whytewolf astronouth7303: you can. as long as they are all things managed by salt
17:56 whytewolf quantumsummers: that is interesting. profile shouldn't be a string
17:56 whytewolf quantumsummers: bug report time
17:56 astronouth7303 whytewolf: oh? Just do `- file: /etc/app/conf.d/*`?
17:57 whytewolf astronouth7303: yeah
17:57 whytewolf as long as that matches name or state id
17:57 whytewolf unless that was removed.
17:58 _KaszpiR_ joined #salt
17:58 coredumb I hope not :D
17:58 astronouth7303 excuse me, i need to replace a bunch of `supervisorctl` calls
18:00 debian112 joined #salt
18:01 whytewolf astronouth7303: guess that never made it to the documentation but here is the problem ticket that wildcard requisite made it in https://github.com/saltstack/salt/issues/663
18:03 astronouth7303 now all that the supervisor state module needs is the same magic that service has to reload/restart services
18:04 whytewolf a mod_watch function?
18:04 astronouth7303 yeah
18:04 astronouth7303 because if service.running has watches, it'll restart the service if one of the watches goes off. supervisor.running needs the same thing
18:05 schemanic how do I straight up merge dictionaries in jinja?
18:06 whytewolf schemanic: no easy way to do it. but i tend to use filter_by for that function
18:07 mikecmpbll joined #salt
18:07 schemanic whytewolf, how would I call it? I'm seeing using do dict1.update(dict2)
18:09 whytewolf oh, wait yes. that actually should work i was thinking about a more complex dict
18:09 edrocks joined #salt
18:09 rojem joined #salt
18:09 schemanic does update only go so many levels?
18:09 whytewolf that would add dict2 into dict1
18:09 jas02 joined #salt
18:10 whytewolf well it will add them together basicly. but if you have items in dict2 that are the same as items in dict1 the items in dict2 overright the items in dict1
18:10 schemanic I see. You need a macro to properly handle not overwriting them
18:11 schemanic I do need to merge at that deep level
18:16 sarcasticadmin joined #salt
18:19 johnj_ joined #salt
18:21 whytewolf sh123124213: almost forgot. "SaltStack does offer commerical support for Solaris which includes packages." from the solaris page in the saltstack documentation
18:22 sh123124213 ye, saw that too but i also saw a video that says salt doesnt offer any packages to enterprises
18:23 jas02 joined #salt
18:26 pcn I have a question: I posted a response to a question on the salt-users list about the slack engine and for some reason it appears that those messages have been deleted.  I'm not sure why though.
18:26 _JZ_ joined #salt
18:26 quantumsummers seems like this is failing `profile = __salt__['config.option'](profile)
18:27 shoemonkey joined #salt
18:27 pcn Is there some kind of auto-moderation on a google group or otherwise something that I may be unaware of when I'm answering questions?
18:27 whytewolf pcn what was the message thread?
18:28 whytewolf slack engine and custom commands?
18:30 whytewolf humm, i see your response in my email. but not on the site.
18:30 whytewolf 2 messages have been deleted.
18:30 whytewolf also see that
18:31 bcat_ joined #salt
18:36 pcn Yeah
18:36 pcn That one
18:36 whytewolf quantumsummers: well config.option grafana should return a dict. what do you have configured for the grafana profile?
18:38 whytewolf pcn: i don't see anything that should have caused it to be pruned. but that would be up to the moderators.
18:38 whytewolf quantumsummers: should be able to get the value of that with config.option grafana
18:40 whytewolf although that modules really should have better checking on that profile then it does
18:42 jas02 joined #salt
18:43 pcn Maybe gareth or gtmanfred have an idea?
18:43 UForgotten joined #salt
18:43 shoemonkey joined #salt
18:44 schemanic am I able to get all dicts in jinja with dot notation?
18:44 ChubYann joined #salt
18:44 whytewolf gtmanfred is off for a while. so might not be the best one to answer right now
18:44 gtmanfred i am back now
18:44 whytewolf oh you are?
18:45 gtmanfred yeah, just last week off
18:45 whytewolf oh :P thought you would have taken more time for the honeymoon
18:45 gtmanfred pcn: on the mailing list, your first post hast to be approved
18:45 gtmanfred whytewolf: we are going to be doing it next year, my wife is out of ETO for now
18:45 whytewolf ahh kewl
18:46 nixjdm joined #salt
18:46 whytewolf when did the first post thing start? was that after the spammer were causing issues?
18:49 ivo_ joined #salt
18:49 quantumsummers whytewolf: weird deal, it totally fails. I have a grafana dict with the required bits. I have tried it as a pillar (accessible to this host), as well as in both the master and minion config
18:49 gtmanfred whytewolf: yeah, it was during the spammer stuff
18:49 whytewolf odd
18:49 gtmanfred it has been working pretty well
18:49 cyberef joined #salt
18:49 gtmanfred other than that, there is no moderation
18:50 gtmanfred schemanic: should be able to
18:56 schemanic I'm having problems with explicitly setting dictionary keys in map.jina
18:56 schemanic https://gist.github.com/anonymous/74ad1b4c08545a42c24a0c8e562dea64
18:59 shoemonkey joined #salt
19:00 gtmanfred schemanic: i think it should be {% set liquibase.install_path = '{0}/liquibase-{1}'.format(liquibase.install_root, liquibase.version %}
19:00 gtmanfred not do
19:00 whytewolf +1
19:01 schemanic gtmanfred, so that will place the key 'install_path' into the liquibase dictionary?
19:01 gtmanfred it will set liquibase['install_path'] to the string
19:01 gtmanfred what you are doing is for stuff like
19:01 schemanic I need that varibale to export when I bring it into states
19:01 gtmanfred {% do liquibase.list_object.append(thing) %}
19:02 gtmanfred if you want to set something equal to something else, use set
19:02 schemanic and that is persistent?
19:02 gtmanfred you want it to be already set the next time the state is run?
19:02 gtmanfred it will be set so that you can reference {{ liquibase.install_path }} later
19:02 netcho_ joined #salt
19:03 gtmanfred it won't set your pillar data
19:03 gtmanfred it will just set in the pillar object
19:03 schemanic um no, I mean that it will properly export this value when I say 'from liquibase/map.jinja' import liquibase with context
19:03 gtmanfred yeah, it will be in the liquibase object
19:05 schemanic it's still not working. The problem seems to be that jinja thinks I'm improperly terminating the statement
19:05 schemanic Rendering SLS 'base:liquibase' failed: Jinja syntax error: expected token 'end of statement block', got '.'
19:10 schemanic any ideas? Why does jinja think I'm improperly terminating my block?
19:11 whytewolf did you fix all the does that should be sets?
19:12 schemanic yep
19:12 whytewolf gist the full error
19:13 schemanic is the full error something other than what returns on the command line?
19:13 schemanic https://gist.github.com/anonymous/52390f4432511dfc57fc88f3684fcbd4
19:16 gtmanfred it is possibly jinja may not support dot notation on sets
19:17 mike25de joined #salt
19:18 whytewolf I don't think it does. dicts are kind of wierd like that.
19:18 schemanic except I just redid it to use bracket notation and it just complained about THAT
19:19 schemanic https://gist.github.com/anonymous/bd91ac940d0a1182dc386f1d07e98fbb
19:19 schemanic am I nuts here?
19:19 gtmanfred hrm, odd
19:20 whytewolf {% do liquibase.update({'install_path':'{0}/liquibase-{1}'.format(liquibase.install_root, liquibase.version)}) %}
19:20 gtmanfred well, this seems like a fun issue in jinja
19:20 gtmanfred but i have to get back to some other stuff o/
19:20 johnj_ joined #salt
19:20 quantumsummers so I have high confidence that the problem is simply the 'profile' that the grafana4 module uses is not getting there properly
19:21 quantumsummers if I literally salt-call blah blah profile='{all the things}' it works
19:21 quantumsummers BUT
19:21 quantumsummers grafana server admin stuff DOES NOT WORK with api tokens, only with an admin user account
19:21 quantumsummers which is absolutely terrible, of course
19:22 whytewolf quantumsummers: unforchantly this could be "yet another salt-ssh issue" there are a lot of them.
19:22 quantumsummers now, I have tested the profile as pillar, master config, and minion config
19:22 quantumsummers it's weird, perhaps I can pass it in with the state like I do for database stuff
19:23 quantumsummers yes, it is unfortunate
19:23 quantumsummers however salt-ssh has been generally excellent to use for the past 3 years
19:23 quantumsummers at a decent scale too
19:23 pcn gtmanfred: who can do the approval?
19:24 whytewolf unforchantly the database stuff has options in the module for handaling passing in connection opts. the graphana module looks like it only takes the profile from config style stuff
19:24 quantumsummers hmm that is unfortunate
19:25 schemanic whytewolf, new error. How can I see the dict that map.jinja exports?
19:26 quantumsummers well I can pass that in with the profile arg
19:26 whytewolf schemanic: what i do is just tag a # {{variable}} into the system in place to look at what is coming out. and then render the file using either cp.get_template or my debug.render module
19:26 quantumsummers this is pretty aweful
19:26 gtmanfred pcn: salt employees
19:26 gtmanfred pcn: we just approve anything that isn't blatant spam
19:27 gtmanfred and permanant approval, if your first message is about salt, then you can post whatever you want after
19:27 schemanic whytewolf, this is saying that my variable isn't present in the dictionary being imported
19:27 pbandark1 joined #salt
19:28 schemanic I need to see the whole map.jinja dict
19:28 whytewolf schemanic: yes
19:28 schemanic whytewolf, yes what?
19:29 whytewolf yes you need to see the whole dict
19:30 whytewolf schemanic: here is a gist of everything i used to test your little expected end of block got . problem https://gist.github.com/whytewolf/c31b42940a278c6bcb2009d1e2de5955
19:30 whytewolf i just render that to see what it outputs
19:31 whytewolf which is  {'install_root': 'test1', 'version': 'test2', 'install_path': 'test1/liquibase-test2'}
19:33 schemanic whytewolf, is the second argument to get_template local to the minion or the master?
19:33 quantumsummers OK, this it 100% not a problem with salt-ssh directly
19:33 whytewolf get_template renders to the minion
19:34 quantumsummers if I pass in the profile dict as json, salt-ssh works
19:34 quantumsummers so, I can conclude that the config.options[profile] is the problem
19:34 quantumsummers rather __salt__['config.options'](profile) I think
19:35 quantumsummers I can do a `salt-ssh grafana-host config.get grafana` and it works as I expect, same with pillar.get (since I have put everything in a pillar, as one does)
19:35 whytewolf config.options not config.get should work
19:36 whytewolf sorry config.option
19:36 whytewolf [no s]
19:36 quantumsummers sure, whatever it is in the actual code
19:36 quantumsummers https://github.com/saltstack/salt/blob/2017.7.2/salt/modules/grafana4.py#L80
19:36 quantumsummers profile = __salt__['config.option'](profile)
19:36 quantumsummers that fails, it appears
19:37 quantumsummers so perhaps I am specifying it incorrectly somehow
19:37 whytewolf it isn't that it is failing. it is coming back as a str. it shouldn't be coming back as a string.
19:37 quantumsummers exactly
19:38 whytewolf ugh who ever wrote this module needs a kick in the head. no logging.
19:38 whytewolf they didn't even import logging
19:39 quantumsummers yeah, I added that in while I was working on the thing because, yeah
19:39 quantumsummers Bruno Binet
19:39 quantumsummers bbinet
19:39 quantumsummers here?
19:40 whytewolf don't know them
19:41 quantumsummers I see plenty of precendent for config.options, but I have never used it
19:42 whytewolf config.option is pretty standard. it is basicly just like config.get but lets you limit which dict things are pulled from
19:42 quantumsummers I see
19:43 quantumsummers this is strongly similar to the _get_profile() in the salt.utils.boto module
19:43 quantumsummers why the heck would this not work correctly
19:43 quantumsummers who is handling salt-ssh now that basepi departed?
19:43 whytewolf thats a good question
19:44 schemanic whytewolf, omg the reason was so stupid
19:44 whytewolf was it tacos?
19:45 wavded joined #salt
19:45 wavded joined #salt
19:45 schemanic I had commented out the pillar import block in atom. Atom apparently doesn't understand that jinja comments are not yaml/python comments. My state was importing my altered map dict, then overwriting it with the raw pillar data which I thought was commented out
19:46 nixjdm joined #salt
19:46 whytewolf lol, well that would be an issue
19:47 wavded joined #salt
19:48 XenophonF mysql formula's inability to work properly on CentOS makes baby Jesus cry
19:50 wavded joined #salt
19:50 whytewolf formulas make old man whytewolf cry. so it is a pay off
19:51 XenophonF mysql-formula needs an overhaul
19:53 wavded joined #salt
20:01 pbandark1 joined #salt
20:01 overyander joined #salt
20:10 tapoxi joined #salt
20:14 mayk joined #salt
20:22 johnj_ joined #salt
20:25 schemanic in jinja how do I print the name of a key rather than a value?
20:26 gtmanfred if you can get the value, you should already have the key
20:26 schemanic no I mean I want to pass the name of the key to a template
20:27 gtmanfred pass a value that holds all the keys that are being passed, then iterate over that
20:27 gtmanfred you have to know some value
20:27 gtmanfred you will have to know the key of something, if it references the name of the key you are using, then that could work
20:27 schemanic I do, but what I want to say is {{tomcat.manager.users.tomcat.name()}}
20:28 gtmanfred .keys()
20:28 schemanic no
20:28 schemanic there's only one
20:28 schemanic or rather, it CAN be multiple, but want a specific one
20:29 schemanic the second 'tomcat' in the above expression is a proper name of a user
20:29 gtmanfred so, is tomcat.manager.users.tomcat the object and you want'tomcat'?
20:29 schemanic yes
20:29 schemanic this formula is odd
20:29 gtmanfred for user, value in tomcat.manager.users.items()
20:29 gtmanfred then you have the user and the value
20:29 schemanic no
20:29 gtmanfred yes
20:29 schemanic because that could render multiple
20:30 gtmanfred so
20:30 schemanic I dont ever want the template to render multiple text values if someone programs the pillar wrong
20:30 gtmanfred if you already have the name, in to reference it
20:30 gtmanfred you justknow the name is tomcat
20:30 schemanic I want to say 'just that one key'
20:30 gtmanfred just use tomcat
20:30 gtmanfred {% set name = 'tomcat' %}
20:30 gtmanfred tomcat.manager.users.get(name)
20:30 schemanic Ah I see.
20:31 gtmanfred you already put in the name
20:31 gtmanfred just use it
20:46 nixjdm joined #salt
20:52 pbandark joined #salt
20:55 eichiro joined #salt
21:00 sjorge joined #salt
21:02 darvon joined #salt
21:02 eichiro joined #salt
21:23 johnj_ joined #salt
21:24 pbandark1 joined #salt
21:43 Uni how does one turn on debugging on the remote side, when using an agentless salt-ssh setup?
21:44 Uni from what I can tell my config referenced in the Saltfile and my file locations are all setup, but I can't get the remote to load the referenced state, and logging on the caller side doesn't give me much to go on
21:45 pipps joined #salt
21:45 apofis joined #salt
21:46 nixjdm joined #salt
21:48 whytewolf Uni: https://docs.saltstack.com/en/latest/topics/ssh/#debugging-salt-ssh
21:48 * Uni hangs his head in shame to the appropriate level
21:49 Uni thank you sir
21:49 Uni or ma'am
21:49 whytewolf hehe, it is sir
21:51 mpanetta joined #salt
22:03 pipps joined #salt
22:13 onlyanegg joined #salt
22:14 noraatepernos joined #salt
22:19 tiwula joined #salt
22:22 kwork joined #salt
22:24 pipps joined #salt
22:24 johnj_ joined #salt
22:31 cyborg-one joined #salt
22:34 dendazen joined #salt
22:40 bcat_ joined #salt
22:41 mikecmpbll joined #salt
22:42 Xenophon1 joined #salt
22:43 johnj_ joined #salt
22:43 GMAzrael joined #salt
22:43 Suresh joined #salt
22:52 debian1121 joined #salt
22:52 KevinAn2757 joined #salt
22:56 c4t3l joined #salt
22:57 noraatepernos joined #salt
23:19 toastedpenguin joined #salt
23:20 bcat_ left #salt
23:28 zerocoolback joined #salt
23:33 jas02 joined #salt
23:40 zerocoolback joined #salt
23:41 zerocoolback joined #salt
23:42 zerocoolback joined #salt
23:42 zerocoolback joined #salt
23:43 zerocoolback joined #salt
23:44 pualj_ joined #salt
23:46 smead joined #salt
23:50 johnj_ joined #salt
23:56 pipps joined #salt
23:57 pipps99 joined #salt

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