Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2018-02-13

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

All times shown according to UTC.

Time Nick Message
00:01 Guest73 joined #salt
00:10 Guest73 joined #salt
00:12 pipps joined #salt
00:16 pipps99 joined #salt
00:18 Guest73 joined #salt
00:24 Guest73 joined #salt
00:25 pipps joined #salt
00:28 Guest73 joined #salt
00:35 exarkun joined #salt
00:53 pipps joined #salt
00:56 mTeK joined #salt
01:00 pipps joined #salt
01:05 pipps joined #salt
01:15 shiranaihito joined #salt
01:20 GothAck joined #salt
01:22 ekkelett joined #salt
01:24 zerocoolback joined #salt
01:37 justanotheruser joined #salt
01:54 tiwula joined #salt
02:21 pipps joined #salt
02:39 MTecknology "If you use it, know how it works." ~ wolf
02:39 MTecknology I like!
02:55 gnomethrower joined #salt
02:56 ilbot3 joined #salt
02:56 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:57 evle joined #salt
03:28 zerocoolback joined #salt
03:39 cyborg-one left #salt
03:49 zerocoolback joined #salt
04:03 kuke joined #salt
04:04 Guest73 joined #salt
04:07 kukaracha joined #salt
04:52 Guest73 joined #salt
04:57 lkthomas MTecknology, I only put salt on fries, does it count ?
04:58 MTecknology https://media3.giphy.com/media/EouEzI5bBR8uk/giphy.gif
04:58 lkthomas LOL
05:28 Guest73 joined #salt
05:37 exarkun joined #salt
05:41 Guest73 joined #salt
05:47 Guest73 joined #salt
05:55 Hybrid joined #salt
06:14 Hybrid joined #salt
06:19 pualj joined #salt
06:20 snakegums joined #salt
06:26 zulutango joined #salt
06:27 LocaMocha joined #salt
06:38 armyriad joined #salt
06:42 LocaMocha joined #salt
06:46 lompik joined #salt
06:53 pualj joined #salt
06:56 ramteid joined #salt
06:57 LocaMocha joined #salt
07:09 Mattch joined #salt
07:12 pualj_ joined #salt
07:19 LocaMocha joined #salt
07:21 LocaMocha joined #salt
07:24 pualj_ joined #salt
07:35 Guest73 joined #salt
07:43 Tucky joined #salt
07:47 pualj_ joined #salt
07:50 hoonetorg joined #salt
08:01 Ricardo1000 joined #salt
08:09 aldevar joined #salt
08:17 stooj Is anyone able to point to where I am going wrong using lxc with salt-cloud? I'm using the saltstack formula; here's the relevant pillar excerpt, the command and the output. https://dpaste.de/fYG6 I don't understand why I need an image, a profile *and* a template when they are mututally exclusive afaik, and I *think* I've provided a template and a profile to use
08:21 Hybrid joined #salt
08:31 Guest73 joined #salt
08:34 drl joined #salt
08:40 onovy joined #salt
08:42 wongster80 joined #salt
08:57 pbandark joined #salt
09:01 lkthomas folks, I am using pkg.installed but everytime it will redownload file from sources, how could I make it check if system is installed that package before download ?
09:09 pualj_ joined #salt
09:15 pualj_ joined #salt
09:39 BHauser joined #salt
09:40 viq joined #salt
09:43 tys101010 joined #salt
09:44 goesepouse joined #salt
09:45 goesepouse left #salt
09:47 BHauser joined #salt
09:49 BHauser Hi all, i'm having a problem where a pkg.install state(b) gets executed under pkg.install state(a). I reproduced the problem as follows: https://pastebin.com/8RDSyxhA.
09:52 colegatron joined #salt
09:53 babilen https://pastebin.com/raw/8RDSyxhA (for less eye cancer)
09:55 babilen BHauser: What is the problem exactly?
09:56 babilen Would I be correct in assuming that your issue is that the pkg.install states are aggregated?
09:58 BHauser babilen: that is correct. So i assume i am overlooking a "state_aggregate" in my configuration?
09:58 babilen https://docs.saltstack.com/en/latest/ref/states/aggregate.html might be of interest to you
09:58 schasi joined #salt
09:59 BHauser Thanks! i'll give it a read
10:00 schasi I wanna make a pull request for a new salt-cloud provider (oVirt). Anything I need to do before that? Any special guidelines to follow?
10:03 BHauser babilen: Thanks, i had the state_aggregate configured on the salt-master and I was searching in the minion configuration..... D'oh!
10:12 babilen yay :)
10:16 AstraLuma joined #salt
10:19 Hybrid joined #salt
10:23 aarontc joined #salt
10:27 babilen schasi: There are contribution guidelines in the documentation
10:28 colegatron left #salt
10:29 schasi Looking into it right now :)
10:32 hillna joined #salt
10:32 hillna joined #salt
10:32 hillna joined #salt
10:33 hillna joined #salt
10:34 hillna joined #salt
10:34 hillna joined #salt
10:35 hillna joined #salt
10:36 hillna joined #salt
10:36 hillna joined #salt
10:37 exarkun joined #salt
10:37 hillna joined #salt
10:38 czchen joined #salt
10:38 hillna joined #salt
10:39 mattfoxxx joined #salt
10:44 hillna joined #salt
10:49 hillna joined #salt
10:53 mattfoxxx joined #salt
10:54 Naresh joined #salt
10:55 hillna joined #salt
10:56 sayyid9000 joined #salt
10:59 hillna joined #salt
11:01 inad922 joined #salt
11:02 daxroc joined #salt
11:05 hillna joined #salt
11:07 Naresh joined #salt
11:07 aleph- joined #salt
11:11 phtes joined #salt
11:19 Hybrid joined #salt
11:26 FuzzyVeg joined #salt
11:27 FuzzyVeg left #salt
11:31 miruoy joined #salt
11:39 preludedrew joined #salt
11:42 zerocool_ joined #salt
12:05 lompik joined #salt
12:14 Gareth joined #salt
12:14 oida joined #salt
12:16 exarkun joined #salt
12:30 14WAAEUX9 joined #salt
12:50 aldevar left #salt
13:27 Nahual joined #salt
13:39 ebbex Can I possibly make this work? (installing multiple lists of packages) https://github.com/eb4x/saltstack/blob/master/salt/packages/init.sls
13:49 oida joined #salt
13:50 XenophonF ebbex: that doesn't work like you think
13:51 XenophonF for starters, it outputs pretty-printed python lists, not valid yaml
13:51 XenophonF and second you're specifying lists of lists there, not a list
13:51 XenophonF so what you want to do is combine the two lists
13:51 XenophonF and then serialize them as YAML
13:52 XenophonF `{{ (pillar['editors'] + pillar['browsers'])|yaml }}
13:52 XenophonF drop the leading `-` too
13:54 XenophonF also, I think it's bad style to indent a list inside a dict inside a list like that only two spaces
13:54 XenophonF it parses correctly, but I think you should go ahead an indent the extra two spaces, to emphasize the list lives under the `pkgs` key
13:55 XenophonF anyway, here's what it should end up as: https://gist.github.com/xenophonf/56c9c372f7cf2403fe53de01cbc65dfe
13:57 exarkun joined #salt
13:57 cwright joined #salt
14:05 DammitJim joined #salt
14:07 s0undt3ch joined #salt
14:10 ebbex XenophonF: Yeah, I actually figured out something similar, putting everything in a big fat {{ }} and concatenating the lists with "+".
14:11 ebbex XenophonF: what do you mean in regards to indentation of a "list in dict in list"?
14:13 ebbex XenophonF: nm, missed your gist link. Thanks :)
14:14 aldevar joined #salt
14:18 oida joined #salt
14:19 ebbex XenophonF: one small change though, seems to me "- pkgs: {{" must be on the same line.
14:19 alkyl joined #salt
14:21 ebbex and what's the point of the "| yaml" filter?
14:23 racooper joined #salt
14:25 gareth__ joined #salt
14:40 XenophonF it doesn't need to be on the same line because by default the |yaml filter won't emit newlines
14:40 XenophonF cf. https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html#salt.utils.jinja.SerializerExtension
14:40 XenophonF you need to use |yaml_encode or |yaml to emit properly formatted and quoted data
14:41 XenophonF just about every formula you find online plays fast and loose with this
14:41 XenophonF and occasionally you run into bugs where the pretty-printed version of something results in a YAML parser error
14:45 Kelsar joined #salt
14:56 cgiroua joined #salt
15:07 tiwula joined #salt
15:12 edrocks joined #salt
15:23 buumi Continuing my journey into salt, this time trying masterless configuration is giving me some issues. I have very simple state + pillar config which works over salt-ssh. When I'm trying to call the same thing with salt-call I get error "salt-pillar object has no attribute ..". Also salt-call pillar.items does not return anything. On my /etc/salt/minion I have setup file_roots, pillar_roots and file_client:
15:23 buumi local. Maybe I missing something obvious there that also needs to be done?
15:26 jeffspeff I'm working on a module for managing MS office licenses. I'm not a very experienced python programmer. Can someone take a look at the "get_key" function and tell me if there is a better way of doing it? https://gist.github.com/jeffclay/0f16f7d76292963b7d8229ce53c37614   I'm concerned that each if statement will cause the minion to relist its pkgs which will add to the run time for that part of the code.
15:29 cyborg-one joined #salt
15:30 edrocks joined #salt
15:31 cyborg-one left #salt
15:31 aldevar joined #salt
15:33 kiorky joined #salt
15:36 exarkun joined #salt
15:40 coredumb is there an easy way to put into variable some state parameters to reuse them in other states
15:40 coredumb in the same state file that is
15:41 coredumb like user, group, mode of file.managed that would be the same over the course of 20 of almost identical file.managed states
15:42 jeffspeff coredumb, and example from one of my states {% set version = salt['pkg.version']('PROGRAM_A') %}
15:42 jeffspeff is that what you're looking for?
15:49 _JZ_ joined #salt
15:51 raptelan I'm making a saltstate which installs a package on Ubuntu.  It appears that when that installation happens, the service is started, which I don't want to happen.  So for the moment I am stopping the service immediately after installation, doing some more steps, then restarting it.  Is there a way to avoid the service starting and thus having to stop it?
15:52 coredumb jeffspeff: nope, more like not having to put again and again - user, - group, -mode, parameters
15:53 coredumb like file.managed: {{ default_config }}
15:53 coredumb was wondering if creating a jinja list would make it
15:54 raptelan_ joined #salt
15:55 coredumb I'd usually use a jinja loop, but in this case it's not really practical
15:56 raptelan brb
15:56 raptelan joined #salt
16:04 dfinn joined #salt
16:06 raptelan joined #salt
16:07 tiwula joined #salt
16:09 raptelan How can I keep `apt-get install some_package` from starting the service associated with that package?
16:10 gtmanfred raptelan: ubuntu is bad
16:10 gtmanfred dpkg starts the services
16:10 gtmanfred https://major.io/2016/05/05/preventing-ubuntu-16-04-starting-daemons-package-installed/
16:11 raptelan oops, I meant to write that in #ubuntu
16:11 onslack joined #salt
16:11 raptelan thank you though - I'll give that link a read
16:12 dfinn joined #salt
16:13 XenophonF anyone else encountering yum transaction errors when upgrading to 2017.7.3 on RHEL/CentOS?
16:13 raptelan gtmanfred: so, `systemctl mask ...` won't work until it is installed?  So I can use salt to create a symlink instead, then service enable afterwards?  Or is enable something different from unmask?
16:14 onslack <gtmanfred> you will have to remove the symlink to devnull before you can enable it
16:19 coredumb jeffspeff: think what I'm looking for is a macro
16:20 onslack <gtmanfred> msmith slack bridge was dead for some reason
16:20 onslack <mts-salt> @gtmanfred is the bridge working? i'm sure i said that but i don't know if it got to irc
16:20 onslack <gtmanfred> it is working now
16:20 onslack <mts-salt> heh. same thought
16:20 onslack <mts-salt> thanks :)
16:21 onslack <gtmanfred> one day I will write my own slack bridge, with hooks and asyncio
16:21 onslack <gtmanfred> hookers*
16:21 onslack Action: mts-salt gets the popcorn
16:21 onslack <florian.benscheidt> lol
16:35 aldevar left #salt
16:44 lordcirth_work gtmanfred, do you think this argument structure is good? https://github.com/saltstack/salt/issues/28165#issuecomment-365326369
16:45 onslack <gtmanfred> you are going to need to indent line and multiline_* once more or they will not be inside of hide_comments
16:46 onslack <gtmanfred> but yeah that seems fine to me
16:47 lordcirth_work gtmanfred, thanks!
17:02 lordcirth_work It's really easy to run out of 80 characters in python
17:03 raptelan joined #salt
17:04 onslack <gtmanfred> salt is 120 characters
17:04 onslack <gtmanfred> https://github.com/saltstack/salt/blob/2017.7/.testing.pylintrc#L261
17:04 lordcirth_work Ooh, it was function calls that was 80 https://docs.saltstack.com/en/latest/topics/development/conventions/style.html#coding-style
17:05 lordcirth_work :set cc=120 yaty
17:05 lordcirth_work yay* that's much easier
17:08 onslack <gtmanfred> yeah
17:14 wryfi joined #salt
17:17 exarkun joined #salt
17:19 pipps joined #salt
17:21 raptelan ugh, can't get anything to work for not starting the ubuntu service on package install.
17:21 raptelan tried cmd.run with systemctl mask, tried file.symlink to do essentially the same thing.  tried environ.setenv for RUNLEVEL = 1....
17:22 raptelan no matter what the service always ends up running anyways
17:22 onslack <gtmanfred> what did you setup a symlink to?
17:22 raptelan from /etc/systemd/system/blah.service to /dev/null
17:22 pipps joined #salt
17:22 onslack <gtmanfred> you should just be able to do ln -s /dev/null /etc/systemd/system/whatever.service
17:22 onslack <gtmanfred> yeah, then i would go yell at the dpkg/debian/ubuntu people
17:22 onslack <gtmanfred> because the whole thing is terrible
17:22 raptelan it works fine when I use systemctl mask <service> and then apt-get install manually.
17:23 onslack <gtmanfred> are you on ubuntu 14.04 or 16.04?
17:23 raptelan but from a saltscript it seems to have no effect
17:23 onslack <gtmanfred> ok
17:23 raptelan 16.04
17:23 onslack <gtmanfred> what is a salt script?
17:23 onslack <gtmanfred> a salt state?
17:23 raptelan also the ln -s manually does NOT work, though systemctl mask/unmask that does the same thing does.
17:23 raptelan yes a saltstate
17:24 raptelan I just want to install the postgresql package, do some setup work, then start the service later on.
17:24 onslack <mts-salt> do you need to reload systemd after making the symlink?
17:24 raptelan perhaps, but why wouldn't cmd.run on systemctl mask postgresql work?  It says it works
17:24 onslack <gtmanfred> possibly if the service doesn’t exist ¯\_(ツ)_/¯
17:24 onslack <mts-salt> if the package isn't installed
17:25 raptelan when I do that from the saltstate I see "Created symlink from /etc/systemd/system/postgresql.service to /dev/null."
17:25 onslack <gtmanfred> but doing the symlink manually works for me, and from this gist you can see systemd marks it as masked https://gist.github.com/gtmanfred/1507fe87d535a6df0a313f79fd42b899
17:25 onslack <gtmanfred> File uploaded https://saltstackcommunity.slack.com/files/U7KH2HJ0K/F99G4QLJK/gistfile1.txt / undefined
17:25 raptelan when I do it manually, it doesn't make any difference if the service exists yet or not.
17:25 raptelan I can systemctl mask, apt-get install, and then find the service is masked and not running
17:25 raptelan when I do the same from a saltstate, that's not what ends up happening.
17:25 onslack <gtmanfred> there is a service.mask module
17:25 onslack <gtmanfred> have you used that instead of cmd.run?
17:26 raptelan no, but I will.
17:26 onslack <mts-salt> are your states running in the right order?
17:26 raptelan would still like to understand why it's not working as expected.
17:26 raptelan why would the order be different than as it's written?  The output follows the saltstate order.
17:26 pipps joined #salt
17:26 pipps99 joined #salt
17:27 onslack <mts-salt> order can be controlled. if such a control is in place then the order can be changed. for example requisites or grouping
17:28 onslack <mts-salt> it's easy enough to see with a debug log
17:29 raptelan I have a single saltstate file, no includes - shouldn't I expect the functions therein to execute in order?
17:29 onslack <mts-salt> not always, no. but they should unless something is influencing that order
17:29 viq raptelan: 'require' or 'watch' statements can change that
17:30 pipps99 joined #salt
17:30 raptelan system.masked seems to work
17:30 onslack <mts-salt> this is why it's worth checking, if only to eliminate as a culprit
17:30 raptelan viq: don't have any of those.
17:30 raptelan how would I check?
17:30 raptelan I'm pretty new to sal
17:31 raptelan *salt
17:31 raptelan I meant service.masked seems to work.
17:32 babilen Just out of curiosity: Which problems does installing postgres cause that requires you to disable the service from running?
17:32 onslack <mts-salt> to check ordering and other messages during troubleshooting, look at the debug log displayed by running your state directly on the minion. for example: salt-call state.sls whatever.whatever
17:32 onslack <mts-salt> from a security point of view, default usernames and passwords :)
17:33 viq oh yeah, the debian's insistence on "well, you installed the package, OF COURSE you want to immediately start the service"
17:34 Guest73 joined #salt
17:34 onslack <mts-salt> from that link above, you can turn that off globally if you want to
17:36 babilen viq: Which isn't such a weird assumption
17:37 raptelan service.unmaskd works but service.running with unmask: true fails.
17:39 raptelan babilen: there's no point in it starting without our cluster (initdb) done yet
17:39 babilen Does that cause problems?
17:39 raptelan babilen: actually yes it is.  "install" doesn't imply "start/use"
17:40 raptelan it's logically broken
17:40 babilen Debian's logic is: Ship a sensible default configuration that doesn't cause problems. If people want to disable a service, they can do so after the installation.
17:41 babilen Hence the question of "Does it cause problems?"
17:41 raptelan Yes, it does.
17:41 babilen So, those problems should be tackled
17:41 raptelan I don't want the service to come up on the network with the default configuration
17:41 raptelan arguing about Debian/Ubuntu's choice here is pretty pointless though.
17:42 babilen Haven't checked postgres, but it shouldn't come up with an insecure configuration on install. At best it would listen to local connections.
17:43 babilen Either way, I figured it might help to tackle the actual problem
17:43 raptelan I'm trying to get salt figured out.  So back to my last issue - service.unmaskd works but service.running with unmask: true fails, which doesn't seem to agree with the documentation at https://docs.saltstack.com/en/latest/ref/states/all/salt.states.service.html#salt.states.service.running
17:43 babilen I shall be quiet now
17:44 onslack <mts-salt> you are running 2017.7.0 or newer, right? :)
17:44 raptelan call it a perfectionist mindset if you want, but why incur delay starting and then stopping a service that could simply not be started?  Logically, I don't want to wonder every time I review the saltstate why it is that a service restart happens where logic demands a start should happen.
17:46 jeffspeff i'm seeing something weird. I think salt itself is doing something weird with a string in my module. here's the code and excerpt from log file https://gist.github.com/jeffclay/0f16f7d76292963b7d8229ce53c37614    when i run msolicense.vbs_path it returns the expected value "cscript c:\program files (x86)\Microsoft Office\Office16\ospp.vbs" if you look in the log you can see that command is also making it there as well, but when salt tries to run it, salt
17:46 jeffspeff throws the error "  Input Error: There is no file extension in "c:\program".  "
17:46 onslack <mts-salt> interestingly it may be considered a `runtime` mask rather than an `indefinite` mask. does `service.running` behave if you pass `unmask_runtime: true' instead?
17:47 onslack <mts-salt> jeffspeff: perhaps you need to add double quotes around the argument
17:47 Edgan raptelan: I agree with you. Unnecessary processes also eat memory and cpu. These small things are a matter of scale. At the scale of 10 systems they are nothing. At the scale of 10,000 systems 1% problems become way bigger.
17:48 onslack <gtmanfred> jeffspeff are you on 2017.7.3? you may need to apply https://github.com/saltstack/salt/pull/45716 ?
17:48 onslack <gtmanfred> nm looks like you are using cmd.run not cmd.script
17:49 jeffspeff yeah, i am using 2017.7.3 though
17:49 Edgan raptelan: I have been dotting my Is and crossing my Ts on the current code base. With the goal of getting it down to no errors, no changes for everything. Salt minions no longer hang, and runs are down to 20-30 seconds as they should be.
17:49 onslack <gtmanfred> but not cmd.script, but you might want to look at that
17:50 onslack <mts-salt> edgan: you're not using lgpo under windows then ;)
17:51 onslack <mts-salt> or dism. or probably windows...!
17:51 BitBandit joined #salt
17:51 Edgan mts-salt: I don't touch Windows if I can help it.
17:51 onslack <mts-salt> lucky you :p
17:51 whytewolf be the bad maid. don't do windows! :P
17:52 Edgan mts-salt: lots of cmd.runs?
17:52 onslack <mts-salt> in a software house that's still predominantly m$, choices are limited
17:52 onslack <mts-salt> cmd.run still won't speed up the process if it's slow
17:53 onslack <mts-salt> and dism is _slow_
17:53 Edgan I avoid cmd.run commands as much as I can. It was more of a question if you find yourself using it a lot with Windows.
17:53 Edgan The key when you must is an unless
17:53 onslack <mts-salt> i'll use it if i can't find any other way
17:53 Edgan The one change I have left is a cmd.run that I don't yet know how to write the unless for yet
17:54 onslack <mts-salt> i've got on set of states that manages a file in temp, runs diskpart to change the system, then file.absent on the same file to remove it. all with onchange and unless so it runs clean
17:54 onslack <mts-salt> *one
17:55 onslack <mts-salt> can't do that without cmd.run :)
17:56 Edgan mts-salt: It is more about not being worth it. Technically you could write a custom module/state to replace the cmd.run.
17:57 onslack <mts-salt> i doubt it would be any more efficient or make it easier to understand and maintain
17:58 onslack <mts-salt> plus, it's pretty much a run-once state
18:04 DammitJim joined #salt
18:04 DammitJim to run a system masterless
18:04 DammitJim what do I install on the server? salt-client or salt-server?
18:05 Shirkdog joined #salt
18:06 onslack <gtmanfred> neither of those is a thing
18:06 onslack <gtmanfred> just set `local: true` `file_type: local` or `master_type: disable` in the minion config file
18:07 DammitJim I meant it in the context of apt-get install salt-server vs salt-minion
18:07 DammitJim sorry, not salt-client
18:07 onslack <gtmanfred> salt-server is not a thing
18:07 onslack <gtmanfred> just install the minion, and then set the config option
18:08 DammitJim I had this all wrong... salt-master and salt-minion
18:08 DammitJim what the heck is wrong with me today?
18:08 DammitJim so, I'll install salt-minion
18:08 DammitJim thanks!
18:16 DammitJim what about file_client ?
18:16 DammitJim do I also need to set that?
18:16 onslack <gtmanfred> you can do any one of the three
18:17 DammitJim any of the 4?
18:17 raptelan Is there any thing wrong with this or is the documentation wrong?  Using salt 2017.7.3:  http://dpaste.com/2M077Z8
18:19 onslack <gtmanfred> `local: true` `file_type: local` or `master_type: disable`
18:19 onslack <gtmanfred> there are three
18:20 DammitJim what about file_client: local ?
18:20 onslack <gtmanfred> sorry, i meant file_client
18:20 onslack <gtmanfred> not file_type
18:21 onslack <gtmanfred> raptelan, did you read the docs?
18:21 raptelan gtmanfred: yes
18:21 onslack <gtmanfred> check the ..version added 2017.7.0 note
18:21 onslack <gtmanfred> New in version 2017.7.0: In previous releases, Salt would simply unmask a service before making any changes. This behavior is no longer the default.
18:21 raptelan gtmanfred: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.service.html#salt.states.service.running
18:21 raptelan I'm using 2017.7.3
18:21 onslack <gtmanfred> oh wait, i missread it
18:21 onslack <gtmanfred> it is just not the default now
18:21 onslack <gtmanfred> one second
18:22 onslack <gtmanfred> woops
18:22 raptelan I'm explicitly specifying that it should unmask and it's failing with a masked error
18:22 raptelan If I do a service.unmasked and then a service.running it works but I'd prefer one step instead of two
18:22 onslack <gtmanfred> right i thought that note meant that it unmasked after trying to start the service
18:22 onslack <gtmanfred> my bad
18:23 onslack <gtmanfred> well, it looks like someone broke this, because it catches the unmask variable and never passes it through as far as i see
18:23 onslack <gtmanfred> can you open an issue on github about this?
18:23 raptelan not sure, I'm new to all of this as of yesterday.
18:24 onslack <gtmanfred> https://github.com/saltstack/salt/issues
18:25 jeffspeff gtmanfred, i updated my local copies of cmdmod.py and win_functions.py from the 2017.7 branch and tested again. it did not resolve the issue. I have the same results... if I set the return of the function to return r'"cscript c:\program files (x86)\Microsoft Office\Office16\ospp.vbs"'  then salt tries to add double back slashes when it does cmd.run. to be clear, just running vbs.path returns " "cscript c:\program files (x86)\Microsoft Office\Office16\ospp.vb
18:25 jeffspeff s"  "   and then cmd.run tries to run '"cscript c:\\program files (x86)\\Microsoft Office\\Office16\\ospp.vbs"'
18:27 raptelan gtmanfred: https://github.com/saltstack/salt/issues/46014
18:27 jeffspeff if i set the return of vbs_path to " return r'cscript c:\program files (x86)\Microsoft Office\Office16\ospp.vbs'  " (notice, no double quotes within the single quote) running vbs_path returns cscript c:\program files (x86)\Microsoft Office\Office16\ospp.vbs    but cmd.run errors due to the space between the words "program" and "files"
18:27 onslack <gtmanfred> @raptelan thanks!
18:29 raptelan I guess I'll use the two-step workaround for now.
18:30 wongster80 joined #salt
18:33 raptelan ugh, the workaround is NOT working now.
18:35 DammitJim is running salt-call on a minion (masterless) usually slow? like 7 seconds to check that it's running the latest version for a package and a file.managed?
18:35 onslack <gtmanfred> yes
18:35 DammitJim awesome
18:35 onslack <gtmanfred> it does not communicate with the running salt-minion process
18:35 raptelan eff it all, this is totally not working now, inconsistent with earlier testing. :(
18:35 DammitJim thank you!
18:35 DammitJim now I need to figure out how to put my stuff in git
18:35 onslack <gtmanfred> it starts a whole salt-minion process inside itself, and uses that
18:35 raptelan pkg install is starting the service even after package.masked is used.
18:37 DammitJim do you guys normally have a "development" machine and push to git master?
18:37 DammitJim the git clone/pull on each minion?
18:37 onslack <gtmanfred> gitfs can be used from masterless minions
18:37 MTecknology I need to start using vagrant to test my personal stuff.
18:37 DammitJim oohhhh... gitfs!
18:38 DammitJim hhmmm.... I wonder how I would get that to work...
18:38 onslack <gtmanfred> https://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html
18:40 bowhunte_ joined #salt
18:42 pipps99 joined #salt
18:45 DammitJim does the same configuration for the master apply to the minion when setting up fileserver_backend and all that?
18:45 DammitJim and gitfs_remotes?
18:46 DammitJim I guess I'm confused between fileserver_backend and file_roots
18:48 whytewolf fileserver_backend tells salt which backends to use, file_roots tells the roots backend where it is :P
18:48 DammitJim what if I don't have fileserver_backend defined in my minion config file?
18:49 DammitJim the fileserver is itself?
18:49 whytewolf then it defaults to - roots
18:49 DammitJim oh, it defaults to file_roots?
18:49 whytewolf if you are using --local
18:50 whytewolf yes. it does the same thing for master.
18:50 DammitJim great
18:51 DammitJim I think I'm just going to try it
18:53 whytewolf always a good first step :P
18:53 pipps joined #salt
18:56 lordcirth_work arg my code is throwing: "Passed invalid arguments: string indices must be integers." but it won't say what line!
18:58 exarkun joined #salt
18:59 jeffspeff i'm still having very odd results trying to get a module to a custom module to run a command. i can run it fine using cmd.run but when i do the same thing from a python module with the exact same syntax it adds an extra "c:\" to the command behind the scenes. here's the python code as well as my test and their results https://gist.github.com/jeffclay/5f9a5f09208337f6ed51c2f0329410de  any help is greatly appreciated.
19:04 buumi Hmm, when i spin up ubuntu 16.04 VM or CentOS 7 VM on Vagrant and try to provision it with masterless salt it does not find pillars data even though pillars_root is set on /etc/salt/minion. However, same files work on my VM host machine when run similarly.. Has anyone had similar issue?
19:05 whytewolf buumi: hope you mean pillar_roots and not pillars_root
19:07 buumi Ah, yes
19:07 buumi Full minion conf https://pastebin.com/bFh0F85U
19:10 inad922 joined #salt
19:11 raptelan joined #salt
19:12 whytewolf i see no issue with that. as long as you are having vagrant actually put your states and pillars in place at /srv/salt
19:14 raptelan joined #salt
19:21 buumi Yeah they are and states work outside of VM, of course those folders inside VM are VirtualBox shared folders but i guess that should not cause issues, probably some stupid thing but seems so weird, can't find anything interesting by running -l debug either
19:25 pipps joined #salt
19:32 inad922 joined #salt
19:41 jeffspeff Is there a reason to use the python 2 windows minion instead of the python 3?
19:45 pipps joined #salt
19:50 lordcirth_work So, I've added the hide_comment feature to get_diff, but now difflib is showing mangled diffs like this: https://gist.github.com/lordcirth/0c4e4f47abfb7a12959894e704c23aa9
19:51 onslack <gtmanfred> jeffspeff: they should both work the same, but know oxygen will be much more stable in oxygen, currently 2017.7 does not support an international character set, and has some problems with unicode characters that should all be fixed in oxygen
19:52 jeffspeff oxygen?
19:52 onslack <gtmanfred> the next major salt release
19:52 onslack <gtmanfred> https://docs.saltstack.com/en/latest/topics/releases/version_numbers.html
19:53 jeffspeff got it
19:55 whytewolf honestly seeing everything coming out with oxygen it really is a major release. so many new toys.
19:55 lordcirth_work And one more new feature if I can finish this PR
19:56 pipps joined #salt
19:56 pipps99 joined #salt
19:59 lordcirth_work But difflib is acting very strangely
19:59 edrocks joined #salt
20:04 dnull joined #salt
20:05 onslack <gtmanfred> if you have a new feature, it should go in develop, not oxygen
20:08 DammitJim joined #salt
20:15 inad922 joined #salt
20:17 lordcirth_work Yes it's against develop
20:17 lordcirth_work Is the merge window already closed?
20:22 raptelan joined #salt
20:23 raptelan why can't I use pkg.installed twice within the same saltstate function?
20:24 raptelan I get "Conflicting ID 'pkg.installed'"
20:24 onslack <gtmanfred> yeah, oxygen was forked a couple months ago
20:24 onslack <gtmanfred> i think it got forked in december
20:25 aldevar joined #salt
20:28 raptelan can I add arrays of arguments?
20:29 raptelan I can't do that for pkg.installed, but I could for a bunch of cron.presents if it's possible.
20:31 lordcirth_work raptelan, I personally don't think it's good practice to use multiple state functions under the same name
20:31 raptelan I'm really struggling with understanding how to write a saltstate "properly"
20:32 raptelan I'm also running into "contains multiple state declarations of the same type" due to using file.recurse and file.replace in the same function
20:32 raptelan I don't understand why
20:32 onslack <gtmanfred> yeah, you can only have one reference to a state module per state-id
20:32 jeffspeff are states in a top file ran in the order listed?
20:33 onslack <gtmanfred> assuming you are not using any requisites at all, yes
20:33 raptelan looking at https://docs.saltstack.com/en/latest/topics/tutorials/starting_states.html I see a bunch of various operations all grouped under the apache function - create a user, gcreate a group, install the package, start the service.
20:33 onslack <gtmanfred> require, watch, etc can reorder it
20:33 jeffspeff thanks
20:33 onslack <gtmanfred> raptelan, yeah that is fine.
20:33 onslack <gtmanfred> i do that all the time
20:33 raptelan so I'm trying to emulate that.  I need to create a user, a group, recurse ownership on a home directory, install a couple packages, edit a file installed by one of those packages.
20:34 raptelan and that is clearly wrong, but I'm not clear why
20:34 onslack <gtmanfred> you cannot do that if you are trying to use the file state module twice
20:34 gtmanfred raptelan: states can also be written like this
20:34 jeffspeff also, gtmanfred, i was using salt version 2017.7.2 and not 2017.7.3. I didn't realize that until I started filling out a bug report. After updating the master and minion to 2017.7.3 my weird issues vanished!
20:34 gtmanfred /etc/file/something:
20:34 gtmanfred file:
20:34 gtmanfred - append
20:34 gtmanfred - text: something
20:35 gtmanfred since the key <file> is the staet module to use, you can only use each state module once per state id
20:35 gtmanfred so you are using file.recurse and file.replace in the same state, id,
20:35 gtmanfred whatever:
20:35 gtmanfred file:
20:35 gtmanfred - replace
20:35 gtmanfred file:
20:35 gtmanfred - recurse
20:35 gtmanfred the dictionary can only have one reference to the key
20:35 gtmanfred file*
20:35 gtmanfred and would overwrite the first one with the second one
20:35 raptelan that gives me Conflicting ID 'file'
20:36 gtmanfred yes
20:36 gtmanfred you cannot do that
20:36 raptelan so what is it that I'm supposed to be doing???
20:36 raptelan I'm so confused
20:36 gtmanfred replace /etc/file/something:
20:36 gtmanfred file.replace:
20:36 lordcirth_work raptelan, just split into a different name
20:36 gtmanfred - whatever
20:36 whytewolf create multiple state id's
20:36 gtmanfred recurse /etc/file/something:
20:36 raptelan before I just put a different function name on every single operation, but that seemed dumb
20:36 gtmanfred file.recurse
20:36 lordcirth_work raptelan, that is what I do
20:36 gtmanfred you have to do it for each different reference to the state module, for the reason i explained above
20:37 raptelan what I have at the moment, which doesn't work at all:
20:37 raptelan http://dpaste.com/29D1Z5M
20:37 pipps joined #salt
20:37 pipps99 joined #salt
20:38 exarkun joined #salt
20:38 onslack <gtmanfred> you have a file.absent and a file.directory in the same state-id
20:38 onslack <gtmanfred> you cannot do that
20:38 onslack <gtmanfred> also, your file: replace and recurse is not a thing
20:38 onslack <gtmanfred> you cannot do that
20:38 Hybrid joined #salt
20:38 onslack <gtmanfred> move the recurse or the replace to a new state id
20:38 raptelan ok, so I should NOT try to logically group anything as the documentation example seemed to suggest, but just give everything some random function name.
20:38 onslack <gtmanfred> what i was saying above is you cannot do that
20:39 onslack <gtmanfred> you CAN logically group them.  it is just not possible to group multiple uses of the SAME STATE MODULE in the SAME state-id
20:39 deuscapturus joined #salt
20:39 onslack <gtmanfred> any other grouping you want to do, you can do
20:39 raptelan so this is better?  http://dpaste.com/3JFX5PA
20:39 raptelan I'm not gtmanfred
20:39 lordcirth_work raptelan, that's what I do
20:39 gtmanfred yes you were
20:40 gtmanfred you were using the `file` state module in the same state id
20:40 gtmanfred the absent or directory or recurse or replace is the function
20:40 gtmanfred file is the module
20:40 raptelan I know that, I'm saying my name is not gtmanfred to onslack
20:40 gtmanfred onslack is a bot to bridge slack to here
20:40 gtmanfred both of those are me
20:40 raptelan so nothing should be grouped, because it seems pretty useless to do so as it's very limited when that's possible.
20:41 lordcirth_work I don't bother grouping anything, yeah
20:41 raptelan :( ok
20:41 raptelan back to what I was doing in the first place.
20:41 gtmanfred but you /can/ group them, as long as they don't have the same state module, which is what the tutorial was doing
20:41 raptelan that's a minority of the time
20:41 raptelan and then the grouping won't make sense
20:41 gtmanfred no it isn't
20:42 raptelan I'll group 3 out of 6 things that are possible, then have to break into another group or two.
20:42 gtmanfred https://github.com/saltstack/salt-jenkins/blob/master/python/ldap.sls#L27
20:42 gtmanfred there are plenty of situations where you can group them
20:43 gtmanfred jsut because you cannot group everything under one stateid doesn't mean you can't do it
20:43 raptelan but it would be a foolish habit to get into, since it is not possible so frequently
20:43 raptelan "just because I can't doesn't mean I can't" eh?
20:43 gtmanfred i just gave you an example of a place where it can be used
20:43 whytewolf 90% of setups are pkg.installed a single file.managed and a service.running.
20:43 gtmanfred ^^
20:44 raptelan some random example isn't applicable to anything I want to do though.
20:44 gtmanfred then don't do it
20:46 raptelan any explanation for this?  http://dpaste.com/1412SNN
20:46 whytewolf personally I don't group multiple states together as I use the files as a grouping system not the state id's and I like having descriptive names of what a state is meant to do. which gets confusing with multiple states
20:47 raptelan it looks like service.dead doesn't work
20:47 DammitJim since I'm running masterless, what should my top.sls salt file be?
20:47 DammitJim just '*':
20:47 DammitJim right?
20:47 whytewolf DammitJim: same as if it wasn't masterless
20:47 onslack <gtmanfred> depends on if this is the only minion that is going to use that top.sls
20:47 raptelan whytewolf: that's fine, I can always break this up into smaller files and include them all in the parent one
20:47 DammitJim oh, that's true
20:48 raptelan first I want to get it to _work_ :/
20:51 whytewolf why are you deading then running it? do you really want to restart the service everytime you run the states?
20:52 raptelan the state is to install pg, installation of the package on ubuntu automatically runs it's service before I have it configured
20:52 whytewolf ye
20:52 whytewolf ah.
20:52 whytewolf but that doesn't answer the question
20:52 raptelan I've spent almost all day trying to figure out some way to get the package to install without starting the service automatically.
20:53 raptelan I'm new to salt and really confused by it.
20:53 raptelan all ears for what I should be doing
20:53 raptelan I'm not grasping that from the docs
20:53 whytewolf a better way would be to drop the service.dead and put a watch on your configuration and forget about the fact ubuntu starts it
20:54 JasonB joined #salt
20:54 raptelan I'm taking over a saltstate that somebody else wrote which doesn't do much more but cmd.run on a bash script that does the same things
20:54 whytewolf yikes.... I feel sorry for you if it was left in that state
20:55 raptelan the bash script was very long and convoluted too. :P
20:55 raptelan I think the saltstate yaml will be significantly shorter whenever it's working
20:55 raptelan but I'm really not understanding how to write a "state" and concerns like stopping and starting the service
20:56 MTecknology service.running: + -watch:
20:56 whytewolf don't think of it as stopping and starting. think of it as restarting and starting if it isn't already started
20:56 MTecknology (typically covers most cases)
20:57 raptelan I don't see "watch" here:  https://docs.saltstack.com/en/latest/ref/states/all/salt.states.service.html#salt.states.service.running
20:57 raptelan oh wait, there's a note at the bottom
20:57 whytewolf https://docs.saltstack.com/en/latest/ref/states/requisites.html#watch
20:57 whytewolf watch is a global
20:58 whytewolf it triggers the mod_watch function which is listed as service.mod_watch
20:58 deuscapturus joined #salt
20:59 raptelan is there an example?
20:59 raptelan I was trying to start with something fairly basic
20:59 whytewolf https://docs.saltstack.com/en/latest/ref/states/requisites.html#prereq
20:59 whytewolf just before that anrhor
20:59 whytewolf anchor
20:59 whytewolf frag it
21:00 raptelan I don't get watch...
21:00 raptelan or I guess requisites in general
21:01 raptelan I thought require just meant "do something else first"
21:01 whytewolf watch will watch another state. if that state returns as changed it will run alternate code called mod_watch
21:01 whytewolf require actually means do something before me or don't do it if it errors
21:01 Guest73 joined #salt
21:02 raptelan reading the whole section, I have _no idea_ what to try.
21:02 lordcirth_work In the case of service.running, watch will restart the service
21:02 raptelan how?  why?
21:02 raptelan how can you tell?
21:02 lordcirth_work You add watch: file: config_file or whatever to service.running
21:02 Hybrid joined #salt
21:03 raptelan what file?
21:03 ymasson joined #salt
21:03 lordcirth_work When the state 'config_file' reports that it has changed something, service.running will restart
21:03 lordcirth_work Whatever state you want to trigger the change
21:03 raptelan I don't know what that means
21:03 lordcirth_work The ntpd example there is pretty clear I think
21:04 raptelan if it's simple to you, I'd love to hear an explanation
21:04 raptelan when the saltstate runs, it checks if that file has changed, and restarts the service if it has?
21:04 raptelan but that's not related to the case I'm trying to figure out
21:05 raptelan http://dpaste.com/3JFX5PA is a partial list of the operations I'm trying to get done, in order
21:05 whytewolf it doesn't check if the file has changed it checks if the state that could change the file returns that it had a change
21:06 lordcirth_work ^
21:06 lordcirth_work Very important distinction
21:06 raptelan ...which would only happen if the file had been changed?
21:06 whytewolf it could also be if pkg.installed installed a file
21:07 lordcirth_work raptelan, so, postgres_home_directory depends on the user and group existing, right?
21:07 whytewolf - watch: pkg:postgresql_package
21:07 raptelan lordcirth_work: yes.
21:07 Guest73 joined #salt
21:07 lordcirth_work So, you want to add a 'require' to postgres_home_directory
21:07 raptelan lordcirth_work: ok, I understand that much.
21:08 lordcirth_work - require: \n - user: postgres_user \n - group: postgres_group
21:08 raptelan erm
21:08 lordcirth_work Note that 'user' here is 'user' because that's the state
21:08 raptelan how do I identify the "postgres_group" function as a "group" for that?
21:09 raptelan I could put group.present and user.present in the same function in theory
21:09 whytewolf raptelan: because the state module is group
21:09 raptelan so then it would have both state modules
21:09 raptelan how would I identify that?
21:10 aldevar left #salt
21:10 whytewolf - require:\n    - user: postgres_group\n  - group: postgres_group
21:10 raptelan why is it require user: postgres_user instead of require user: postgres, since that's the name of the user I created and the "postgres_user" is just a unique name for the function since postgres_group can't have the same one?
21:10 pipps joined #salt
21:10 whytewolf he was using the state id
21:11 whytewolf it is - <module>: <state id OR name>
21:11 pipps99 joined #salt
21:11 raptelan is there such a thing as a less intuitive system than this?!?  ffs.
21:11 whytewolf yes
21:11 whytewolf this is all easy
21:11 raptelan well then I hate to see the hard parts
21:11 raptelan I really don't get this
21:12 raptelan I think I should just clean up the bash script - if <package not installed>; do <all these steps>; done.
21:13 raptelan or a series of such conditionals
21:13 Guest73 joined #salt
21:14 spiette joined #salt
21:15 raptelan I added to postgres_home_directory - require:\n- user: postgres\n- group: postgres.  Now it does the same thing as it already did.
21:16 raptelan I didn't have problems adding these to start with.
21:17 raptelan if it sounds like I'm just being argumentative, I promise I'm not.
21:17 raptelan I really need help figuring this out, it makes me want to stick my head in a blender... :(
21:18 whytewolf well, you are being argumentative. but that comes with frustration.
21:18 raptelan I'm not arguing, I'm failing to understand.  There's a difference.
21:19 raptelan I'm _trying_.
21:19 whytewolf https://gist.github.com/whytewolf/d6c16cc14915186f098fa491130adbd2
21:19 edrocks joined #salt
21:20 raptelan I'm adding a require pkgrepo to _common_package and a require pkg: postgresql-common to disable_automatic_createcluster...
21:20 raptelan then a require: disable_automatic_createcluster to postgresql_package?
21:20 whytewolf those are good steps
21:20 raptelan I'm just making each thing dependent on the last?
21:20 raptelan I thought that the things in the saltstate script were executed in order
21:21 raptelan by default
21:21 whytewolf yes. although it could keep things from breaking massivly if one item fails
21:21 whytewolf which is the benifit of require is something fails anything that required it won't run
21:21 lordcirth_work raptelan, that is an implementation detail, not a spec.  Don't assume it will run in order.  Also yes, you want to stop if one fails
21:23 raptelan require file: /etc/postgresql-common/createcluster.conf   <-- how does this indicate that it requires the file.replace operation I specified rather than the file existing at all?
21:23 raptelan I could put the ID I guess - require file: disable_automatic_createcluster - but that doesn't seem clear either.
21:23 raptelan what am I missing?
21:23 whytewolf because requisites only operate based on states
21:23 whytewolf not anything outside of salt
21:24 raptelan I get that, but how do I make it clearly readable?
21:24 whytewolf I personally use state id's
21:24 raptelan because I don't view a sed operation on a file as "file: <filename that happened to be edited>"
21:24 whytewolf another reason i like them descriptive
21:24 raptelan that would be require file: disable_automatic_createcluster
21:24 whytewolf yeap
21:24 raptelan which is the name of the sed operation, not the file
21:25 raptelan guess I should make the ID the filename??
21:25 whytewolf why, does that make more sense to you?
21:25 raptelan neither of what would work make sense to me
21:26 raptelan I'm wondering if state function names should indicate what is being operated on rather than a description of what's happening within them
21:26 pipps joined #salt
21:27 lordcirth_work Why not both?
21:27 lordcirth_work apache_conf_enable_foo
21:27 raptelan I could really stand to see some sort of state that's not just a super simple example with names or whatever actually works and makes sense to read.
21:28 raptelan I suppose createcluster_edit sounds better than disable_automatic_createcluster
21:28 raptelan then I can say require the edit to be done first
21:28 raptelan which sounds reasonable
21:29 pipps99 joined #salt
21:29 whytewolf raptelan: https://github.com/whytewolf/salt-phase0-states/blob/master/sys/install/mysql.sls
21:29 whytewolf like that kind of example?
21:29 raptelan lookingn...
21:30 lordcirth_work https://gist.github.com/lordcirth/41f242b7578e2c61f8cc14a6fc83011b
21:30 raptelan so the way you have it - if something has either require: pkgs: misql-community-server or require: service: mysqld, either one will require the whole mysql_server_install state?
21:31 lordcirth_work Pretty common pattern: service requires config, config reqs pkgs, pkgs req ppa
21:31 whytewolf raptelan: yeap.
21:31 raptelan I am thinking that the file.replace that I have separate should be a part of postgresql_common_package in mine, as it's part of the same operatin?
21:31 lordcirth_work One would require mysql_server_install, not mysql-community-server
21:32 lordcirth_work mysql-community-server is a package name
21:32 raptelan oh, there's no name for the pkg
21:32 raptelan just pkgs which is alternative to it I guess
21:32 whytewolf oh good catch missed that, been awhile since i actually looked at this code lol
21:32 raptelan :/
21:32 whytewolf pkgs, takes a list of pkgs
21:33 whytewolf it is an option for pkg.installed or pkg.latest
21:33 raptelan so there's no purpose in a name: since you are giving multiple pkg names?
21:33 raptelan but that multiple names, called 'pkgs' can't be referred to by require?
21:34 raptelan so you would specify one of the names of the packages in a name: argument just for referencability by name?
21:34 lordcirth_work you can say - name: apache2 , but to do multiple, pkgs:
21:34 raptelan or specify some random "name" like mysql_packages
21:35 lordcirth_work You don't need to specify - name: in pkg.installed if you supply - pkgs
21:35 whytewolf I never target in requiesites by name so never thought about it. but yes lordcirth_work is right. you can put a - name in the pkg.installed if you want to target on it
21:35 raptelan unfortunately "name" usually has to be an actual package name or file name or whatever it seems, not just something friendly
21:35 pipps joined #salt
21:36 lordcirth_work I only ever use pkgs, for consistency
21:36 raptelan like in file.replace, name has to indicate the full path filename, right?
21:36 whytewolf yes.
21:36 raptelan I can't use a friendly name and then specify the path separatly
21:36 lordcirth_work raptelan, all paths must be absolute
21:36 lordcirth_work The 'friendly name' is the state id at the top
21:36 whytewolf if you want a friendly name target on the state id
21:36 whytewolf jinx
21:37 raptelan but then how do I do dependencies within a single id?
21:37 whytewolf that is what the module item in front is for
21:37 raptelan like if I want pg_common_package: pkg.installed: name postgresql-common... file.replace: name: /blah/blah/blah ...
21:38 raptelan the file replace should depend on the pkg installation right?
21:39 raptelan of course then if I wanted to require that pg_common_package I'm not sure whether I would use require: pkg: pg_common_package or require: file: pg_common_package
21:39 whytewolf https://gist.github.com/whytewolf/5b7cba282ba29004f1f854f3e9f439e8
21:39 upb joined #salt
21:39 raptelan so I guess combining things doesn't make sense at all
21:41 whytewolf raptelan: with require you CAN leave off the module and it will require ALL of the items in that state id to compleate
21:41 raptelan ok, so just require: - <id>\n - <id2>?
21:41 whytewolf yes
21:41 raptelan much better, thank you
21:42 pipps joined #salt
21:42 raptelan though I should ask first if there's any reason NOT to do that
21:42 lordcirth_work The reason I usually specify pkg: is both for clarity and because older Salt versions needed it
21:42 whytewolf ^
21:42 lordcirth_work But I think that's well past now
21:42 whytewolf yeah that was 2015.5 I think that was added
21:43 whytewolf the other reason i use the module is that not all of the requiesites currently work that way. esp with the _in versions
21:44 lordcirth_work I didn't know that
21:45 pipps99 joined #salt
21:45 whytewolf prereq_in really doesn't like it
21:45 whytewolf although that should be fixed soon i hope
21:48 raptelan I think there's still a problem here.
21:49 raptelan the watch: postgresql_package in postgresql_service isn't going to do anything, since postgresql_package automatically runs the service prior to configuration being done
21:49 whytewolf raptelan: watch runs a different command. with service it restarts the service
21:50 raptelan so it'll always restart?
21:50 raptelan every time the state runs?
21:50 whytewolf no, thats the point it will restart if any of the states being watched change.
21:50 whytewolf pkg.installed installing the package is counted as a change
21:51 raptelan trying a run
21:52 pipps joined #salt
21:52 pipps99 joined #salt
21:52 raptelan "maybe it works" :)
21:52 whytewolf lol
21:52 raptelan Let me paste the current SLS if you guys could sanity check it
21:52 raptelan I still have more additions, but this looks like it's working better
21:53 whytewolf good to hear :)
21:54 raptelan https://gist.github.com/caseyallenshobe/c46f116416833c08f778e0b49912a9ac
21:56 whytewolf hum, I don't know if watch is moduless friendly. but if it is everything else looks good
21:56 pipps_ joined #salt
21:58 pipps99 joined #salt
22:00 whytewolf raptelan: I hate trying to sell stuff. but one thing you might consider talking your boss into some classes https://saltstack.com/training/ salt has a lot of neat features that can be a pain for the people that know it well. let alone those just starting out.
22:00 pipps__ joined #salt
22:02 Guest73 joined #salt
22:04 pipps99 joined #salt
22:05 raptelan whytewolf: I plan on it, though I'm going to try to figure out a fair bit on my own first
22:06 raptelan oof, pricey :P
22:06 whytewolf kewlies just thought i would meantion it.
22:06 whytewolf lol. yeah. but worth it.
22:06 raptelan but I'll see if I can get it arranged.  I work really close by.
22:07 buumi On a related note, salt documentation is obvious choice for learning but is there some other good material you would suggest? (another salt newbie here)
22:07 raptelan whytewolf: the training location is a 13 minute drive from my work :P
22:08 raptelan I'm going to chug through the documentation as well, but am feeling a lot better with something working in hand now first
22:08 whytewolf buumi: there are some books that i havn't read so i don't know if they are good. but there is also saltconf that is heald every year as well
22:09 whytewolf raptelan: thats kewl. if I actually was in the office instead of remote worker bee. i would say lets grab a beer some time.
22:13 raptelan ah, the training is remote too I guess
22:13 whytewolf it can be yes
22:14 whytewolf I took it in the office but it is offered online
22:14 raptelan video conference is listed under technical requirements, it doesn't mention anything about in-person
22:15 whytewolf I'm pretty sure they do in person also. At least when i took it they mentioned people comeing in
22:15 pipps joined #salt
22:18 exarkun joined #salt
22:18 Demerol joined #salt
22:21 whytewolf i love when i have to explain to companies that I'm using their high end enterprise opensource software that they want me to buy support for. That I use it at home for kicks and giggles.
22:22 raptelan I have a remove script, where I remove cron jobs as well as remove the user account - how can I use require or watch there appropriately?  what happens now is that it works if installed, but if not the cron job remove steps fail since the user doesn't exist.
22:22 raptelan annoyingly, the user's crontab isn't removed when the user is.
22:24 whytewolf humm, don't think watch would be needed. but i would have the user remove require all of the crons be removed
22:24 whytewolf what are you using for the cron emoval?
22:24 whytewolf removal
22:25 onslack joined #salt
22:25 raptelan cron.absent
22:27 Valfor joined #salt
22:27 Valfor joined #salt
22:27 raptelan those fail if the user doesn't exist
22:27 _JZ_ joined #salt
22:29 raptelan so after an install, the remove works
22:29 raptelan but a subsequent execution of remove fails with errors about the cron jobs failing to remove since the user doesn't exist, and the user failing to remove because the crons can't be removed
22:29 raptelan I'll paste the sls
22:30 raptelan whytewolf: https://gist.github.com/caseyallenshobe/dfb216b9a2b2b3afecaca09eae63fc72
22:30 whytewolf yeah. this might require something else. entirelly. I'm thinking either an onchanges or unless onlyif
22:30 eightyeight joined #salt
22:31 whytewolf so, wait. you install with your other sls. then remove with this sls in a highstate?
22:31 raptelan I guess I could do a file.absent on the crontab but I'm not sure that will take effect on the running cron or not
22:32 raptelan not fluent in ubuntu, different crons work differently.
22:32 raptelan whytewolf: I don't really know yet
22:32 raptelan I thought there should be one state to install, and another to remove
22:32 raptelan that puts it back as it was
22:33 raptelan can I just unapply the former?
22:33 whytewolf no you were right with one to remove. but why are you running it more then once?
22:34 whytewolf anyway this is were you are going to need to get into jinja in states.
22:35 whytewolf which you already have at the start
22:36 raptelan I thought all states should be able to apply repeatedly without error
22:36 raptelan if it's already removed it should basically just run through and confirm that and end up doing nothing
22:36 raptelan that may be a false assumption
22:36 whytewolf that is the end goal yes.
22:36 whytewolf but not always possable.
22:36 whytewolf such as trying to remove crons on a user that doesn't exist
22:39 whytewolf personally I would put in a jinja check that just didn't put the cron.absent states in if the user doens't exist
22:39 whytewolf this is where the _in comes in handy because you can't require a state that isn't there
22:40 whytewolf so instead of remove_postgres_user requireing the cron.absent states. the cron.absent stats would require_in the remove_postgres_user
22:41 whytewolf it amounts to the same thing. however that allows the cron.absent states to be left out of the final run with out hurting anything
22:51 pipps joined #salt
23:05 q1x joined #salt
23:05 pipps99 joined #salt
23:11 poningru joined #salt
23:11 oida joined #salt
23:12 poningru hello anyone know why the saltstack debian repos might be giving us ssl errors?
23:12 poningru curl https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/dists/trusty/main/binary-i386/Packages
23:12 poningru curl: (35) Unknown SSL protocol error in connection to repo.saltstack.com:443
23:12 poningru very intermittent
23:13 poningru so only happening like once every two three hours
23:18 pipps joined #salt
23:22 lru joined #salt
23:23 pipps99 joined #salt
23:24 bowhunter joined #salt
23:26 Guest73 joined #salt
23:27 izibi joined #salt
23:34 Edgan poningru: Is your clock perfectly in sync?
23:34 poningru yeah we have an cdma based ntp server
23:34 poningru s/an/a
23:35 poningru yeah first thing I looked at too
23:35 Edgan poningru: what time does your clock say?
23:35 poningru anyway it doesnt matter, we are now mirroring it locally and pointing all our servers to the local mirror
23:36 poningru Tue Feb 13 15:35:01 PST 2018
23:36 Edgan poningru: I used a reverse proxy method with Artifactory to avoid issues like that
23:36 Edgan poningru: Seems like you are about a minute or so off
23:36 poningru hehe that was from a minute ago
23:36 Edgan haha
23:36 poningru Tue Feb 13 15:36:50 PST 2018
23:37 poningru that's what we have now
23:37 xMopx same here poningru
23:37 * poningru shrugs
23:37 poningru we rolled out our fix already
23:37 poningru let me know if I should file a bug or something against saltstack sysops
23:38 poningru not sure if that is publically available?
23:38 Edgan I would file an issue to be sure
23:38 xMopx Is it expected to be working now?
23:38 poningru xMopx, wait are you seeing the ssl error too?
23:38 xMopx poningru: yeah
23:39 poningru oh interesting
23:39 xMopx intermittently
23:39 xMopx clock is synced
23:40 Edgan I would say it is a load balancer and one of the backend systems is screwy, but I would expect the SSL to terminate at the LB. Though technically they could be passing it through to each backend host via TCP LBing
23:41 MTecknology which would be a rather silly idea..
23:42 Edgan MTecknology: I have seen it done with ELBs when you want to do client ssl certificate auth. I don't see why they would want to do that in this case.
23:43 dthorman joined #salt
23:43 Edgan MTecknology: Though they could be reusing the LB for other things
23:44 dthorman Anyone else notiice that repos.saltstack.com has been acting up?
23:44 XenophonF yes
23:44 XenophonF I have the botched yum upgrade transactions to prove it
23:44 XenophonF somehow both salt-2017.7.2 and salt-2017.7.3 are installed simultaneously
23:46 MTecknology whytewolf: ^ ping?
23:46 MTecknology gtmanfred: ^ ping?
23:49 dthorman joined #salt
23:53 [dee] joined #salt
23:58 Guest73 joined #salt
23:59 poningru soo what is the correct place to file this ticket?
23:59 pipps joined #salt
23:59 [dee] I'm having issues bootstrapping repo.saltstack.com, it hangs and returns "Err https://repo.saltstack.com trusty/main amd64 Packages server certificate verification failed. CAfile:
23:59 [dee] "
23:59 poningru Edgan, sorry to bother you, but trying to figure out where to file this ticket

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