Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2018-02-06

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

All times shown according to UTC.

Time Nick Message
00:11 pipps joined #salt
00:18 stanchan joined #salt
00:26 zerocoolback joined #salt
00:41 Edgan Anyone have experience with salt and zookeeper? I need to find a stateful way to create znodes.
00:41 Edgan nm, figured it out
00:53 pipps joined #salt
00:57 kiorky joined #salt
00:58 Edgan gtmanfred: Do you know when this might get into 2017.7 or the next major release? https://github.com/saltstack/salt/blob/develop/salt/states/zookeeper.py
00:59 saltslackbridge <gtmanfred> It won't ever be in 2017.7
00:59 saltslackbridge <gtmanfred> It will be in oxygen
01:00 Edgan gtmanfred: I guess I will need to try backporting it to 2017.7. I have a need for it today.
01:00 kiorky joined #salt
01:00 saltslackbridge <gtmanfred> I can't remember a reason that you couldn't drop it in the dynamic modules for 2017
01:01 Edgan gtmanfred: I will try it tomorrow. Time to start making my own salt debs yet again. :)
01:02 stanchan joined #salt
01:03 kiorky joined #salt
01:12 pipps joined #salt
01:13 pipps99 joined #salt
01:14 shiranaihito joined #salt
01:18 pipps joined #salt
01:30 zerocoolback joined #salt
02:03 stanchan joined #salt
02:24 pipps joined #salt
02:58 ilbot3 joined #salt
02:58 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.9, 2017.7.3 <+> 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
02:58 nomeed joined #salt
03:09 wongster80 joined #salt
03:23 ponyofdeath joined #salt
03:29 wongster80 joined #salt
03:54 stanchan joined #salt
04:07 om2 joined #salt
04:20 lompik joined #salt
04:34 ingy https://docs.saltstack.com/en/getstarted/fundamentals/index.html has this line under step 4 for Mac: cd ~\Downloads\salt-vagrant-demo-master
04:35 ingy Is that website source on github?
05:17 yn^ joined #salt
05:18 shah^ joined #salt
06:02 cilkay joined #salt
06:04 Bryson joined #salt
06:22 pualj joined #salt
06:22 stanchan joined #salt
06:26 pualj_ joined #salt
06:55 aldevar joined #salt
07:02 ProT-0-TypE joined #salt
07:07 inad922 joined #salt
07:09 ipsecguy_ joined #salt
07:22 Tucky joined #salt
07:28 jas02 joined #salt
07:44 zulutango joined #salt
07:50 scarcry joined #salt
08:05 v12aml joined #salt
08:05 aldevar joined #salt
08:10 q1x joined #salt
08:14 ct16k joined #salt
08:21 Hybrid joined #salt
08:24 jrenner joined #salt
08:33 pbandark1 joined #salt
08:36 justanotheruser joined #salt
08:40 ct16k joined #salt
08:52 justanotheruser joined #salt
08:53 wongster80 joined #salt
08:55 mikecmpbll joined #salt
08:58 _pualj_ joined #salt
09:01 Kelsar joined #salt
09:06 jas02 joined #salt
09:18 yuhl joined #salt
09:23 Mattch joined #salt
09:24 Guest73 joined #salt
09:30 colegatron joined #salt
09:36 vb29 joined #salt
09:37 jas02 joined #salt
09:38 vb291 joined #salt
09:40 hoonetorg joined #salt
09:48 saltslackbridge <haam3r> So if I'm using git as a fileserver backend, then at which point should the cache under `/var/cache/salt/minion` get updated/pulled to the latest commit? Talking about a masterless minion
09:51 vb291 left #salt
09:52 vb291 joined #salt
09:53 buumi joined #salt
09:54 vb29 joined #salt
09:54 saltslackbridge <mts-salt> when you tell it to
09:54 saltslackbridge <mts-salt> afaik there is no automated update, intentionally
09:56 vb29 Hi, I am trying to execute a state in .sls file using salt-call on windows minion....can anyone please tell me which is the base directory where I should place this file...the salt installation exists in 'C:\salt'
09:56 saltslackbridge <mts-salt> vb29: do you have a master?
09:57 vb29 yes
09:57 buumi Hey, sorry for basic question but salt-newbie here and i've hard time figuring how to do this properly: i want to use https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_wua.html#salt.modules.win_wua.get_needs_reboot to check if system needs to rebooted and reboot if this returns true. I know module.run but how do i get that "True" value stored and use it in another module call?
09:57 saltslackbridge <mts-salt> then files should be on the master rather than the minion. they'll be pulled down as they're needed based on top.sls
09:58 ct16k joined #salt
09:58 vb29 I am trying to test something that is why I need them on minion  and want to run salt-call :)
09:58 vb29 (remember yesterday's  the nexus issue :) )
09:59 vb29 I am still stuck with that trying out something
10:00 saltslackbridge <mts-salt> vb29: i use a fake masterless config for exactly that.  it's hacky but it works. files go into C:\salt\srv\salt and i use `salt-call --local state.sls test`
10:01 buumi Also addition to previous message, i'm trying to build salt-state which installs updates and reboots only if reboot is needed, the winwui-state module does not yet support this so i'm trying to build it using execution module
10:03 vb29 saltslackbridge: great! that works.. Thanks! :)
10:04 saltslackbridge <haam3r> @mts-salt Okay...and how do I tell it do that?
10:05 gmoro joined #salt
10:05 zerocoolback joined #salt
10:06 saltslackbridge <haam3r> Having trouble understanding why it does not auto update for a masterless minion, but does it on a salt-master
10:12 Larry joined #salt
10:13 saltslackbridge <mts-salt> @hammr: i believe the command was: salt-call saltutil.runner fileserver.update
10:13 saltslackbridge <mts-salt> the same command would be used on the master as well
10:14 saltslackbridge <mts-salt> well, using salt-run anyway
10:17 saltslackbridge <haam3r> Okay...was guessing that. Still does not seem to update the cache properly. Guess I have more debugging ahead of me :slightly_smiling_face:
10:17 saltslackbridge <mts-salt> if it's git_pillar then you'd also need to refresh that using git_pillar.update
10:18 saltslackbridge <mts-salt> that one doesn't get done by fileserver.update
10:22 saltslackbridge <haam3r> when running fileserver.update with debug I can actually see that it at least appears to also update the the git_pillar :9
10:24 saltslackbridge <mts-salt> oh ok, i guess i've just gotten used to running the pillar update when i update pillar :slightly_smiling_face:
10:25 yidhra joined #salt
10:28 saltslackbridge <haam3r> Yeah since the master by default does an update every 60 seconds...and I have reactors setup for git pushes I haven't had to worry about this stuff either.
10:29 saltslackbridge <mts-salt> our setup doesn't auto-update so i wouldn't know :slightly_smiling_face:
10:29 jrj_ joined #salt
10:30 saltslackbridge <mts-salt> eventually we'll have it properly branched with environments, and master will only get updated by approved mr, but for now it's still a very new config
10:31 jrj_ joined #salt
10:33 DanyC joined #salt
10:34 jas02 joined #salt
10:35 jrj__ joined #salt
10:36 jrj_ joined #salt
10:37 saltslackbridge <haam3r> Okey cool
10:42 yidhra joined #salt
10:44 vb29 This is regarding the error  "<urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>"  which I am getting while downloading package from my nexus repository...
10:44 vb29 I tried executing the state file from the salt master and it worked
10:45 vb29 sorry
10:45 vb29 I tried exeucting the state file from salt minion using salt-call and that worked
10:45 vb29 https://paste.debian.net/1009013/
10:45 vb29 https://paste.debian.net/1009012/
10:45 vb29 But executing the same state from salt-master throws error
10:46 vb29 anyone having any idea what could be the problem?
11:00 saltslackbridge <mts-salt> what were the exact commands used to trigger each?
11:02 saltslackbridge <mts-salt> because one of them downloaded a new file, and one of them the file existed
11:02 xet7 joined #salt
11:03 saltslackbridge <mts-salt> and i'm looking at both outputs and i don't see the error
11:04 saltslackbridge <mts-salt> afaics both succeeded
11:06 vb29 salt-call --local state.sls common.get_artifact -l debug
11:07 vb29 this is the command that I used....and I ran it twice...for the first run the file wasn't there so it downloaded the file and for the second run it matched the checksum and didnt do anything
11:08 saltslackbridge <mts-salt> so that's running masterless
11:08 vb29 So, yes ...from minion it works...but how do I make this work from my master?
11:11 jrj_ joined #salt
11:11 xet7 joined #salt
11:21 lxsameer joined #salt
11:21 Deliant joined #salt
11:21 lxsameer hey folks, is it possible to update minion configurations using salt it self ? I want to add a master to my stack
11:24 saltslackbridge <mts-salt> vb29: the master would need the same states, pillar, and any other config that you needed to make it work masterless
11:25 saltslackbridge <mts-salt> lxsameer: do you mean you want to manage the salt minion's config file? that's certainly possible
11:26 _JZ_ joined #salt
11:27 lxsameer @mts-salt: cool, but the question is if i restart my minion service, is it going to restart my other services in the same box which managed by salt ?
11:28 saltslackbridge <mts-salt> only if you have your minion set to highstate on startup
11:28 saltslackbridge <mts-salt> ... and those states somehow cause a service to restart
11:29 saltslackbridge <mts-salt> aiui salt should be an optional layer on top of a system. the system itself should be completely operational even if salt is removed
11:30 oida joined #salt
11:34 xet7_ joined #salt
11:36 lxsameer an other question would be, is it possible to write a state which makes sure that a value of a key in a yaml file is set to specific value ?
11:37 viq lxsameer: "anything is possible" ;)
11:37 saltslackbridge <mts-salt> that depends... ;)
11:37 viq lxsameer: there is a salt-formula exactly for managing salt from salt
11:37 saltslackbridge <mts-salt> will the entire file be managed, or just that one value?
11:38 xet7_ joined #salt
11:43 vb29 saltslackbridge: yes the states, pillars and other configurations are the same just as masterless
11:47 sris joined #salt
11:48 saltslackbridge <mts-salt> i have to assume that there's something that's not quite the same, since it's not behaving the same, although i wouldn't know where to look. i believe it's a single state so it's not like you can simplify it any further :slightly_smiling_face:
11:50 xet7 joined #salt
11:54 saltslackbridge <mts-salt> i guess you could create a new state with all hard-coded values and see if that succeeds or fails. unless someone else has any bright ideas i think you're left with trying to cut the problem up until you can find something that works, and then work back towards where you want it to be
11:56 saltslackbridge <mts-salt> given that you now have a working masterless config, you should be able to compare the two on the minion and see if there's any config differences
11:58 vb29 yes...the test I did on masterless is not having any pillar value..it has all hardcoded values and the same state I copied on the master node and ran it...but that doesn't work
11:59 saltslackbridge <mts-salt> so perhaps there's something extra on the master that the formula is using
11:59 vb29 but I can compare the config files just to see if there are any differences
11:59 jas02 joined #salt
11:59 saltslackbridge <mts-salt> worth a try
12:01 jas02 joined #salt
12:02 supermike___ joined #salt
12:02 boriel joined #salt
12:03 lxsameer @mts-salt : just one key value
12:05 saltslackbridge <mts-salt> shame, that's beyond my current experience :slightly_smiling_face:
12:06 lxsameer @mts-salt: thanks man
12:07 jas02 joined #salt
12:09 jas02 joined #salt
12:10 saltslackbridge <mts-salt> looking at it, perhaps the regex in file.replace could do what you're after...?
12:13 lxsameer @mts-salt: yeah that's a good idea
12:19 xet7 joined #salt
12:22 mattfoxxx joined #salt
12:37 zeromorphism_ joined #salt
13:00 LostSoul joined #salt
13:13 vb29 the config files are not having anything different they are the same :(
13:14 Nahual joined #salt
13:18 vb29 I even tried using cmd.run to trigger salt-call (as a dirty workaround) so that the packages can get downloaded but in that case I get  'The function "state.apply" is running as PID 904 and was started at 2018, Feb 06 13:55:55.330588 with jid 20180206135555330588'
13:18 vb29 stdout:
13:18 vb29 local:
13:18 vb29 Data failed to compile:
13:18 vb29 ----------
13:18 vb29 The function "state.apply" is running as PID 904 and was started at 2018, Feb 06 13:55:55.330588 with jid 20180206135555330588
13:18 vb29 an error message
13:22 vb29 so I used cmd.run (from master) to trigger salt-call (on minion)
13:28 babilen Please use a pastebin such as http://paste.debian.net, https://gist.github.com, http://sprunge.us, …
13:29 babilen That error just means that a highstate is already running with PID 904. You can lookup more information on that using "salt-run jobs.lookup_jid 904"
13:29 babilen (cf. https://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.jobs.html)
13:30 babilen As you can't run two jobs at the same time you are seeing an error
13:30 exarkun joined #salt
13:30 sami joined #salt
13:31 vb29 babilen: but it says "Data failed to compile"
13:32 exarkun I want to supply some data to a state (a cmd.run).  The data comes out of a previous state (another cmd.run).  How can I do this?
13:33 sami I'm just learning salt and having some issues. https://gist.github.com/samimb/afdd577640884c2b53cf5aee7baab31d this top.sls gives me Illegal tab character; line 2
13:34 babilen exarkun: Run it via the execution module, save output in a variable .. reference it. But generally speaking that is an antipattern and there might be a better approach.
13:34 MTecknology sami: did you accidentally get a tab?
13:34 babilen sami: You might want to normalise your whitespace and stick to spaces everywhere. Depending on your editor you can configure it to use only spaces or even make different whitespace visible.
13:35 exarkun babilen: It feels like an anti-pattern to me but I'm not sure what else to do given the piece of software I'm trying to deploy.  Configuring it requires a particular value and that value is produced by configuring another part of it.
13:35 sami Using vim with et ts=2 sts=2 sw=2
13:37 babilen sami: Sounds about right .. maybe run ":retab" ?
13:38 sami babilen: No changes.
13:38 Hybrid joined #salt
13:38 xet7_ joined #salt
13:38 jas02 joined #salt
13:39 babilen exarkun: You could configure a custom grain for that value and use "reload_grains: True" in the previous state declaration (cf. https://docs.saltstack.com/en/latest/ref/states/requisites.html#altering-states)
13:39 babilen exarkun: Really depends on your code though, which is hard to say without more knowledge
13:41 babilen sami: Could you paste your exact command and its output? Also make sure to run "salt-run fileserver.update" after making changes to your states.
13:41 exarkun When you say "execution module" what do you mean?  Searching the docs finds https://docs.saltstack.com/en/latest/ref/modules/all/index.html (which doesn't quite seem related) and https://docs.saltstack.com/en/latest/ref/modules/ (maybe that's it?)
13:42 babilen https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cmdmod.html
13:43 babilen But then .. the software should just do that in its maintainer scripts ;)
13:43 exarkun aha.  great, thanks.  I'll read about that and more about custom grains and see what I can come up with.
13:44 babilen Custom grain might come in handy if you want to target boxes based on that value .. Something like "Run this command on all 'grain: foo' boxes and another on 'grain: bar' ones"
13:44 babilen Or if you need it in various different places
13:47 sami babilen: I've updated the gist: https://gist.github.com/samimb/afdd577640884c2b53cf5aee7baab31d
13:47 jas02 joined #salt
13:48 Guest73 joined #salt
13:50 jas02 joined #salt
13:56 Hybrid joined #salt
14:01 GrisKo joined #salt
14:04 Guest73 joined #salt
14:05 babilen sami: Isn't that about the pillar's top.sls rather than the states' ?
14:05 babilen The top.sls you pasted starts with "- requirements" rather than "- users"
14:07 sami It's strange, even if I remove the - users line, I get the same error
14:08 babilen So you looked at your pillar file?
14:09 babilen And the state file?
14:09 sami Just a sec and let me upload it all
14:09 babilen You can always run the minion and master in debug mode (salt-{master,minion} -ldebug) and execute "salt 'some-minion' saltutil.refresh_pillar"
14:11 saltslackbridge <mts-salt> even easier, on the minion run: salt-call saltutil.refresh_pillar -l debug
14:11 babilen Or that
14:12 babilen +/- state.apply
14:16 MTecknology Is mercurial supported as a back-end to salt?
14:16 sami Now then: https://gist.github.com/samimb/afdd577640884c2b53cf5aee7baab31d
14:16 MTecknology It doesn't seem like there's an hgfs_provider so I assume that answer is no..
14:17 gh34 joined #salt
14:19 saltslackbridge <mts-salt> @sami: what you've pasted has spaces in, so i wonder if it's not the real file but instead the output from the logs...?
14:20 saltslackbridge <mts-salt> or perhaps your ssh client is using spaces instead of tabs
14:23 edrocks joined #salt
14:25 sami saltslackbridge: https://gist.github.com/samimb/afdd577640884c2b53cf5aee7baab31d
14:27 racooper joined #salt
14:29 tys_ joined #salt
14:31 saltslackbridge <mts-salt> same problem, the whitespace is still just spaces, which doesn't match that error. i wonder if it's not using the ifle you think it is
14:31 saltslackbridge <mts-salt> *file
14:33 saltslackbridge <mts-salt> try checking the file content using: cat -A top.sls
14:33 saltslackbridge <mts-salt> that'll show any non-printing characters, plus it'll show the end of line as $
14:34 sami Just showing end of lines after each
14:35 saltslackbridge <mts-salt> could you run the test on the minion using: salt-call -l debug state.show_highstate
14:35 saltslackbridge <mts-salt> and then paste the entire logs
14:36 sami huh.. does a user have to have a uid set? - Rendering SLS 'base:users' failed: Jinja variable 'dict object' has no attribute 'uid'
14:37 concerti joined #salt
14:37 saltslackbridge <mts-salt> it depends on what that template is expanding
14:37 saltslackbridge <mts-salt> which jinja variable are you using?
14:38 sami Setting a uid fixed the initial issue
14:38 sami Got more issues now but I think I'll be able to solve them
14:46 Karunamon joined #salt
14:47 Karunamon Huya folks, wondering if I'm doing something terribly wrong with ssh_auth.absent. I've got a file that .present is pointed at that works fine, but an identical file used by .absent appears to be ignored entirely.
14:51 Karunamon or rather, it thinks none of the keys in that file are there judging by the -linfo output
14:52 DammitJim joined #salt
14:52 doriftoshoes___ joined #salt
14:54 Karunamon put another way, I can call .present, it works, move the exact key added to the file I'm using for .absent, and it's ignored
14:55 bounceman joined #salt
14:56 imanc_ joined #salt
14:56 imanc_ joined #salt
14:56 bounceman Howdy, can salt manage existing VPCs on AWS? We wish to define an already existing VPC and create a subnet within that one. I can only find ways to create a competely new VPC.
14:57 saltslackbridge <mts-salt> @Karunamon: are you sure the states aren't running in the opposite order?
14:58 megamaced joined #salt
14:59 Karunamon ls
14:59 Karunamon @mts-salt: Quite positive, since I've broken the present and the absent state out into entirely different SLS files and I'm calling them by hand
15:02 saltslackbridge <mts-salt> can you pastebin the debug output from running that state on the minion?
15:05 Guest73 joined #salt
15:08 oida_ joined #salt
15:23 BitBandit joined #salt
15:25 Karunamon @mts-salt: One idiot point for me - found out I mangled the copy pasting of the keys to be removed. No problems here >_<
15:27 oida_ joined #salt
15:27 Guest73 joined #salt
15:28 XenophonF bounceman: You can modify existing VPCs with salt.
15:29 XenophonF bounceman: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.boto_vpc.html#salt.states.boto_vpc.subnet_present
15:30 alvinstarr joined #salt
15:30 mikecmpb_ joined #salt
15:32 dandja joined #salt
15:32 cgiroua joined #salt
15:32 lompik joined #salt
15:36 exarkun I don't understand this "is not formed as a list" error message I keep getting
15:36 gmoro joined #salt
15:37 aviau joined #salt
15:37 saltslackbridge <mts-salt> check that each entry is indented and starts with a -
15:37 exarkun They are and they don't
15:38 saltslackbridge <mts-salt> a list is made up of indented lines prefixed with -
15:38 saltslackbridge <mts-salt> so if they're not there then it's asking you to add them
15:38 exarkun None of the examples I see in the docs put a list here
15:39 XenophonF exarkun: can you post a gist or something?
15:40 exarkun sure, https://gist.github.com/exarkun/d8a71ef2bc025e1a69619b03d202c666
15:40 exarkun The error only arose after I added lines 7-13
15:41 saltslackbridge <mts-salt> are you trying to use pkg.installed?
15:41 saltslackbridge <mts-salt> if so then that should be on one line
15:41 exarkun I think I tried that first.  But ... How do I get from "is not formed as a list" to that?
15:42 saltslackbridge <mts-salt> you could try it as: pkg.installed: []
15:42 exarkun It's the same error if I replace the `pkg:` object with `pkg.installed`
15:42 exarkun And the same error if I replace it with `pkg.installed: []`
15:43 saltslackbridge <mts-salt> alternatively have a friendly name for the id and include, for example: - name: virtualenv
15:43 exarkun I still don't understand the error.
15:43 saltslackbridge <mts-salt> it's a parsing error, that's all. welcome to yaml :S
15:45 exarkun Used yaml plenty (hate it, plenty).  This parses fine, fwiw.  And then salt applies some additional constraint on top of that and doesn't clearly explain what the constraint is.
15:45 MTecknology I kinda like yaml
15:45 jas02 joined #salt
15:46 exarkun I replaced it with:
15:46 exarkun python:
15:46 exarkun pkg.installed:
15:46 exarkun - name: "python2.7"
15:46 exarkun same error again
15:46 MTecknology use a pastebin service like dpaste.com next time
15:46 JawnAuz joined #salt
15:46 scbunn joined #salt
15:46 exarkun MTecknology: https://gist.github.com/exarkun/22eabc2d70da7965e7db067cff922904
15:47 saltslackbridge <mts-salt> the examples i see on https://docs.saltstack.com/en/latest/ref/states/all/salt.states.pkg.html#salt.states.pkg.installed are many and varied. which one is closest to what you'd like to to?
15:47 saltslackbridge <mts-salt> do
15:48 jas02_ joined #salt
15:48 exarkun mts-salt: The on at the top of the page: `vim:\n  pkg.installed\n`
15:48 exarkun the one that doesn't work
15:49 saltslackbridge <mts-salt> oh i see. you've got one id at the top, and what's underneath should be state modules. instead you've got a pair of package names
15:50 saltslackbridge <mts-salt> so line 7 should be pkg.installed because line 1 is the id
15:50 exarkun aha
15:50 saltslackbridge <mts-salt> then under that line 8 should be name
15:50 justanotheruser joined #salt
15:51 exarkun So in `vim:\n  pkg.installed\n`, `vim` is an id?  And that form is fine if used in the appropriate context - like if I made it top-level instead of underneath my id?
15:51 exarkun And the missing list it is complaining about is the body of `python2.7`, which is not a list because I was trying to use it like `python2.7` was an id, not like it was state module (which it is not)?
15:51 saltslackbridge <mts-salt> i think so :slightly_smiling_face:
15:52 saltslackbridge <mts-salt> i can't tell what the missing list is in relation to
15:52 exarkun So perhaps a better error would have been something like "python2.7 is not a state module" (but who knows maybe it can't figure that out)
15:52 saltslackbridge <mts-salt> but the 2nd level should be states,yes
15:54 exarkun Great, replacing it with `pkg.installed:\n  - pkgs:\n    - python2.7\n    - virtualenv\n` seems to have fixed it.  Thank you.
15:58 TTimo exarkun: wowow
16:00 exarkun Hi TTimo :)
16:01 TTimo :)
16:04 Notorious joined #salt
16:10 jas02 joined #salt
16:11 notorious joined #salt
16:14 notorious joined #salt
16:15 wonko21 joined #salt
16:22 Guest73 joined #salt
16:23 notorious joined #salt
16:24 jkerr joined #salt
16:25 DanyC joined #salt
16:28 mikecmpbll joined #salt
16:31 notorious joined #salt
16:40 exarkun I put a multiline string into my cmd.run with `: >` yaml syntax which replaces single internal newlines with space, so the result should not have newlines when it is executed
16:40 notorious_ joined #salt
16:40 exarkun but when salt goes to apply the state, the command fails because it is being run as though there are newlines
16:40 jas02 joined #salt
16:40 exarkun what's up with that?
16:44 jas02 joined #salt
16:46 saltslackbridge <mts-salt> salt prefers multiline content to be specified using a different syntax. i can't find an example in the docs now, but it's something like: cmd.run: |\n  - line\n- line
16:46 saltslackbridge <mts-salt> the pipe at the end of the first line is then followed by a list of the lines themselves
16:47 saltslackbridge <mts-salt> ah, not a list
16:48 saltslackbridge <mts-salt> example found: https://groups.google.com/forum/#!topic/salt-users/C9YgCBUDUSk
16:54 exarkun I want my source to have multiple lines for a value which does not have multiple lines
16:54 Guest73 joined #salt
16:54 exarkun It looks like that post is about how to represent values that have multiple lines
16:54 exarkun It seems to just be saying "use this standard feature of yaml" which would be great, that's exactly what I want the answer to be
16:55 exarkun but if I use the standard feature of yaml for doing this, ": >", I get newlines in the value anyway.
16:56 saltslackbridge <mts-salt> i've never needed to have a value that needs to be line-wrapped. i just keep it on one line
16:57 stanchan joined #salt
16:57 exarkun A bit annoying to have 200 character wide lines when the content has natural break points that would easily make it fit onto a regular screen :/
16:57 exarkun And a bit annoying to have a standard yaml feature taken away ... what other standard features will be taken away
16:58 nixjdm joined #salt
16:58 saltslackbridge <mts-salt> i see the syntax for > where newlines are replaced by spaces, is that what you mean?
16:59 saltslackbridge <mts-salt> lots and lots of examples on https://stackoverflow.com/questions/3790454/in-yaml-how-do-i-break-a-string-over-multiple-lines
17:00 exarkun yes
17:00 Bryson joined #salt
17:01 exarkun Same gist as from earlier - https://gist.github.com/exarkun/d8a71ef2bc025e1a69619b03d202c666#file-introducer-sls-L28-L32 - but the command execution fails because each line is executed as a separate command because the newlines haven't been replaced.
17:02 saltslackbridge <mts-salt> that's because you've indented the extra lines. that syntax only works if all the lines are at the same indentation level
17:03 saltslackbridge <mts-salt> judging by the stackoverflow link i pasted, it should be possible to absorb even those
17:03 exarkun ... yay yaml
17:03 exarkun thanks
17:03 exarkun sorry that was dumb, should have checked with a yaml parser directly first
17:04 saltslackbridge <mts-salt> for example, drop the >, put the first line of the command next to name: and indent the other lines one level underneath
17:04 saltslackbridge <mts-salt> not that i've tried it, i'm just reading from that link :slightly_smiling_face:
17:04 saltslackbridge <mts-salt> yes, a yaml parser helps :)
17:04 evle1 joined #salt
17:06 saltslackbridge <mts-salt> i just tried that in http://yaml-online-parser.appspot.com/ and it works
17:07 exarkun yea confirmed, fixes it in practice for mw
17:10 hoonetorg hi the next steps in a formula depend on the result of a command
17:10 hoonetorg how can i do this with salt
17:10 hoonetorg jinja code in sls is evaluated at beginning of run
17:11 jas02 joined #salt
17:13 saltslackbridge <mts-salt> i can't remember if that's being introduced in 2017.7.3 or if you'll have to wait for oxygen. there isn't any way in 2017.7.2 other than using a script to run the command and use the result
17:22 jas02 joined #salt
17:28 ingy exarkun: >- will strip the final newline, FYI
17:28 ingy and >+ will keep all trailing newlines
17:30 aldevar joined #salt
17:31 DanyC joined #salt
17:31 ingy The indent preserving newlines was my idea... probably not one of my best... :)
17:35 exarkun https://gist.github.com/exarkun/33887ce8a4a3474b649ec11a10ab097b
17:44 Guest73 joined #salt
17:48 pipps joined #salt
17:51 zeromorphism joined #salt
18:05 pipps joined #salt
18:05 mikecmpbll joined #salt
18:10 pipps joined #salt
18:12 pipps joined #salt
18:13 Guest73 joined #salt
18:29 wongster80 joined #salt
18:53 whytewolf mts-salt slots [the thing you are thinking of] is going to come out in oxygen. https://docs.saltstack.com/en/develop/topics/slots/index.html
18:54 saltslackbridge <skatz> yep
18:58 ymasson joined #salt
19:01 pipps joined #salt
19:03 Guest73 joined #salt
19:04 scbunn joined #salt
19:04 pipps99 joined #salt
19:05 vb29 joined #salt
19:14 scbunn joined #salt
19:15 hemphill joined #salt
19:16 mrueg joined #salt
19:19 Bryson joined #salt
19:27 exarkun Can a minion be matched by more than one target in top.sls?  Will it have all the states defined by all the targets applied to it?  Or is it something like only the first one matches
19:28 exarkun I thought I read somewhere that they all match but I can't find any docs saying one way or the other now
19:28 exarkun I wrote a top.sls that tries to target the same minion two times (role-based, then I gave one minion both roles) but only the first states are applied.
19:30 bbbryson joined #salt
19:32 user-and-abuser joined #salt
19:32 exarkun Eh.  `state.show_top` tells me both states are going to be applied, so I guess the top file is okay.
19:32 exarkun wonder why they're not both being applied.  maybe because there's an error in the first one?  does that stop it from proceeding?
19:51 edrocks joined #salt
19:52 pipps joined #salt
19:53 Trauma joined #salt
19:55 whytewolf exarkun: only if you have failhard somewhere
19:56 exarkun I didn't type that into any of the files I've typed
19:57 whytewolf try show_highstate
20:03 onovy joined #salt
20:08 ct16k joined #salt
20:11 exarkun What am I looking for in this?
20:12 pipps joined #salt
20:17 Guest73 joined #salt
20:19 inad922 joined #salt
20:19 wongster80 Hi anyone has any success using the --extra-filerefs flag for salt-ssh ? It does not seem to work for me which is preventing me importing other jinja variables from my main sls file
20:20 onovy joined #salt
20:22 whytewolf exarkun: sorry went and grabbed lunch. that is what salt is going to run for your highstate. if the states you expect to be there are not there then it isn't a failing of running a state. but most likely a rendering error
20:23 wongster80 https://gist.github.com/wongster80/1ebce111196d2c19a6dcf566c4f29b7c
20:23 noobiedubie joined #salt
20:23 pipps joined #salt
20:24 neobryyte joined #salt
20:25 noobiedubie hi having issues using the win_network state to set ip and dns servers
20:25 whytewolf wongster80: gitfs?
20:25 wongster80 whytewolf: yes
20:26 whytewolf wongster80: see https://github.com/saltstack/salt/issues/42700
20:27 noobiedubie https://paste.debian.net/hidden/ec8a4905/
20:27 noobiedubie I get this whenever I try to run the state with static dns servers
20:27 whytewolf sounds like something that needs a bug report
20:28 noobiedubie appears to try an validate the dns string and appears to assume output is in byte format
20:28 whytewolf or. even better a PR
20:29 pipps joined #salt
20:29 noobiedubie ok thanks
20:31 wongster80 whytewolf: thanks!
20:33 aldevar joined #salt
20:33 onovy joined #salt
20:33 whytewolf wongster80: I recomend adding any aditional details you can to that bug.
20:34 scc_ joined #salt
20:34 pipps joined #salt
20:35 noobiedubie o lol thought you were talking to me whytewolf
20:35 whytewolf noobiedubie: I was with file a bug report :P
20:36 noobiedubie o ok #iknewit
20:37 pipps99 joined #salt
20:39 pipps_ joined #salt
20:54 stanchan joined #salt
21:00 oida joined #salt
21:01 scbunn joined #salt
21:03 edrocks joined #salt
21:04 nthro joined #salt
21:05 pipps joined #salt
21:12 ct16k joined #salt
21:14 cyteen joined #salt
21:18 schemanic joined #salt
21:24 pipps joined #salt
21:33 pipps99 joined #salt
21:49 Edgan doubletwist: progress?
21:49 Hybrid joined #salt
21:53 doubletwist Edgan: haven't worked on it today
21:53 doubletwist Been too busy watching SpaceX launch and do a tandem booster landing :)
22:00 pipps joined #salt
22:02 mbologna joined #salt
22:04 zerocoolback joined #salt
22:07 zerocoolback joined #salt
22:09 ct16k joined #salt
22:10 zerocoolback joined #salt
22:17 pipps99 joined #salt
22:17 matti joined #salt
22:17 matti joined #salt
22:24 TTimo and smash a third booster for good measure it sounds like
22:25 onovy joined #salt
22:30 ecdhe joined #salt
22:52 pipps joined #salt
22:55 Edgan doubletwist: watching it now too
22:59 pipps joined #salt
23:02 pipps99 joined #salt
23:03 stanchan joined #salt
23:04 pipps99 joined #salt
23:06 xet7 joined #salt
23:19 stanchan joined #salt
23:22 kwork joined #salt
23:27 exarkun joined #salt
23:34 pipps joined #salt
23:37 pipps99 joined #salt
23:38 kwork joined #salt
23:40 pipps joined #salt
23:41 xet7 joined #salt
23:41 stanchan joined #salt
23:42 neobryyte joined #salt
23:44 pipps joined #salt
23:46 kwork joined #salt
23:46 AvengerMoJo joined #salt
23:49 yidhra joined #salt
23:51 pipps joined #salt

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