Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2018-03-01

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

All times shown according to UTC.

Time Nick Message
00:00 jmedinar but in this case I just want to be sure some parameters are set in the file like timeouts etc etc ... single managing the files will be effectively the same as getting into the minion and doing it manually
00:00 Edgan whytewolf: never seen file.serialize. Looks interesting. I prefer templates for anything over one line. I use - contents for one liners.
00:01 jmedinar I am looking into the accumulators
00:01 exarkun joined #salt
00:01 Edgan jmedinar: Where does this file come from? is it deployed with code? We need context to help you make the right decision.
00:01 whytewolf Edgan: serialize is better for creating json or yaml style files. kind of an easy way to - contents them with a data set instead of a block
00:02 jmedinar is the apache configuration file
00:02 dendazen joined #salt
00:02 Edgan jmedinar: apache configuration, Make it a template! :)
00:02 whytewolf ^
00:02 jmedinar already installed and configured differently in multiple server in very different ways
00:03 Edgan jmedinar: Reconcile the versions and have different templates or if statements in one template
00:03 Edgan jmedinar: only sane choice
00:03 whytewolf shot the guy that did that and standardize
00:03 jmedinar mmm I like the shooting idea.. not here anymore
00:04 Edgan jmedinar: apache/nginx configs are a very known painful problem
00:04 jmedinar will look into templates
00:04 defsdoor joined #salt
00:04 Edgan jmedinar: let me give you an example for nginx
00:05 Edgan jmedinar: It will help lead you in the right direction.
00:05 jmedinar for the most I have managed to do almost everything I need .... just those multilines on specific sections are harder
00:05 defsdoor hi - using file.managed is there a way to change occurance of a pattern on lines that contain another pattern ?  Basically I want to replace all %h with %a on lines that being with LogFormat
00:05 Edgan jmedinar: nginx and apache are so complex I do configs per app and not one monolithic template for everything
00:05 jmedinar agree
00:06 jmedinar I will appreciate the example thanks!
00:06 dodge-lint joined #salt
00:06 defsdoor hmm - maybe I'll use sed
00:07 Edgan jmedinar: This is going to be more complex than you probably need, but you can strip it down
00:08 jmedinar ok
00:08 defsdoor docs say sed is deprecated in favour of replace but I can't see options to get replace to do the sed equivalent of  /LogFormat/s/%h/%a/g
00:12 Edgan jmedinar: https://pastebin.com/nMx6qfJ2
00:13 Edgan jmedinar: This has a nginx.conf, the main default config in nginx, and then using the sites-enabled style another nginx config for jenkins.
00:13 Edgan jmedinar: I used to do it all in nginx.conf, but if you ever end up with two services on the same box that use nginx, this is a better way.
00:14 Edgan jmedinar: you will probably end up with the same pattern for apache
00:16 jmedinar oh wow.. thanks reading it ... slowly ;)
00:20 Edgan jmedinar: If you like that, here is my example of my style in a more complete form. https://cygnusx-1.org/formula.txt
00:20 Edgan jmedinar: It is very friendly to the idea of treating one formula like a template for the next one.
00:22 Edgan jmedinar: It also supports defaults, and overrides from pillars. So only the minimum is stored in pillars.
00:22 __number5__ joined #salt
00:28 masber joined #salt
00:46 lkthomas folks, I am trying to add some missing section on salt, should I create PR on 2018.3 or other version ?
00:48 lkthomas gtmanfred, you around man ?
00:54 whytewolf lkthomas: https://docs.saltstack.com/en/latest/topics/development/contributing.html#salt-s-branch-topology general guide line, documentation or bugs go against earliest version that has bug or needs documentation, other wise develop
00:55 whytewolf so 2016.11 or 2017.7
00:55 lkthomas wait, my request was tagged as "Feature"
00:55 lkthomas shouldn't it goes to develop ?
00:56 whytewolf Feature then yes develop
00:56 lkthomas ok cool, thanks
00:56 whytewolf whats the request?
00:58 lkthomas https://github.com/saltstack/salt/issues/46241
00:58 whytewolf ahhh yeap, kewl definatly develop
00:59 lkthomas I am new to PR on github, when I click New Pull Request, it jumps to compare changes
00:59 lkthomas and the button create pull request is not available to click
01:00 whytewolf click create pullrequest from your fork not the main one
01:03 lkthomas forked from saltstack/salt <- I should clone and edit this one, then create PR from here ?
01:05 sh123124213 joined #salt
01:06 whytewolf fork in github, clone your fork to local system, checkout branch locally that you will be creating a PR against, create a new branch from that point [for extra saftly], make edits. push new branch to your github fork. create github pr from your new branch to the original saltstack/salt branch
01:07 lkthomas thanks, let me try it out
01:08 whytewolf it is a bit odd at first. but once you get the hang of it. it starts making a lot more sense.
01:14 zerocoolback joined #salt
01:16 lkthomas whytewolf, yeah
01:16 thelocehiliosan joined #salt
01:16 lkthomas what exactly does those check do to my PR ?
01:17 lkthomas I see jenkins, codeclimate...etc
01:18 whytewolf jenkins runs a bunch of tests including pylint and intergration and unit tests.
01:18 dkehn joined #salt
01:19 whytewolf codeclimet runs it through codeclimate.com which is a quility control system
01:21 whytewolf wip just means if you add wip to your PR it marks it as work in progress and not ready for merge yet
01:21 lkthomas these just check for the code structure, but not the function of the code, correct ?
01:22 whytewolf the jenkins tests will test the functioning if you included tests with your checkin
01:22 whytewolf but yeah most of it is code structure
01:30 lkthomas whytewolf, for jenkins check, does it going to spawn a VM and test to run the code once or it just doing on paper test ?
01:31 whytewolf I don't really remeber, you can click on the details next to the checks to see what it is doing
01:32 yidhra joined #salt
01:35 lkthomas ok thanks
01:41 exarkun joined #salt
01:42 lkthomas it seems taking forever
01:42 lkthomas perhaps I should come back later
01:42 whytewolf well not a lot you can do now anyway it is up to the engineers now to review and make comments.
01:47 lkthomas true
01:47 lkthomas so on the issue, should I add my pull request ?
01:47 lkthomas how does issue could link to my PR at all ?
01:48 whytewolf yes. normally you should add a comment to the PR that links to the issue
01:48 whytewolf Write a descriptive comment. Include links to related issues (e.g. 'Fixes #31337.') in the comment field.
01:48 lkthomas OH, I see that too, nice
01:48 lkthomas yeah once I put comment on PR, it will link to issue
01:48 lkthomas nice work
01:49 pcgod joined #salt
01:56 onlyanegg joined #salt
02:01 kiorky joined #salt
02:10 pcgod joined #salt
02:15 art2345 joined #salt
02:17 art5005 joined #salt
02:17 onslack <adam.toy> hey all.. does using ‘pillarenv’ during a state.apply lose the pillar-inheritance of the environment you’re declaring?
02:18 onslack <adam.toy> aka, if i have ‘prod’ overwriting ‘dev’ overwriting ‘base’, and i do ‘pillarenv=dev’, it seems to lose the ‘base’ values.
02:18 onslack <adam.toy> and if i leave pillarenv out, it defaults to prod’s values.
02:19 mk-fg joined #salt
02:19 mk-fg joined #salt
02:29 schemanic joined #salt
02:34 dendazen joined #salt
02:56 ilbot3 joined #salt
02:56 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.9, 2017.7.4 <+> 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:01 nwang joined #salt
03:13 evle joined #salt
03:19 onlyanegg joined #salt
03:20 hoolio joined #salt
03:21 exarkun joined #salt
04:01 jbkc85 joined #salt
04:11 tiwula joined #salt
04:20 mrBen2k2k2k joined #salt
04:35 onlyanegg joined #salt
04:57 masber joined #salt
05:01 exarkun joined #salt
05:14 Tirefire joined #salt
05:18 Tirefire left #salt
05:19 onlyanegg joined #salt
05:35 indistylo joined #salt
05:39 aruns joined #salt
05:41 aruns__ joined #salt
05:51 zulutango joined #salt
05:52 thelocehiliosan joined #salt
06:12 rburkholder joined #salt
06:22 Miuku joined #salt
06:37 Pjusur joined #salt
06:40 exarkun joined #salt
06:44 LocaMocha joined #salt
06:46 aruns joined #salt
06:50 LocaMocha joined #salt
07:01 Hybrid joined #salt
07:02 Valfor joined #salt
07:02 Valfor joined #salt
07:07 sh123124213 joined #salt
07:12 ipsecguy joined #salt
07:17 onlyanegg joined #salt
07:20 Hybrid joined #salt
07:38 om2 joined #salt
07:47 mavhq joined #salt
07:49 aruns joined #salt
07:50 aruns__ joined #salt
07:58 jhauser joined #salt
08:02 lounagen left #salt
08:08 aruns joined #salt
08:09 Hybrid joined #salt
08:11 sh123124213 joined #salt
08:13 joshin joined #salt
08:13 joshin joined #salt
08:14 CeBe joined #salt
08:15 rockey joined #salt
08:19 aviau joined #salt
08:22 evle joined #salt
08:24 harmathy joined #salt
08:28 aldevar joined #salt
08:28 hemebond left #salt
08:39 hemebond joined #salt
08:40 Pjusur joined #salt
08:44 saltnoob58 joined #salt
08:47 mrBen2k2k2k_ joined #salt
09:08 mikecmpbll joined #salt
09:11 syd_salt joined #salt
09:18 onlyanegg joined #salt
09:22 cewood joined #salt
09:23 Ricardo1000 joined #salt
09:26 aldevar joined #salt
09:30 darioleidi joined #salt
09:40 shoogz joined #salt
09:41 cliluw joined #salt
09:41 shoogz joined #salt
09:45 coldbrewedbrew joined #salt
09:45 coldbrewedbrew joined #salt
09:45 coldbrewedbrew_ joined #salt
09:49 Naresh joined #salt
09:52 kiorky joined #salt
09:53 coldbrewedbrew joined #salt
09:53 coldbrewedbrew joined #salt
09:53 coldbrewedbrew_ joined #salt
09:54 armyriad joined #salt
09:57 masber joined #salt
09:59 vali joined #salt
10:01 exarkun joined #salt
10:07 masber joined #salt
10:19 losh joined #salt
10:21 J0hnSteel joined #salt
10:32 megamaced joined #salt
10:41 hashwagon joined #salt
10:56 coldbrewedbrew joined #salt
10:56 coldbrewedbrew joined #salt
10:57 coldbrewedbrew_ joined #salt
11:04 aruns__ joined #salt
11:05 jrj joined #salt
11:06 aruns joined #salt
11:12 aldevar joined #salt
11:18 onlyanegg joined #salt
11:41 exarkun joined #salt
12:39 GrisKo joined #salt
12:46 cyteen joined #salt
12:59 aruns__ joined #salt
13:01 BlackBishop left #salt
13:04 KingJ joined #salt
13:11 nickadam joined #salt
13:11 thelocehiliosan joined #salt
13:11 Alaniaris joined #salt
13:12 indistylo joined #salt
13:14 onlyanegg joined #salt
13:21 Nahual joined #salt
13:22 exarkun joined #salt
13:26 Shirkdog joined #salt
13:31 cewood joined #salt
13:33 TooLmaN joined #salt
13:37 TooLmaN joined #salt
13:45 xet7 joined #salt
14:12 racooper joined #salt
14:14 yuhl joined #salt
14:15 evle1 joined #salt
14:20 ProT-0-TypE joined #salt
14:25 thelocehiliosan joined #salt
14:30 mikecmpbll joined #salt
14:39 ecdhe joined #salt
14:44 hashwagon joined #salt
14:45 onlyanegg joined #salt
14:49 afics joined #salt
14:52 afics joined #salt
14:55 akrus joined #salt
14:55 akrus hello everyone~
14:55 jbkc85 joined #salt
14:56 akrus I'm using salt-api and want an external user to be able to apply a single state. the problem is state.sls allows to send pillar with any parameter inside and basically override the one already set. how to restrict using pillar argument in api?
14:56 akrus or maybe I shouldn't expose state.sls via api?
14:57 evle1 joined #salt
14:58 shpoont joined #salt
15:01 gh34 joined #salt
15:04 saltnoob58 wasn't there some feature to limit which commands some users can run? it wasn't a purely salt-api thing, maybe that can help you?
15:05 saltnoob58 sorry that i dont know any better. but if you can crack it, better to close the security hole instead of hoping for the best
15:05 KennethWilke joined #salt
15:06 kiorky joined #salt
15:06 exarkun joined #salt
15:08 akrus there is a feature, but either it's not working as I expect it to or it just cannot do this :-/
15:08 akrus so I have args: - 'sls_name', but I still can pass any other arguments together (i.e. pillar={...})
15:12 onslack <chris.ruscio> Is there a way to use the docker --init flag in the docker_container.running state? <https://docs.docker.com/engine/reference/run/#specify-an-init-process>
15:12 hashwagon joined #salt
15:15 ProT-0-TypE joined #salt
15:22 cgiroua joined #salt
15:25 hashwagon joined #salt
15:35 mage_ any idea how to do this https://gist.github.com/silenius/98bc0b21d0b5502256d27551ad75dbae ?
15:40 ponyofdeath joined #salt
15:47 IdoKaplan joined #salt
15:52 lordcirth_work mage_, I don't know much about the SQL you're running, but I'd suggest using cmd.script for a command that long
15:54 mage_ lordcirth_work: thanks, will look at it :)
15:55 thelocehiliosan if i create a schedule like this:
15:55 thelocehiliosan ...
15:55 thelocehiliosan schedule:
15:55 thelocehiliosan highstate:
15:55 thelocehiliosan function: state.apply
15:55 thelocehiliosan minutes: 60
15:55 thelocehiliosan ...
15:55 thelocehiliosan and sync pillar data, will the resulting schedule across all of the minions essentially be firing close to the same time? do the 60 minute schedulings begin when the pillar data is synced? or is there any automatic spacing out? if i want to be sure that highstate is relatively distributed (start time) throughout the environment, do i need to include `splay: 60` ?
15:55 thelocehiliosan also, is `splay` always random for a given host? or does it always pick the same value for a host (making the runtime of jobs more predictable?
16:00 _JZ_ joined #salt
16:05 nixjdm joined #salt
16:06 afengler joined #salt
16:11 mage_ do I need to escap "$" in a cmd.script ?
16:12 onlyanegg joined #salt
16:13 lordcirth_work mage_, the file will be executed as a bash script, so whatever escaping you'd normally need
16:13 mage_ I have the following: https://gist.github.com/silenius/396a4a1e24c484453654ee654a185343
16:14 mage_ do I need the #!/bin/sh ?
16:14 smead joined #salt
16:15 smead Hey, I'm using salt-cloud to build ec2 nodes for me.  I'd really like it to deploy the node, then immediately execute my state against each one via salt-ssh (these are quick setup and there's no minion to talk to).
16:16 smead It seems like this should be possible, but salt-cloud always wants to install a minion
16:16 smead sorry, no salt master to talk to
16:16 smead right now, I'm using salt-cloud to create vms and ansible to deploy, i'd rather do it all with salt though
16:17 mage_ ah it was that :) works better with \$\$
16:18 afengler I have a similar question actually, I'm looking at the cmdmod docs and I don't see a way to bypass shell interpreting
16:20 lordcirth_work mage_, I don't think you need the #!/bin/sh, but I usually do it anyway to clarify the file type
16:20 lordcirth_work I think it gets called like 'sh file' not './file'
16:20 afengler I need to exec a program on the minion side that takes arguments like regexes for varnishadm, and having to quote multiple layers of shell is a pain
16:32 viq afengler: there's cmd.script, you could write it to a file and execute that
16:33 afengler But that's also executed by shell, no?
16:35 afengler I need to feed it something like "myprogram ban req.http.host ~ hostname && ..."
16:35 afengler Which is going to get mangled if it ever sees a shell
16:36 Sokel joined #salt
16:36 viq But you could run it as "my_script hostname" and let the script take care of that.
16:36 Sokel Hello. Is there a clear way to use grains.append for multiple values instead of running grains.append multiple times? the documentation isn't clear if this is possible or not.
16:37 afengler That's what I'm doing now because our current system has the multiple layers of shell problem.  It's unsustainable, since I need to write a case for every command I could possibly want to run that includes a shell metachar
16:38 viq Sokel: how about grains.setvals?
16:39 onslack <mts-salt> afenglar: are you saying you have a cmd.run that takes a dynamic command?
16:39 viq afengler: find a shell that doesn't do that, and tell salt to use that shell for running commands?
16:39 dendazen joined #salt
16:40 afengler onslack: yes
16:40 lordcirth_work afengler, is there no other way to control varnish other than shell args?  No API?
16:41 afengler I'm trying to replace what's currently underneath our command and control system with salt
16:41 afengler Varnish is just an example, if it was just varnish, then yes, I'd find a way around it
16:42 exarkun joined #salt
16:43 afengler viq: do you know where the docs are on what salt considers to be a shell?
16:43 afengler Any chance I can tell it that my program is the shell?
16:43 viq afengler: I don't believe it cares at all
16:43 tiwula joined #salt
16:43 afengler It doesn't check /etc/shells?
16:43 onslack <mts-salt> salt isn't that great at just running cmd, it's intended to assert a state
16:44 Sokel viq: it complains that the grain has to be a dictionary when using setvals.
16:44 afengler I was under the impression that salt was originally for running commands?
16:44 onslack <mts-salt> of course there's nothing stopping you writing a custom module to do what you want
16:44 viq afengler: how about https://docs.saltstack.com/en/latest/ref/states/all/salt.states.cmd.html#salt.states.cmd.script ?
16:44 afengler And the configuration state was bolted on after
16:45 onslack <mts-salt> oh sure, it can do it, but as you're finding out, it's not great at just running commands without you having to do more work managing the commands themselves
16:46 viq afengler: from a quick glance at https://github.com/saltstack/salt/blob/develop/salt/modules/cmdmod.py salt doesn't seem to care what you tell it to use as shell to run commands through
16:46 viq Ah, no, I'm mistaken
16:46 viq https://github.com/saltstack/salt/blob/develop/salt/modules/cmdmod.py#L2988
16:48 onslack <mts-salt> so a custom module might fit your use case better
16:49 afengler Interesting, I could just make a "custom" version of cmdmod that just has that subroutine modified
16:49 afengler I don't know python, so I'm trying to avoid custom development
16:52 onslack <mts-salt> well, significantly cut down, but yes
16:54 afengler Ok, thanks, this has been very helpful.  Nothing to do now but try
16:54 aldevar left #salt
16:59 pocketprotector joined #salt
17:02 ExtraCrispy joined #salt
17:05 syd_salt2 joined #salt
17:08 thelocehiliosan joined #salt
17:16 Pjusur joined #salt
17:16 Vaelatern joined #salt
17:34 thelocehiliosan joined #salt
17:38 shpoont joined #salt
17:40 yuhl joined #salt
17:52 aldevar joined #salt
17:57 cliluw joined #salt
18:08 pppingme joined #salt
18:12 Sokel left #salt
18:22 exarkun joined #salt
18:31 ngrennan joined #salt
18:32 ngrennan left #salt
18:38 ymasson joined #salt
18:39 erilytra joined #salt
18:39 erilytra left #salt
19:13 lordcirth_work Can someone run file.get_file_meta on the command line and tell me what args you used?  I can't get it to run without vague errors
19:23 imanc_ left #salt
19:23 aldevar joined #salt
19:27 DammitJim joined #salt
19:27 Trauma joined #salt
19:29 pmcg joined #salt
19:39 thelocehiliosan joined #salt
20:02 exarkun joined #salt
20:12 lordcirth_work Ok this is annoying I've spent nearly as much time trying to figure out file.check_file_meta args as I have writing code
20:13 BitBandit joined #salt
20:14 gmoro_ joined #salt
20:15 hemebond lordcirth_work: What is get_file_meta?
20:15 lordcirth_work Sorry, I meant check_file_meta
20:15 hemebond Oh
20:15 hemebond "takes at least 8 arguments (1 given)" LOL cripes
20:15 lordcirth_work The fun of Python functions that accept any argument type, until they break obscurely 2 functions below
20:16 lordcirth_work Yours says 8? Mine (develop) is 9
20:16 lordcirth_work Still, close enough
20:17 lordcirth_work I intend to add a tenth with my PR, but I want to get a working testcase *before* changing it, lol
20:17 hemebond Oh, this wants a full file definition to compare. One sec.
20:17 lordcirth_work The example doc is: salt '*' file.check_file_meta /etc/httpd/conf.d/httpd.conf salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' root, root, '755' base
20:17 lordcirth_work But that has 2 filenames, and the function takes 3: name, sfn, source
20:18 lordcirth_work I am comparing 2 versions of a sshd_config
20:21 hemebond Why does it want a source _and_ contents?
20:22 onlyanegg joined #salt
20:23 hemebond Yeah, doesn't work.
20:27 hemebond Oh, it wants attrs too.
20:29 shpoont joined #salt
20:33 inad922 joined #salt
20:39 hemebond lordcirth_work: The closest I can get is an error on `lstats = stats(name, hash_type=source_sum.get('hash_type', None),`
20:40 hemebond The documentation is so terribly wrong.
20:40 hemebond Missing quotes, commas...
20:42 major joined #salt
20:42 hemebond It's almost like it's not meant to be called directly.
20:42 hemebond But only used internally.
20:43 inad922 joined #salt
20:53 lordcirth_work hemebond, it's not meant to be, no, but I need to test
20:53 lordcirth_work hemebond, if you can help me figure out what the docs *should* be, I'll include it in my PR
20:53 hemebond I'm sorry I don't have any more time this morning.
20:54 hemebond I couldn't get it to work at all.
20:54 lordcirth_work Ok np.  Thanks for trying
20:54 hemebond It doesn't even seem to parse the source_sum argument properly.
20:54 hemebond Which suggests it will never work externally.
20:55 lordcirth_work Isn't the parsing done by some generic python thing, though?
20:55 lordcirth_work Ie if it's possible to pass the right type in Python, it should be possible from the command line?
20:56 hemebond Yes, but it doesn't parse the string you pass in.
20:56 hemebond Which is why I get that error.
20:56 lordcirth_work I did get the source_sum to work though
20:56 hemebond Then perhaps it's not actually trying to use my source_sum string, but a different parameter.
20:57 lordcirth_work '{"hash_type": "sha256", "hsum": "739cf2eec1baad12cbd0d722b6941f01100e3a7e8a0dbbb66d7caea08911fd05"}'
20:57 hemebond There are some funky things going on with the first few parameters.
20:57 lordcirth_work I tried it using all named parameters, to try to clear it up
20:57 hemebond Yeah, I tried it like that too.
20:59 hemebond I tried that too, but keep getting errors like `got multiple values for keyword argument 'source'`
20:59 hemebond `got multiple values for keyword argument 'source_sum'`
20:59 lordcirth_work Yeah, anything that you *don't* name it assumes at the beginning
21:00 lordcirth_work So the first non-named thing becomes 'name' even if you already assigned name=
21:00 lordcirth_work And so on
21:00 hemebond Sure.
21:01 hemebond But now it thinks I don't have enough arguments.
21:01 hemebond oh, I got it
21:02 hemebond salt minion file.check_file_meta name=/usr/lib/nagios/plugins/check_ceph sfn="salt://monitoring-plugins/files/check_ceph" source="salt://monitoring-plugins/files/check_ceph" source_sum='{hash_type: 'md5', 'hsum': 560ebc786ae8a04c9f1cb643acda3d22}' user=root group=root mode='755' saltenv=base
21:03 hemebond Ooooh, now I understand the difference between name and sfn.
21:04 hemebond This is how I would write the command:
21:04 hemebond salt minion file.check_file_meta name='/usr/lib/nagios/plugins/check_ceph' sfn='salt://monitoring-plugins/files/check_ceph' source='salt://monitoring-plugins/files/check_ceph' source_sum='{"hash_type": "md5", "hsum": "560ebc786ae8a04c9f1cb643acda3d22"}' user='root' group='root' mode='755' saltenv='base'
21:07 lordcirth_work hemebond, ok, so do sfn and source have to be urls or can they all be local paths for testing?
21:08 hemebond Hmm. Let me test.
21:09 hemebond I would assume `source` can be any valid file source similar to file.managed
21:09 hemebond `sfn` works with a local file path.
21:10 hemebond Local file path works for source too.
21:10 hemebond As in, it accepts it.
21:10 hemebond But this particular file isn't a template.
21:10 lordcirth_work hemebond, ok, but when I do that, I get: Passed invalid arguments to file.check_file_meta: unified_diff() argument after * must be an iterable, not NoneType
21:10 hemebond When you do what? Use a local path for sfn?
21:10 lordcirth_work Which I think is actually being thrown way down in get_diff() (arg python why?!)
21:10 lordcirth_work Yes
21:12 hemebond I think I'll have to test with different contents.
21:13 lordcirth_work I've got 2 slightly different sshd_config 's
21:15 hemebond I just get `diff: Replace text file with binary file` when pointing to a different source and sfn
21:15 lordcirth_work salt '*' file.check_file_meta name='/root/sshd_config' sfn='/root/sshd_config_2' source='salt://sshd_config_2' source_sum='{hash_type: 'sha256', 'hsum': 739cf2eec1baad12cbd0d722b6941f01100e3a7e8a0dbbb66d7caea08911fd05}' user='root' group='root' mode='755' attrs=None saltenv='base'
21:15 lordcirth_work Any mistakes that you see?
21:16 hemebond so /root/sshd_config_2 is different to the one in salt://sshd_config_2 ?
21:17 hemebond No wait....
21:17 lordcirth_work Different files, same contents
21:18 hemebond Is /root/sshd_config different to /root/sshd_config_2?
21:18 om2 joined #salt
21:20 lordcirth_work yes, 2 line diff
21:22 lordcirth_work ... I just had get_diff working the other day.  Now it isn't?
21:22 hemebond I don't understand why it wants sfn _and_ source.
21:24 tiwula joined #salt
21:24 lordcirth_work Me either
21:25 lordcirth_work Now the simple "salt-call file.get_diff /root/sshd_config /root/sshd_config_2" is throwing: AttributeError: 'NoneType' object has no attribute 'extend'
21:25 lordcirth_work And I don't think I even changed it
21:27 lordcirth_work Well, above it has args = [], and then args.extend throws an error, and in between I run my new function on args, so that must be the problem
21:28 lordcirth_work And of course it's an indenting issue, 'return args' was one layer too deep
21:28 hemebond get_diff is very different in develop.
21:28 lordcirth_work And now file.check_file_meta works
21:28 smead joined #salt
21:28 lordcirth_work Probably, it's over a year ahead
21:28 hemebond I don't have access to a develop master.
21:42 exarkun joined #salt
21:48 ecdhe I am trying to 'pip3 install PyVISA' on centos7 with saltstack.
21:49 ecdhe If I run 'pip3 install PyVISA' it installs fine.
21:49 ecdhe But if I use pip.installed, I get a failure when saltstack chokes trying to run: "python setup.py egg_info"
21:49 ecdhe This command is, of course, wrong, because you shouldn't use python2 to get egg_info from a pip3 package.
21:50 ecdhe In this case, python2 setup.py egg_info is failing with a UnicodeDecodeError exception.
21:50 hemebond ecdhe: bin_env: '/usr/local/bin/pip3'
21:51 ecdhe - bin_env: /usr/bin/pip3
21:51 tiwula joined #salt
21:58 dendazen joined #salt
22:02 schemanic joined #salt
22:02 ecdhe hemebond: I had already selected bin_env.
22:03 ecdhe I've got pip3 from IUS on centos since python3 isn't provided by default.
22:04 Rubin I need to patch the pxe rom used by proxmox vms. anyone have experience with how they are built? I have ipxe source compiling etc just wondering can i just replace /usr/share/kvm/pxe-* or do they need any customizations? or is there an option to point to alternate ones?
22:05 sjorge joined #salt
22:07 pcdummy Rubin: maybe ##proxmox helps
22:08 Rubin sorry, i meant to write in there
22:10 shpoont joined #salt
22:14 cgiroua joined #salt
22:29 Hybrid joined #salt
22:56 shpoont joined #salt
22:57 eightyeight joined #salt
22:57 thelocehiliosan joined #salt
22:59 major joined #salt
23:00 copec joined #salt
23:08 Trauma joined #salt
23:16 hoolio joined #salt
23:19 viq joined #salt
23:22 exarkun joined #salt
23:42 dendazen joined #salt
23:46 onlyanegg Is there somethin like {% from x import y with context %} in the py renderer?
23:47 hemebond onlyanegg: I couldn't find a way except sending the template for parsing.
23:47 onlyanegg sending the template for parsing?
23:48 hemebond https://github.com/hemebond/icinga2-formula/blob/master/icinga2/objects.sls
23:48 hemebond You can see me manually reading in templates in that file.
23:48 onlyanegg oh, interesting
23:49 onlyanegg thx!
23:49 XenophonF OMG that's a Python file
23:49 XenophonF how cool is that?
23:50 hemebond 👍
23:51 whytewolf btw. {% from 'file' import var1 with context %} is a thing
23:51 whytewolf http://jinja.pocoo.org/docs/2.10/templates/#import-context-behavior

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