Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-02-25

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

All times shown according to UTC.

Time Nick Message
00:02 viccuad_ joined #salt
00:14 Pulp joined #salt
00:15 mpanetta joined #salt
00:25 whiteinge_ ekristen: do this: https://github.com/saltstack/salt/blob/e28350ee5636e/salt/modules/git.py#L29-L37
00:31 nZac joined #salt
00:38 yetanotherzero joined #salt
00:44 anotherzero joined #salt
00:46 nineteen joined #salt
00:47 netcho joined #salt
00:48 gk_-1wm_- joined #salt
00:48 gk_-1wm_- left #salt
00:51 brd ekristen: Just use - require
00:57 jas02 joined #salt
01:03 ninjada joined #salt
01:16 viccuad_ joined #salt
01:19 scsinutz joined #salt
01:22 aphor MacPorts salt port has been upgraded to 2016.11.2 and includes salt-minion, salt-master, salt-syndic, salt-api subports to install launchd daemon startupitems
01:25 abednarik joined #salt
01:55 mntnman joined #salt
01:57 nZac joined #salt
01:57 leonkatz joined #salt
02:04 jas02 joined #salt
02:05 edrocks joined #salt
02:07 joshbenner What are the metadata directories I see in formulas, and where can I find the corresponding documentation?
02:12 gk_-1wm joined #salt
02:12 scsinutz joined #salt
02:19 hemebond metadata directories?
02:20 joshbenner Such as: https://github.com/salt-formulas/salt-formula-docker/tree/master/metadata/service
02:20 hemebond I've never seen that before.
02:20 joshbenner Googling is suggesting they are reclass metadata files.
02:21 hemebond Oh reClass.
02:21 joshbenner Is reclass a specific ENC?
02:21 hemebond Kinda.
02:22 joshbenner Will those files under metadata directory have any effect if I'm using a simple salt setup?
02:22 hemebond I mean, those files are not actually inside the formula.
02:22 hemebond No, they're outside the docker directory.
02:22 hemebond salt-formula-docker/docker/ is what Salt actually sees.
02:22 joshbenner So my next question would be: if I want to use, for instance, this docker formula... it's not installing a repo, which is required... so will this formula even work?
02:23 hemebond A repo for the Docker program files?
02:23 joshbenner Package repo to install docker-engine, yeah.
02:24 hemebond I see docker_packages state.
02:24 hemebond In host.sls
02:24 joshbenner That just does package install, though, right? It doesn't add a package repository.
02:24 nZac joined #salt
02:24 hemebond Oh, sorry, yes.
02:25 hemebond Does it need a repo?
02:25 joshbenner Yes
02:25 joshbenner That's what led me to those metadata files... because *they* seem to add a repo
02:25 hemebond I guess it assumes the OS has the packages.
02:25 hemebond Are you using Ubuntu Trusty?
02:26 joshbenner Yes. And/or Xenial.
02:26 joshbenner Mostly, I just want to understand how these things are meant to work.
02:26 hemebond Well, I'd just write my own states to add a repo.
02:26 joshbenner I'm trying to prototype a salt workflow, and these supposedly reusable states seem incomplete or broken.
02:26 hemebond Formulas are very different depending on the software they're managing.
02:26 hemebond And some formulas are more robust and flexible than others
02:27 aphor here here!
02:28 hemebond Oh, metadata might be for SPM.
02:28 hemebond Salt Package Manager.
02:28 joshbenner SPM metadata is a different format
02:29 hemebond Oh, then I've no idea how it works.
02:29 hemebond I've never seen it before and I have about two-dozen formulas from salt-formulas.
02:30 joshbenner Every formula I've clicked so far has the metadata directory. All from tcpcloud, it seems.
02:30 joshbenner Their guidelines are where I found about the relationship to reclass.
02:30 hemebond Ah okay.
02:30 hemebond Well reClass is, as far as I know, just about Pillar data.
02:32 hemebond I'm still trying to find where in the formula it adds a repo.
02:34 joshbenner Right?
02:34 joshbenner It was the first formula I looked at and I've spun into confusion immediately.
02:35 hemebond It's almost like they have another formula for adding repos based on Pillar data.
02:36 joshbenner If so, that really obscures what's going on.
02:36 hemebond Well, on most OS's there's no repo required.
02:37 hemebond But most formulas are coded to let you add your own.
02:37 hemebond It is a terribly confusing formula.
02:37 joshbenner ... if you want to run a years' old version of Docker, sure.
02:37 joshbenner But then I don't need a formula to install that.
02:38 joshbenner That's a simple pkg.installed
02:38 hemebond I looks like I've avoided using a formula for Docker; must have made my own.
02:38 Nahual joined #salt
02:38 hemebond I hate Docker so much.
02:38 hemebond Even its formulas annoy me :-D
02:38 joshbenner Heh
02:39 joshbenner I think you're the first I've met that hates docker ;)
02:39 aphor meet number two.
02:39 Nahual And three.
02:39 joshbenner I'm fascinated.
02:40 Nahual There are dozens of us, dozens!
02:40 aphor Docker hates packaging software, so they invented a new shitty way to package software.
02:41 gk-------1__w__m joined #salt
02:41 gk-------1__w__m left #salt
02:41 aphor All the people I've met who are really pro Docker are all trying to use it as résumé sparkle so they can upgrade their job title somewhere else.
02:42 hemebond Ah, the metadata is used by tcpcloud/docker-salt to create Docker image.
02:42 hemebond *images.
02:46 hemebond So it's not part of the formula at all, it's for their build system.
02:46 hemebond (that's what it looks like to me, at least)
02:46 joshbenner We use docker as a super consistent build format target for our product teams. As long as they deliver a docker image and config to load into it at runtime, our platform deploys it.
02:46 joshbenner It's easy for them to output, and it's easy for us to automate deployment. And we can swap out OS underneath it, benefit from all the orchestration tools on top, etc.
02:46 hemebond If you don't have to do the debugging or managing or monitoring I'm sure that'd be fine.
02:46 hemebond Unfortunately those are my tasks, and our systems/processes aren't built around Docker.
02:46 aphor Yeah. If it's borked, you have to go through the whole dev cycle and make another one.
02:46 hemebond The Docker images are little black-boxes to me.
02:48 ilbot3 joined #salt
02:48 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.3.5, 2016.11.2 <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ (please don't multiline paste into channel) <+> See also: #salt-devel, #salt-offtopic <+> Ask with patience as we are volunteers and may not have immediate answers
02:48 hemebond Even watched a lot of conference talks and stuff.
02:49 hemebond I remember one great Docker conference talk by someone who'd been doing virtualisation for a decade before Docker came along. Through the entire talk I couldn't help but think "Haha, he hates Docker. His previous solution sounds so much better."
02:49 * hemebond takes a deep breath
02:49 joshbenner ;)
03:11 jagguli- hi, i want to create a directory as root and then change the permissions to user, can I achieve this using file.directory
03:11 hemebond jagguli-: Yes
03:12 jas02 joined #salt
03:12 jagguli- in one state declaration ?
03:12 hemebond Yes.
03:12 hemebond https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.directory
03:12 jagguli- cool let me give it a shot ...
03:12 hemebond The function accepts user and group parameters.
03:13 jagguli- yep
03:13 ninjada_ joined #salt
03:13 jagguli- i thought it will try to create a dir as the user specified
03:13 hemebond Salt does everything as root by default.
03:13 jagguli- yep
03:15 jagguli- cool it worked ... thx
03:16 WesleyTech_ joined #salt
03:23 leonkatz joined #salt
03:23 dxiri joined #salt
03:25 CeBe_ joined #salt
03:28 bocaneri joined #salt
03:32 bocaneri joined #salt
03:44 dxiri joined #salt
03:52 rabelais joined #salt
03:54 scsinutz joined #salt
03:56 rabelais left #salt
03:56 leonkatz joined #salt
04:01 ivanjaros joined #salt
04:07 edrocks joined #salt
04:13 jas02 joined #salt
04:14 stooj joined #salt
04:23 scsinutz joined #salt
04:28 scsinutz joined #salt
04:28 scsinutz left #salt
04:30 dxiri joined #salt
04:31 jagguli- so im looking at the documentation for salt engines ...
04:31 jagguli- Salt engines must be in the Salt path, or you can add the engines_dirs option in your Salt master configuration with a list of directories under which Salt attempts to find Salt engines.
04:31 jagguli- whats salt path
04:31 hemebond The Salt python module.
04:31 hemebond I guess.
04:32 hemebond Or maybe states/_engines
04:32 jagguli- ah I tried that srv/_engines
04:32 hemebond The default is /srv/salt/
04:32 hemebond So it'd be /srv/salt/_engines/
04:33 hemebond Where is _engines mentioned?
04:34 jagguli- got it
04:34 jagguli- I set engines_dirs to a list
04:49 preludedrew joined #salt
05:10 leonkatz1 joined #salt
05:10 armin_ joined #salt
05:11 onlyaneg1 joined #salt
05:11 writteno1 joined #salt
05:11 rawzone^ joined #salt
05:11 lasseknudsen2 joined #salt
05:11 nafg_ joined #salt
05:12 pmcg_ joined #salt
05:13 jgelens_ joined #salt
05:13 CabbageMan69 joined #salt
05:14 eseyman_ joined #salt
05:14 iggy_ joined #salt
05:14 roock_ joined #salt
05:14 scamande1 joined #salt
05:14 tawm04_ joined #salt
05:14 tru_tru_ joined #salt
05:14 stewgone joined #salt
05:14 alex80_ joined #salt
05:14 bd__ joined #salt
05:14 nihe joined #salt
05:14 bergei_ joined #salt
05:14 babilen_ joined #salt
05:14 Xenophon1 joined #salt
05:14 wangofet1 joined #salt
05:14 uncool_ joined #salt
05:14 Kruge_ joined #salt
05:15 bfritz_ joined #salt
05:15 stickmac1 joined #salt
05:15 rofl____ joined #salt
05:15 mariusv_ joined #salt
05:16 rome_390_ joined #salt
05:16 nafg_ joined #salt
05:16 nledez joined #salt
05:16 nledez joined #salt
05:16 robawt1 joined #salt
05:16 pcn_ joined #salt
05:16 whytewolf joined #salt
05:16 awpti joined #salt
05:16 ashmckenzie joined #salt
05:16 UForgotten joined #salt
05:17 whiteinge joined #salt
05:17 ropes joined #salt
05:17 frygor joined #salt
05:17 mritchie joined #salt
05:17 ksa joined #salt
05:17 devster31 joined #salt
05:17 jgarr joined #salt
05:17 TOoSmOotH joined #salt
05:17 mk-fg joined #salt
05:17 mk-fg joined #salt
05:17 chadhs joined #salt
05:17 oida joined #salt
05:17 whyzgeek joined #salt
05:17 euidzero joined #salt
05:18 nikogonzo joined #salt
05:18 bbradley joined #salt
05:18 Derailed joined #salt
05:18 flughafen joined #salt
05:18 marcinkuzminski joined #salt
05:18 cebreidian joined #salt
05:18 ahammond joined #salt
05:18 eightyeight joined #salt
05:18 Valfor joined #salt
05:19 Valfor joined #salt
05:19 andi- joined #salt
05:19 justanotheruser joined #salt
05:19 klippo joined #salt
05:20 alias joined #salt
05:20 norrit joined #salt
05:21 duckfez joined #salt
05:21 valkyr2e joined #salt
05:22 SteamWells joined #salt
05:23 ToeSnacks joined #salt
05:23 Awesomecase joined #salt
05:31 tom29739 joined #salt
05:38 jas02 joined #salt
05:41 ksa_ joined #salt
05:41 nikogonzo69 joined #salt
05:42 ashmckenzie_ joined #salt
05:42 nledez joined #salt
05:42 nledez joined #salt
05:43 scoates joined #salt
05:43 awpti joined #salt
05:44 tom29739 joined #salt
05:50 scsinutz joined #salt
06:33 zer0def joined #salt
06:38 jas02 joined #salt
06:48 netcho joined #salt
06:57 jas02 joined #salt
07:04 evle1 joined #salt
07:08 evidence joined #salt
07:09 fgimian joined #salt
07:09 edrocks joined #salt
07:13 ivanjaros joined #salt
07:18 twork_ joined #salt
07:19 viccuad joined #salt
07:20 cyteen joined #salt
07:35 alexlist joined #salt
07:37 Inveracity joined #salt
07:50 jas02 joined #salt
07:53 aldevar joined #salt
07:57 DanyC joined #salt
08:50 jas02 joined #salt
09:05 viccuad joined #salt
09:10 tercenya joined #salt
09:12 edrocks joined #salt
09:22 tercenya joined #salt
09:50 fracklen joined #salt
09:51 onlyanegg joined #salt
09:52 jas02 joined #salt
09:56 candyman88 joined #salt
10:17 sen_ joined #salt
10:23 onlyanegg joined #salt
10:32 gmoro joined #salt
10:49 mikecmpbll joined #salt
11:07 tercenya joined #salt
11:08 jas02 joined #salt
11:14 leev_ joined #salt
11:17 klippo joined #salt
11:18 tercenya_ joined #salt
11:31 Kristjan12345 joined #salt
11:31 Kristjan12345 left #salt
11:56 izrail joined #salt
12:13 afics joined #salt
12:37 sh123124213 joined #salt
12:39 LondonAppDev joined #salt
12:41 gmoro joined #salt
12:47 jas02 joined #salt
12:51 k_sze[work] joined #salt
12:58 XenophonF joined #salt
13:00 k_sze[work] joined #salt
13:03 Jimlad joined #salt
13:28 jas02 joined #salt
13:32 jagguli joined #salt
13:41 viccuad is there anything for extracting foo.gz files? (not foo.tar.gz files)
13:47 lkannan joined #salt
13:47 ninjada joined #salt
13:49 sh123124213 joined #salt
13:50 jagguli- left #salt
13:54 Tanta joined #salt
13:58 nkuttler viccuad: does the archive module not
13:58 nkuttler just handle that?
13:59 viccuad no, it handles tar.gz, but it doesn't seem to handle gz only?
13:59 nkuttler that's crazy...
14:00 nkuttler if you can reproduce that on the latest release i guess i'd file a bug
14:00 nkuttler https://github.com/saltstack/salt/issues/23588
14:00 saltstackbot [#23588][OPEN] states.archive doesn't support gzip, whereas modules.archive does | Found this: https://github.com/saltstack/salt/blob/develop/salt/states/archive.py#L209...
14:02 nkuttler so you can call the execution module..
14:02 viccuad at the end I did cmd.run, yep
14:02 viccuad didn't realize about the modules.archive one
14:02 nkuttler the bug report has an example to do it in a state
14:03 jagguli joined #salt
14:05 Straphka joined #salt
14:11 jagguli- joined #salt
14:13 blueyed left #salt
14:14 jagguli- joined #salt
14:15 edrocks joined #salt
14:16 viq joined #salt
14:17 aldevar left #salt
14:23 scoates joined #salt
14:29 jas02 joined #salt
14:31 joshbenner joined #salt
14:32 hlub gz is not actually arcive format but compression
14:33 ivanjaros joined #salt
14:36 joshbenner Learning salt today -- a little confused about the distinction between execution modules and state modules. Could someone clarify a little for me?
14:38 netcho joined #salt
14:45 gmoro joined #salt
14:47 hlub joshbenner: states are a higher level layer on top of the functionality / logic implemented in the execution modules.
14:50 joshbenner When I write a .sls state -- are the things going in there execution modules or states?
14:51 hlub you are using states
14:52 joshbenner Where would I make use of execution modules?
14:52 hlub if you are implementing new states, then you use execution modules.
14:53 g3cko joined #salt
14:53 joshbenner Are the .sls files I write not states themselves?
14:53 hlub they are not states
14:55 joshbenner What are they?
14:55 hlub sls is just a set of states you write into it and those states can be easily applied / executed
14:57 hlub it is a method for grouping states
14:57 hlub the function in execution modules can also be usefyl when calling them from command line or through salt API
14:58 hlub functions*
14:58 joshbenner Hmm, I think the walkthrough is calling these groups of states formulas.
14:59 hlub but the states are mainly the way to use salt -- with states you are supposed to represent the state in which you want your machines to be, all installations and configurations.
15:00 joshbenner From what I gather, I'd compose or reuse formulas, which are a series of states, and associate formulas with my hosts.
15:02 hlub the term formula is used to represent a group of states yes, usually it consists of multiple state files and other files.
15:03 hlub and yes, states are reused.they are configured with pillar data by using some template renderer such as jinja.
15:03 joshbenner The terminology doesn't lend itself to quick groking. Especially when SLS files are described by docs as "the state in which a system should be in"
15:03 joshbenner The word state, which is pretty central, gets a little overloaded.
15:04 joshbenner Docs also occasionally refer to SLS files (which seem to be formulas) as "state files"
15:06 sjorge joined #salt
15:06 sjorge joined #salt
15:08 joshbenner The part that threw me off was when the walkthrough talked about includes, and stated, "The include statement allows for states to be cross linked" -- it sounds like it allows *formulas* to be cross linked. I read that and was suddenly confused in my understanding of the terms.
15:17 joshbenner Okay, confused again: formulas are defined as "pre-written Salt States" -- but in fact, they are things that consist of states, they are not states themselves... right?
15:25 DanyC joined #salt
15:26 WesleyTech_ joined #salt
15:29 brousch__ joined #salt
15:36 Nahual joined #salt
15:37 syst0m joined #salt
15:38 Neighbour joshbenner: indeed
15:38 joshbenner Is there confusion in the community about how to use some of these terms?
15:40 syst0m using this formula: https://github.com/bechtoldt/saltstack-prometheus-formula.git for provisioning prometheus, I can't achieve convergence. fails prettyr early:
15:40 syst0m https://gist.github.com/syst0m/b349ac747134cec3c8be243ac75db7e3
15:41 syst0m have 'prometheus' defined in both states & pillars top files
15:41 jas02 joined #salt
15:42 syst0m any ideas, guys?
15:42 DanyC joined #salt
15:42 Neighbour joshbenner: maybe, but it also depends on how you interpret it...you could interpret "pre-written" to mean "pre-configured" or "pre-determined"
15:44 joshbenner The interpretation of the adjective doesn't change the base assertion in the walkthrough that "Formula == State". And I'm seeing this confusion crop up here and there throughout docs.
15:44 Neighbour formula == configured state
15:44 Neighbour not a state in itself
15:44 joshbenner From what I gather, formula == collection of configured states
15:45 Neighbour true, a collection of one or more configured states :)
15:45 joshbenner That makes the distinction clearer. I'm tempted to submit doc PRs -- is that the process?
15:45 Neighbour if you want to fix things, be it code or documentation, yes
15:46 Neighbour fix/amend :)
15:46 * joshbenner looks for link to documentation repo
15:46 Neighbour it's all in the main repo iirc
15:46 joshbenner ah, cool
16:02 zirpu joined #salt
16:02 netcho joined #salt
16:03 zirpu left #salt
16:05 Guest32701 joined #salt
16:08 candyman88 joined #salt
16:08 k_sze[work] joined #salt
16:17 edrocks joined #salt
16:33 mikecmpbll joined #salt
16:35 XenophonF whoever wrote salt.states.ldap... I love you
16:39 gableroux joined #salt
16:43 raspado joined #salt
16:53 jas02 joined #salt
16:54 k_sze[work] joined #salt
16:55 joshbenner Is there a way to short-circuit a state based on the return code or output of a shell command?
16:56 joshbenner Or put another way: can I use a shell command to determine whether a state requires any action or not?
17:02 CAPRA-MAU joined #salt
17:04 raspado joined #salt
17:14 scoates joined #salt
17:14 k_sze[work] joined #salt
17:15 CAPRA-MAU left #salt
17:16 XenophonF you might be doing it wrong
17:16 XenophonF if a state doesn't need to make any changes, it won't
17:17 XenophonF that said, cmd.run has an option to parse a shell command's output as state data, which it passes to the salt minion
17:18 XenophonF so a script you write could return some non-empty set of changes, which the state you want to short-circuit can track via the onchanges requisite
17:19 XenophonF if the set of changes returned by the script is nil, the onchanges requisite will prevent the state from running
17:19 XenophonF but like i said, that sounds awfully convoluted
17:20 XenophonF usually the only time i use onchanges or watch requisites is when I need to restart a service or when i want to conditionally run a shell command
17:20 XenophonF above is all IMHO
17:20 XenophonF if you can post an example of what you're trying to do, that'd help us give you more concrete advice
17:22 Gareth pcn_: Hi.  Saw your comment re: the slack engine.
17:22 joshbenner I'm in the process of learning, and the question came up, as it's a strategy I've used with other CM when I had to build software from source. If the command exists and is at proper version, then don't bother downloading/configuring/building/installing.
17:23 joshbenner XenophonF: Is there an idiomatic way to approach that with Salt?
17:24 Gareth joshbenner: sounds like you might want to look at using "onlyif" or "unless" in your states.
17:24 hlub and then there is also unless and onlyif parameters for cmd.run.
17:24 anotherzero joined #salt
17:25 hlub oops, I commented something that were somewhere in the history.
17:25 k_sze[work] joined #salt
17:26 hlub no, it wasn't so far afterall :)
17:26 hlub lol
17:27 theblazehen joined #salt
17:31 hlub joshbenner: I'd like to point out that the documentation can't avoid using the words with different meanings. For instance, saying something like "the state in which a system should be in" definitely does not actually refer to the salt's term 'state'.
17:31 aldevar joined #salt
17:32 joshbenner I think such uses evoke enough context to not be as confusing as when we're using "state" like an almost-proper noun in different ways.
17:32 k_sze[work] joined #salt
17:33 joshbenner And even then, using "state" in its common form should be done carefully in the docs.
17:35 hlub the saltstack itself does not really care much about how you organize your states or call groups of them.
17:36 joshbenner The documentation is prescriptive even if the software is not.
17:37 joshbenner I'm not taking issue with the software. As a new user working to understand the system, I'm providing feedback on the documentation meant to help me learn the software.
17:37 hlub the documentation works if you can easily get into the saltstack world and create your own definitions for the terminology you need to work with it. :)
17:39 joshbenner Shared vocabulary is at the heart of effective education and collaboration.
17:41 hlub yes of course
17:49 rpb joined #salt
17:52 XenophonF joshbenner: do you have a concrete example of what you're trying to do?
17:52 joshbenner XenophonF: Do you mean for the compile stuff above?
17:52 XenophonF I mean for the state-bypassing stuff.
17:53 joshbenner Yeah, that was for compiling. I'm looking over my existing CM stuff, and there was a case where we had a patched version of a library that we had to pull down from our repo and build/install it. The pointers offered about onlyif/unless sounded promising.
17:53 viccuad joined #salt
17:55 XenophonF joshbenner: https://docs.saltstack.com/en/latest/ref/states/requisites.html#onchanges
17:56 XenophonF see also https://github.com/irtnog/spigotmc-formula/blob/master/spigotmc/init.sls
17:56 joshbenner Hmm, instructive. Thanks!
17:59 jas02 joined #salt
18:00 joshbenner Now I'm trying to work out automation for dependency management. We'd probably want to keep formulas in separate repos, but I'm not thrilled about having to manually update gitfs_remotes every time we add a new formula dependency.
18:02 XenophonF what do you mean by "automation for dependency management"?
18:03 joshbenner If one of my dev teams creates a new formula in a new repo, I want to figure out a process whereby it is automatically available to our salt master.
18:06 XenophonF how crazy do you want to go?
18:06 XenophonF in the simplest case, you'd use salt to manage the salt-master's configuration, right?
18:06 joshbenner managing salt-master's config is on the table, yeah.
18:07 XenophonF dude, salt should salt salt
18:07 XenophonF https://github.com/saltstack-formulas/salt-formula
18:07 joshbenner That looks very promising.
18:07 XenophonF https://github.com/irtnog/salt-pillar-example/blob/master/salt/example/com/init.sls
18:08 XenophonF that's basically my production config, cleaned up for public consumption
18:08 XenophonF there are likely better ways to handle it
18:08 joshbenner This caught my attention in that first link: https://github.com/saltstack-formulas/salt-formula#salt-formulas
18:10 XenophonF now if you want to over-engineer something, you could set up a github webhook, salt-api, and a reactor script that detects repository creation events matching some pattern (e.g., *-formula)
18:11 XenophonF but frankly I don't see a reason why your organizations' salt formulas can't be in a few (or one) git repos
18:13 joshbenner Well, if we decide to leverage a 3rd party formula, I wouldn't want to pull that into our repo. So they'd just have to fork it to our git hosting. Also keeps open door for pushing changes back toward upstream.
18:14 XenophonF right
18:14 joshbenner And we have experience keeping things like this all in one repo when there are multiple dev teams all moving quick. It can lead to some challenges.
18:15 joshbenner We'd like the teams to take clear ownership of their own formulas rather than have it all mangled into a centralized repo.
18:15 XenophonF yeah i recommend forking third party formulas if only to have a little control over when changes happen
18:15 hlub I consider cmd.run as a last resort, if there is really no other possible ways to think and implement things.
18:20 jas02 joined #salt
18:22 hlub and the same holds for unless and onlyif, the requisites are more appropriate and readable.
18:22 joshbenner I'm reading about requisites based on some of the links above. I'm a little confused about how to find details about how specific requisites behave. For example, if I have require in a state, and in the require I put 'pkg: foo' -- that "pkg" part references the salt.states.pkg... right?
18:23 hlub yes, the pkg is the name of the state module
18:24 joshbenner Does the salt.states.pkg documentation describe somewhere what it does when something declares a requirement with it?
18:24 hlub the functionality of the requisites is general
18:24 hlub it does not depend on the specific state module you are using.
18:25 hlub if b requires a, then a is executed and before b, further b is executed only if a was successful.
18:26 joshbenner I don't follow. If I require 'pkg: foo' -- 'pkg' module is executed? What part of it?
18:27 hlub the onchanges is very useful. for example, you could extract a tar archive with archive.extracted and then compile the sources within the archive in another state. The compile state could then relate to the archive state with onchanges. Then, the compilation is triggered only when the archive state changes.
18:28 hlub joshbenner: the foo is an ID for another state.
18:30 joshbenner So... is the entire state executed, not just the pkg module part of it?
18:31 joshbenner Because I could use several state module functions within a single state.
18:31 mavhq joined #salt
18:32 hlub yeah, that is probably why the link consists of the state ID and the state module name.
18:33 hlub you could have pkg.installed and service.running within a single state and you can further require the pkg in the service.
18:34 hlub I'd recommend reading some of the formulas to learn some useful tricks
18:34 hlub but keep in mind that some of them are not very well-written.
18:35 joshbenner I don't want to just know that putting pkg: foo makes sure that the package gets installed. I want to know what that actually means, and how I'd understand the behavior of using something other than pkg: in there.
18:35 joshbenner So yeah, looking at examples will help, but it doesn't explain what's going on.
18:35 joshbenner Especially since sometimes they are requiring state IDs, and other times they are requiring names (ie: a file name, etc)
18:36 babilen_ joshbenner: You make a reference to another state (not SLS) that you have defined in the same SLS (or included) and Salt will make sure that that required state is executed before the state that defines the requirement
18:36 hlub for me, examples are the quickest way to understand :)
18:36 joshbenner babilen: Doing a require on an entire other state makes sense. What confuses me is specifying the state *module* in a requirement.
18:36 babilen It does not create a state for you or even install the required package
18:37 babilen joshbenner: You specify that as multiple states can share the same ID if they use functions from different modules
18:37 cyborg-one joined #salt
18:38 hlub the state ID is the default value for state's 'name'
18:38 babilen I don't really like doing that, but that is the background
18:39 joshbenner That doesn't sound right: state IDs are unique through the entire state tree.
18:39 joshbenner So if you have states with the same ID, you have a problem
18:39 babilen Indeed
18:39 babilen Which is why you have tuple (module:id)
18:39 jas02 joined #salt
18:40 hlub I prefer separate IDs and names always.
18:40 babilen https://docs.saltstack.com/en/latest/topics/tutorials/states_pt2.html#call-multiple-states
18:40 babilen For example .. they share the same ID (i.e. 'apache')
18:41 babilen I would advise against doing that and using unique IDs and separate states, but you see it in the wild
18:41 hlub and I see the module name in the requisite as something that makes the thing a bit readable and interpretable.
18:41 babilen You can refer unambigously to either with "service: apache" or "pkg: apache"
18:45 joshbenner In this example: http://pastebin.com/LuqYZhnE
18:45 joshbenner Does dependent cause the file.managed stuff to happen, or just the pkg.installed stuff?
18:46 hlub it only says that the dependent state is run after pkg.installed for foo
18:47 hlub but everything is executed of course
18:48 hlub unless pkg.installed fails
18:48 joshbenner So is require more about ordering than causing execution?
18:48 hlub yes
18:49 XenophonF requisites tell the state compiler how to order the list of function calls
18:49 hlub and preventhing execution when the required states fail
18:50 XenophonF the reason a requisite looks like "pkg: foo" instead of "pkg.installed: foo" has to do with syntactic sugar
18:52 XenophonF state data actually looks like this - https://gist.github.com/xenophonf/a1801018614248eb8122d5ef25de55f9
18:52 hlub the 'onchanges' relation is more about causing execution, although it brings ordering too
18:54 XenophonF https://docs.saltstack.com/en/latest/ref/states/highstate.html#function-declaration
18:54 XenophonF `state_module.state_function` is just a shortcut
19:00 XenophonF joshbenner: looking at the output of show_highstate or show_sls might clarify things for you
19:00 XenophonF https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.state.html#salt.modules.state.show_sls
19:04 XenophonF here's the compiled state data for the salt.minion SLS from salt-formula - http://ix.io/nM2
19:04 XenophonF i formatted it as json
19:05 XenophonF you can see a state ID of salt-minion
19:05 XenophonF it has pkg, file, and service states
19:12 leonkatz joined #salt
19:13 jas02 joined #salt
19:15 oaken_chris joined #salt
19:19 edrocks joined #salt
19:26 joshbenner The state data structure makes sense. I was struggling to understand why you'd specify a state module in the require. It suggests that the state module played some part in the requirement... but it seems like it's actually more to do with matching.
19:29 newmanium joined #salt
19:31 joshbenner I appreciate you guys helping me grok this stuff.
19:50 jas02 joined #salt
20:13 sh123124213 joined #salt
20:13 CeBe joined #salt
20:27 jas02 joined #salt
20:33 scsinutz joined #salt
20:40 scsinutz joined #salt
20:54 Poppabear any reason why salt can't "pkg.purged" Nginx ?
20:54 Poppabear The following packages failed to purge: nginx.
20:57 justan0theruser joined #salt
21:10 iggy try running with salt-call -l debug to see if you see anything useful
21:19 leonkatz joined #salt
21:22 edrocks joined #salt
21:22 teclator joined #salt
21:23 lilvim joined #salt
21:27 Satyajit joined #salt
21:32 leonkatz joined #salt
21:48 leonkatz joined #salt
21:50 alexlist joined #salt
21:55 ninjada joined #salt
21:59 joshbenner Are multiple config files in /etc/salt/master.d merged in a way such that I could define ext_pillar in multiple files and their values would b emerged?
21:59 joshbenner be merged*
22:00 onlyanegg joined #salt
22:09 jas02 joined #salt
22:10 iggy joshbenner: nope
22:11 joshbenner Just finished testing it: You're right! ;)
22:13 alexlist joined #salt
22:16 toastedpenguin joined #salt
22:27 tru_tru joined #salt
22:34 newmaniuma joined #salt
22:35 newmaniuma Hi all. Is there an option that needs to be set in order for salt-ssh to use custom grains in the _grains directory? None of my grains from that directory are returning when I run a "grains.items", yet I do see them getting sync'ed down to the minion when I turn on "-l debug"
22:42 onlyanegg joined #salt
23:00 bober joined #salt
23:11 jas02 joined #salt
23:12 Dereckson Poppabear: should be addressed outside Salt context at OS level, as it means the package manager doesn't want to proceed
23:17 justanotheruser joined #salt
23:21 tomatoschewps joined #salt
23:22 tomatoschewps hi all
23:23 tomatoschewps i'm trying to copy multiples files from my salt server to a directory with file.recurse and in the same time change owner and group of all files of the destination folder
23:23 tomatoschewps (there is already some files in the destination folder)
23:23 Poppabear Dereckson: i'm using a Salt module and the module is responsible for doing the work based on the OS, if its not working on "Debian/Ubuntu" systems then i have to say it would be a bug in the module.
23:24 tomatoschewps did someone have an idea of how to do that ?
23:24 Poppabear thats my opinion anyways .. We are supposed to trust that Salt is able to work out the OS Specific details when dealing with packages
23:25 tomatoschewps (I'm new with saltslack and did not find my answer in documentation)
23:28 jagguli- joined #salt
23:36 viq joined #salt
23:40 karlthane joined #salt
23:46 tomatoschewps It's ok, my understanding of the state declarations was bad.
23:47 tomatoschewps I have powered on my brain and find how to do it correctly :)
23:53 iggy Poppabear: I think you need to gather more info before you can say for sure... did you try what I suggested? Did you try to purge using apt-get like normal to see if there were issues?
23:56 XenophonF tomatoschewps: typically, you have to do that in two passes
23:56 Poppabear not yet iggy , i got wrapped up in other work, but i will try and see what i can find out and will be sure to let you know
23:56 XenophonF a file.directory state to alter the existing files/folders, and a file.recurse state to deploy the additional stuff
23:58 XenophonF it might be simpler to use salt to manage _all_ the files in a given folder, to where you can just use a single file.recurse state
23:59 tomatoschewps yes XenophonF but originaly I didn't use "- name: path_to_my_folder" but I was directly declaring with the path has name so it tells me I have double declaration
23:59 tomatoschewps I've made the modification to declare with an explicite name and une the "- name: xxx" to specifie the folder

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