Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2018-04-01

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

All times shown according to UTC.

Time Nick Message
00:23 hrumph joined #salt
00:23 hrumph hi
00:23 hrumph hi
00:23 hrumph how do i distinguish between python 2 and python 3 in jinja in a salt state file?
00:54 MTecknology You want jinja do do different things based on py2 vs. py3?
00:55 MTecknology why?
00:56 armyriad joined #salt
01:01 armyriad joined #salt
01:17 edrocks joined #salt
01:30 zerocoolback joined #salt
01:31 zerocoolback joined #salt
01:36 Bozo_the_Clown joined #salt
01:55 zerocoolback joined #salt
01:55 zerocoolback joined #salt
01:55 zerocoolback joined #salt
01:57 ilbot3 joined #salt
01:57 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.9, 2017.7.4 <+> RC for 2018.3.0 is out, please test it! <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic, and https://saltstackcommunity.herokuapp.com (for slack) <+> We are volunteers and may not have immediate answers
02:02 shiranaihito joined #salt
02:04 heyimawesome joined #salt
02:07 hrumph MTecknology, some minions will have the py2 windows client installed. some will have the py3
02:07 hrumph hopefully all will have py3 soon
02:09 MTecknology that doesn't really answer the why? question
02:10 hrumph MTecknology, i don't think it would be wise to try to upgrade the python2 minions to python3 using salt to do it
02:10 MTecknology k?
02:10 hrumph so the salt master should just keep the py2 minions as py2 when it comes to upgrading the salt minion client
02:11 hrumph this is with the windows clients i'm talking about
02:11 hrumph anyway it's one of the grain items
02:11 MTecknology you could pretty easily write a custom grain for py version
02:11 hrumph pythonversion[0]
02:12 hrumph on a related not when will py3 be default?
02:12 hrumph note
02:12 MTecknology depends on your distro
02:24 zerocoolback joined #salt
02:25 zerocool_ joined #salt
03:03 evle joined #salt
03:13 shakalaka joined #salt
05:42 shakalaka joined #salt
06:12 zer0def joined #salt
06:17 shakalaka joined #salt
06:30 shakalaka joined #salt
06:41 tyx joined #salt
07:24 shakalaka joined #salt
07:31 sjorge joined #salt
07:31 pcgod joined #salt
07:42 shakalaka joined #salt
07:47 sauvin joined #salt
08:10 babilen XenophonF: I'd keep all under a single "satosa" key and have satosa:{proxy,internal_attributes,…}
08:21 babilen (you can always work with a shiftwidth of 2
08:23 Bozo_the_Clown_1 joined #salt
08:29 andrew3 joined #salt
08:29 coredumb1 joined #salt
08:32 Bico_Fino joined #salt
08:33 coredumb joined #salt
09:22 rollniak joined #salt
09:39 zerocoolback joined #salt
10:06 ensbro joined #salt
11:04 pf_moore joined #salt
11:14 zerocoolback joined #salt
11:29 atmoz joined #salt
11:30 zerocoolback joined #salt
11:37 atmoz Get "Permission denied" when applying cmd.script state. I have two almost identical states, but it's just the one that fails. I don't know how to approach this?
11:38 atmoz All I get is: "/bin/sh: /home/atmoz/__salt.tmp.ucT_af.sh: Permission denied"
11:51 obitech joined #salt
11:56 zer0def joined #salt
11:57 zer0def joined #salt
12:38 atmoz Salt creates this file with root ownership, and then tries to run it as my normal user (runas:atmoz)
12:39 atmoz Can't see any option to change this
12:39 atmoz Smells like a bug to me
12:40 gmoro joined #salt
12:52 obitech joined #salt
12:54 atmoz setting umask: 002 does not help either
12:55 hrumph joined #salt
13:09 xet7 joined #salt
13:38 exarkun joined #salt
14:46 sjorge joined #salt
15:05 sjorge joined #salt
15:41 Bozo_the_Clown joined #salt
15:44 mianosm is there something more illustrative than this (https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.selinux.html) that shows how to change the context of a tcp/udp port?
15:50 tiwula joined #salt
15:57 MTecknology atmoz: I'd suspect it's a problem with your states
16:34 Hybrid joined #salt
16:47 atmoz MTecknology: how so?
16:47 atmoz Here is the state: https://github.com/atmoz/workstation-formula/blob/master/workstation/system.sls#L26
16:58 Hybrid joined #salt
17:13 Tyrant joined #salt
17:15 MTecknology that's quite the massive formula for such a narrow use case..
17:15 justan0theruser joined #salt
17:22 MTecknology atmoz: pbin the output from 'mount'
17:32 atmoz Not sure what you mean by "massive"? Here it is: https://gist.github.com/atmoz/47f58908dbc30dcd191f13f34d7cebfd
17:33 atmoz MTecknology: it's the best way for me to learn Salt, as I also wanted to automate my latop setup. Two for the price of one :-)
17:35 MTecknology you have one formula doing a hundred things and it's all dependant on your extremely specific use case
17:36 MTecknology I suspect this wouldn't scale to more than 1-5 users without a lot of ugly-making.
17:39 MTecknology heck, it wouldn't even scale out to the same user using it on a desktop instead of a laptop
17:42 atmoz Well, it's for my own use, so I see no problem. I will refactor it when I need to use it on more than one computer
17:42 MTecknology rrriiight....
17:43 atmoz The first prototype is always ugly
17:44 atmoz I did not ask for your opinion anyways
17:45 MTecknology enjoy figuring out your mess! :)
17:47 atmoz Ah, I see. So you don't know. Why did you not say so instead of acting mean?
17:48 atmoz You are trashing the channel with bs instead of being constructive
17:48 zer0def your behavior right now isn't constructive either, so you might want to stick to figuring out the issues you have
17:50 atmoz I am using this formula on my laptop right now, and do not have the same issue. I have a VM for testing my setup, and there is where the problem occurs. Not sure where to look.
18:08 kuL4 joined #salt
18:16 kuL4 hi guys, any idea what can cause issues with augeas like given in here https://paste.debian.net/1018029 ?
18:18 zer0def you don't have a dependency of the `augeas` state module installed
18:19 zer0def install python bindings to augeas on the minion, restart it and try again
18:20 kuL4 zer0def: do you mean libpython2.7?
18:21 zer0def i mean whatever system package that has `python` or `python2` and `augeas` in it's name
18:21 wryfi joined #salt
18:21 kuL4 ah so you mean python-augeas well I have those that's why I'm confused
18:22 zer0def on the master or minion?
18:22 zer0def have you restarted/reloaded modules since installing that package?
18:22 kuL4 I'm running over salt-ssh and this is installed on both
18:23 kuL4 but I may need py3 let me check this
18:23 zer0def definitely not py3
18:23 zer0def open up a python interpreter and try running the `from augeas import Augeas` instruction
18:24 zer0def (be sure it's the same interpreter salt uses, which for the most typical case is python2)
18:25 kuL4 I can import module with no issues, but will try to force specific python installation
18:28 wryfi joined #salt
18:29 zer0def well, thing here is that `augeas` state depends on `augeas.execute` execution module function to be available, which in turn is available when the forementioned import succeeds on the minion
18:30 zer0def ref https://github.com/saltstack/salt/blob/develop/salt/states/augeas.py#L49 and https://github.com/saltstack/salt/blob/develop/salt/modules/augeas_cfg.py#L37
18:31 zer0def meaning that running `augeas.get` would confirm that it's properly imported
18:32 kuL4 haa got it, 1. on debian salt-ssh is using py3 2nd I didn't install python3-augeas on target which was causing issues
18:32 MTecknology py3 is the default for salt on ubuntu 18.04
18:32 kuL4 thx zer0def :-)
18:33 zer0def oh, that's curious
18:33 kuL4 yeah it surprized me as well
18:33 zer0def good to know
18:34 atmoz Oh, I found out my failing gpg state was causing my other cmd.script to fail :-) Commenting out that part of the code solves the problem.
18:35 atmoz Have anyone else seen this error message: https://gist.github.com/atmoz/7ce312905b200125df955e05d2dc8c87
18:39 atmoz I guess it's a bug in salt.states.gpg, so I will have to manage without for now
18:42 mechleg atmoz: KeyError normally means a reference to a dictionary key that does not exist.  the traceback does not seem to like __salt__['gpg.list_keys']()
18:49 atmoz mechleg: tried using a shorter id, same result. Strange.
18:53 MTecknology It's starting to feel like we might finally drop py2 in the next 1-5 decades!! :D
18:54 zer0def well, if it runs on py3 on new-ish debians, probably faster
18:54 zer0def unless you mean the entirety of py2, in which case i'm not optimistic
18:56 MTecknology isn't py2 supposed to be officially retired in the next 2 years?
18:57 zer0def you member how that looked like the last time py2 was supposed to be retired?
18:57 MTecknology ya... :(
18:58 zer0def benefit now is that py3 actually as things going for it in stdlib, for which you have to install backports for py2
18:58 mechleg atmoz:  what would a shorter ID have to do with your issue?  does the salt gpg module work on the system you are seeing the error on?
19:02 ThomasJ joined #salt
19:02 atmoz I just guessed that there was some limits on what ID to use, but was wrong
19:03 atmoz Ah, I get a much better error message when trying to run "salt-call gpg.present <id>"
19:03 atmoz 'gpg' virtual returned False: The gpg execution module cannot be loaded; the gnupg python module is not installed.
19:03 atmoz There we go :-)
19:06 atmoz Hmm, installing python-gnupg did not help. What dependency am I missing then?
19:06 babilen Restarted the minion or used "- reload_modules: True" in the state that installed that module?
19:07 ThomasJ joined #salt
19:08 atmoz Aha, 2 sec
19:08 kuL4 left #salt
19:08 atmoz I restarted salt-minion, no change. How do I reload modules?
19:08 babilen That should have taken care of that
19:09 atmoz Where should "- reload_modules: True" go?
19:09 atmoz Ok
19:09 atmoz From the webpages: "This renderer requires the python-gnupg package. Be careful to install the python-gnupg package, not the gnupg package, or you will get errors."
19:09 babilen It would go in the state that you use to install dependencies of execution modules (in order for them to reload)
19:09 atmoz I have both installed
19:10 babilen Can you "import gnupg" in a python REPL on the minion?
19:10 babilen (and which version did you install)
19:10 hrumph joined #salt
19:11 atmoz Yes, python-gnupg-0.4.1-1
19:11 atmoz From archlinux repo, where it say "A Python 3 wrapper for GnuPG"
19:11 babilen Should be at least 1.3.1, AFAICT
19:12 babilen Python 3?
19:12 babilen Ah, yes .. Arch and their "python" madness
19:12 atmoz Hehe
19:12 zer0def salt uses py2 on arch, so install py2 modules
19:12 atmoz So I guess salt uses python 2?
19:12 atmoz ok
19:13 atmoz Will try that, thanks
19:13 babilen https://github.com/saltstack/salt/blob/develop/salt/modules/gpg.py#L91-L101
19:14 zer0def or rather, salt's arch maintainer packages it for py2
19:14 zer0def arch's salt maintainer? i dunno.
19:14 atmoz It works now :-)
19:15 babilen Great
19:15 atmoz So salt works fine with python 3 only?
19:15 zer0def with both, favoring py2
19:16 zer0def it's just safer to package for py2, since that's what it was originally written in and has most stable behavior
19:17 babilen py3 support is pretty recent
19:20 ThomasJ joined #salt
19:26 ThomasJ|d joined #salt
19:29 atmoz Oh no ... salt does add the public key for the  user, but .gnupg/ is now infested by files owned by root, so the user can not use gpg
19:30 atmoz Maybe I have to make another bash script ...
19:31 atmoz or add cmd.run with chown right after
19:33 MTecknology you must have found another salt bug
19:34 atmoz There he is
19:36 zer0def do a `file.recurse` on the dir without providing a source, should get your permissions sorted
19:39 atmoz That may be cleaner, thanks
19:40 zer0def since you're learning the tool, always ask the question of "is there a module that could handle $case?" before falling back to comfort zones like scripting
19:41 atmoz I agree :-)
19:41 zer0def odds are there is, sometimes you just have to get a bit creative about it
19:44 atmoz I have done this in bash, because it's only supposed to run once. Wonder how complicated it would have been if I tried to implement it with salt states ... https://github.com/atmoz/workstation-formula/blob/master/workstation/files/dotfiles-init.sh
19:45 zer0def `git latest`?
19:46 atmoz I know about it, but I need to check gpg signatures, could not find a way with git state
19:47 zer0def couldn't infer this from script, but sounds like just another state that needs to be ran afterward
19:47 atmoz I'll take it as a challenge, and convert it one day :-)
19:49 atmoz Personally I do not see a problem with one-off scripts running during a bootstrap
19:49 atmoz (For my usage, anyway)
19:49 atmoz But I see your point
19:49 zer0def the goal of states is to achieve a state, which means that if your state operates imperatively, you're setting yourself up for a bad time
19:51 zer0def so as long as your "one-off scripts running during a bootstrap" are declarative enough, there's probably no harm
19:51 zer0def by "harm" i mean "unintended self-harm caused by lack of knowledge"
19:53 atmoz Absolutely
20:00 atmoz zer0def: "Missing parameter source for state file.recurse" – looks like source must be set after all
20:01 hrumph everyon should switch to py3 as much as possible just because if you don't do it now you'll be forced to do it later
20:01 zer0def oh yeah, i might've mistook `recurse` for `directory`
20:02 atmoz Gotcha
20:02 zer0def yeah, i *actually* meant `file.directory`'s `recurse` kwargs, that's where the confusion came from
20:07 atmoz Looks very tidy :-) https://github.com/atmoz/workstation-formula/commit/76cc33659a4d215692448f04879f4308d21d711d
20:07 zer0def sure, the directory is owned, but the files aren't
20:08 zer0def s/owned/properly owned/
20:08 zer0def refer to the point about `recurse` kwarg
20:09 atmoz Argh, I forgot :-P
20:09 atmoz I was looking at the docs, and wondered what the default value was
20:10 atmoz There I have my answer
20:13 atmoz Once I got my workstation configured with salt, my server is next on the list :-)
21:57 rollniak_ joined #salt
22:38 eekrano joined #salt
23:05 Trauma joined #salt
23:08 justan0theruser joined #salt
23:21 exarkun joined #salt
23:23 mavhq joined #salt
23:23 justanotheruser joined #salt
23:33 rollniak joined #salt

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