Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-11-05

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

All times shown according to UTC.

Time Nick Message
00:05 swills_ joined #salt
00:15 XenophonF t3rm: the file.recurse state should do what you want
00:16 Praematura joined #salt
00:17 zulutango joined #salt
00:26 t3rm XenophonF: file.recurse seems to always overwrite minion even if the file is older
00:35 johnj_ joined #salt
00:38 seanz joined #salt
00:39 kellyp joined #salt
00:50 Praematura joined #salt
00:59 KennethWilke joined #salt
01:08 nethershaw joined #salt
01:19 cwright joined #salt
01:25 MNichie joined #salt
01:26 nethershaw joined #salt
01:36 johnj_ joined #salt
01:39 aviau joined #salt
02:10 dxiri joined #salt
02:11 N-Mi joined #salt
02:11 N-Mi joined #salt
02:20 t3rm joined #salt
02:38 N-Mi joined #salt
02:38 N-Mi joined #salt
02:38 johnj_ joined #salt
02:41 justanotheruser joined #salt
02:54 justanotheruser joined #salt
02:55 ilbot3 joined #salt
02:55 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.8, 2017.7.2 <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic <+> We are volunteers and may not have immediate answers
03:03 nomeed joined #salt
03:13 CampusD joined #salt
03:16 blu_ joined #salt
03:23 MNichie joined #salt
03:39 johnj_ joined #salt
04:17 laertus why do some state files use the {% foo %} template syntax, and others {{ foo }} ?
04:30 zerocool_ joined #salt
04:32 laertus here's an example of what i mean:  https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html#parameterizing-states-with-pillar
04:32 laertus in /srv/pillar/pkg/init.sls the {% foo %} syntax is used
04:33 laertus but in /srv/salt/apache/init.sls the {{ foo }} syntax is used
04:33 laertus i'm not clear as to when to prefer the one over the other
04:40 johnj_ joined #salt
04:44 MTecknology laertus: that part is jinja templating.
04:45 laertus which one?
04:46 MTecknology {% vs. {{
04:48 laertus alright.. i guess i should read up on jinja
04:48 laertus thanks
04:48 MTecknology http://jinja.pocoo.org/
04:49 MTecknology {% for foo in bar }} {{ foo }} {% endfor %}
04:50 MTecknology salt gives you most of jinja2, and jinja2 gives you a limited subset of python flow control as well as some filters
04:50 MTecknology or something like that... I probably shouldn't be answersing questions anymore tonight
04:51 laertus no, it's good... i really appreciate it
04:51 zerocool_ joined #salt
04:52 MTecknology heh, this popped up in a search - https://books.google.com/books?id=SCFwDQAAQBAJ&amp;pg=PA52&amp;lpg=PA52&amp;dq=minion+opts+in+pillar&amp;source=bl&amp;ots=X5zc_BOEGh&amp;sig=DdF5IZUzYQPyIdlUNt6zC425rUY&amp;hl=en&amp;sa=X&amp;ved=0ahUKEwjTwJaAyqbXAhVnzIMKHdwiDjYQ6AEIVTAI#v=onepage&amp;q=minion%20opts%20in%20pillar&amp;f=false
04:53 MTecknology Depsite my dislike of packt, I know the author is a brilliant feller that knows the in's & out's of salt
04:53 MTecknology (don't actually start at that page)
04:55 laertus thanks
04:56 MTecknology I get the feeling you're gonna get the hang of salt in a quick hurry.
04:56 MTecknology advice- please try to stay away from formulas. They keep you from understanding what's actuallying going on and tend to make things relatively un-modular.
04:57 MTecknology https://github.com/MTecknology/saltstack-demo
05:02 laertus really?  formulas are bad?
05:02 laertus what do you use instead?
05:03 MTecknology ^ that
05:07 laertus so how does that differ from a formula?
05:07 MTecknology formulas are git repos online that you have your master suck down with the theory that you just have to add pillar data and deploy.
05:09 dvdmuckle joined #salt
05:09 laertus ah, i see
05:09 laertus so you're suggesting not to use formulas written by someone else
05:10 laertus ie. canned scripts
05:10 laertus but you're ok with writing your own formulas, though, right?
05:11 MTecknology yup, but then you're building a solution rather that consuming a solution
05:11 MTecknology (or something like that)
05:14 laertus i understand
05:15 laertus i'd definitely rather roll my own.. if i have the time
05:16 laertus btw, thanks for linking to that github repo
05:16 laertus that's a great example
05:17 MTecknology :)
05:17 laertus there's so much to salt, i still don't fully know where to start
05:17 laertus it's like i read about some simple way of doing things, but then there are 20 other ways that are supposed to be way more flexible
05:18 laertus so i read about those.. and discover a ton more ways
05:18 SkyRocknRoll joined #salt
05:19 MTecknology remote execution to play, then states to edit files, then figure out how to install a package, edit the config, and restart the service for any config changes.
05:19 MTecknology Then get used to using pillar for secrets (gpg encrypted pillar is best), and then the rest just builds on itself.
05:20 * MTecknology is going to die alone because of salt
05:20 laertus but then do you use the standard fileserver, or the gitfs one?
05:20 laertus or something else?
05:22 MTecknology gitfs, and I have git hooks that send events up to the master and initiate a timer using sdb and, within params, schedule a global highstate execution. Some repos only trigger an immediate highstate on a subset of hosts.
05:22 laertus i haven't run across sdb yet
05:23 MTecknology you probably also haven't run across reactor or ext-pillar or orchestrator yet, but you will
05:24 laertus i've come across mentions of orchestration
05:24 laertus but haven't read up on it yet
05:24 laertus and actually about saltreactor too.. but have no clue what that is yet
05:24 MTecknology thorium is supposed to be great, but I haven't played with it yet
05:27 zerocool_ joined #salt
05:28 N-Mi joined #salt
05:28 N-Mi joined #salt
05:31 MTecknology bed thyme!
05:33 laertus good night.. and thanks for your help!
05:40 johnj_ joined #salt
05:50 masber joined #salt
06:11 lastjedi joined #salt
06:13 deathstar joined #salt
06:31 zerocool_ joined #salt
06:41 johnj_ joined #salt
07:33 Miouge joined #salt
07:34 wongster80 joined #salt
07:39 zerocool_ joined #salt
07:40 zerocool_ joined #salt
07:42 johnj joined #salt
07:52 Miouge joined #salt
07:58 Miouge joined #salt
07:59 pualj joined #salt
08:14 user-and-abuser joined #salt
08:19 Miouge joined #salt
08:26 pualj joined #salt
08:44 johnj joined #salt
08:51 Lionel_Debroux joined #salt
09:02 JAuz joined #salt
09:14 mikecmpbll joined #salt
09:27 Lionel_Debroux joined #salt
09:45 johnj joined #salt
09:47 Lionel_Debroux joined #salt
09:48 SlicerDicer joined #salt
09:57 ventris joined #salt
09:59 SlicerDicer joined #salt
10:07 bildz joined #salt
10:13 SlicerDicer joined #salt
10:28 LostSoul joined #salt
10:34 lastjedi joined #salt
10:41 SlicerDicer joined #salt
10:41 SlicerDicer joined #salt
10:46 johnj joined #salt
10:51 SlicerDicer joined #salt
10:51 SlicerDicer joined #salt
10:52 aldevar joined #salt
10:52 aldevar left #salt
11:09 lastjedi joined #salt
11:47 johnj joined #salt
11:59 XenophonF laertus: when you're done learning how to write states, go back to the saltstack-formulas library and stop re-inventing the wheel
11:59 XenophonF maybe help fix up the formulas that are there (they all need love and attention)
12:11 lastjedi joined #salt
12:13 absolutejam Salt is awesome, then you discover the event bus
12:13 absolutejam Then mindblown.gif
12:21 pualj joined #salt
12:22 XenophonF I agree wholeheartedly
12:27 XenophonF I manage a federated scientific collaboration system
12:27 XenophonF so when a new study comes online, we need to provision a ton of stuff for it: SharePoint, REDCap, Slack, etc.
12:28 XenophonF we're planning to extend the collaboration management tool to use a Salt API webhook to send the master an event
12:29 XenophonF which would trigger resource creation (site collection, project database, private channel, etc.)
12:33 ventris left #salt
12:42 dvorak_ joined #salt
12:48 johnj joined #salt
13:49 johnj joined #salt
13:55 XenophonF I <3 YAML backreferences.
14:37 noobiedubie joined #salt
14:37 tiwula joined #salt
14:50 johnj joined #salt
15:08 tiwula joined #salt
15:31 t3rm joined #salt
15:32 asdf__ joined #salt
15:39 aviau joined #salt
15:45 cholcombe joined #salt
15:48 cyborg-one joined #salt
15:51 johnj joined #salt
16:05 MNichie joined #salt
16:07 sjorge joined #salt
16:10 dxiri joined #salt
16:29 pierB joined #salt
16:30 pierB Hi
16:30 pierB Is there any way to choose or at least make more compact a returner output ? I am using the smtp returner ....
16:35 RandyT joined #salt
16:35 RandyT joined #salt
16:52 johnj joined #salt
16:57 pierB Any ideas about a way to control smtp returner outpu format guys ?
17:16 MNichie joined #salt
17:18 Trauma joined #salt
17:19 Trevor-H joined #salt
17:37 enigma joined #salt
17:37 enigma left #salt
17:38 enigma82 joined #salt
17:41 enigma82 Is anyone of a grains module to get Azure VM Metadata? There is SALT.GRAINS.METADATA but that appears to be EC2 only
17:43 Trauma joined #salt
17:43 tsia_ joined #salt
17:45 iggy there's not one in salt-contrib
17:45 iggy it probably wouldn't be terribly hard to edit one of the existing ones to fit azure
17:50 Trauma joined #salt
17:53 johnj_ joined #salt
18:10 tiwula joined #salt
18:15 Trauma joined #salt
18:19 Trauma joined #salt
18:34 Lionel_Debroux joined #salt
18:34 Trauma joined #salt
18:35 N-Mi joined #salt
18:35 N-Mi joined #salt
18:41 laertus i'm a little confused by this part of the salt docs:  https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html#parameterizing-states-with-pillar
18:42 shoogz joined #salt
18:42 laertus there's this line:  - name: {{ salt['pillar.get']('pkgs:apache', 'httpd') }}
18:43 laertus where can i read more about the syntax of what's going on between the {{ and }} ?
18:44 JPT That's the jinja template engine syntax afaik
18:44 JPT Maybe this is a good start?: https://docs.saltstack.com/en/latest/topics/jinja/index.html
18:45 laertus no, i understand it's jinja.. that's not the part that i'm really interested in right now, actually
18:45 JPT Oh, you mean the salt object thingy
18:45 laertus yeah
18:45 iggy everything in the `salt` dictionary are execution modules
18:46 iggy https://docs.saltstack.com/en/latest/salt-modindex.html#cap-m
18:46 iggy so everything there
18:48 laertus that definitely helps... in particular, for this example, the docs on pillar.get here:  https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.pillar.html
18:49 laertus but i'm still confused by the actual syntax
18:49 laertus like, for instance, there's another line in that tutorial:   - name: {{ pillar['pkgs']['apache'] }}
18:49 laertus so why did they use    pillar['pkgs']['apache']
18:50 Miouge joined #salt
18:50 laertus whereas the first example used:   salt['pillar.get']('pkgs:apache', 'httpd')
18:50 laertus first, why is the call to salt necessary here?
18:50 laertus second, why is the [] followed by () in this example, while in the other one it's [][]
18:51 cyborg-one joined #salt
18:52 laertus it's really confusing... and the docs don't really provide any guidance as to which syntax to use where
18:53 laertus except to give a couple of examples here and there, like these two
18:54 johnj_ joined #salt
18:59 MTecknology laertus: one is calling the module and the other is accessing a dictionary
18:59 MTecknology If that much python is confusing, then you should always prefer using the module
19:08 Miouge joined #salt
19:09 laertus ok, that kind of makes sense
19:10 laertus pillar is a dictionary, which can be accessed by pillar['foo']['bar'] etc..
19:11 laertus and salt['foo.bar'](baz) is a call of the bar method in the foo module with baz as argument
19:12 laertus when all you need is a simple dictionary lookup, pillar['foo']['bar'] is sufficient
19:12 laertus but when you need more than that, you might have to rely on the method call from the pillar module
19:21 iggy one reason to choose one over the other is exception handling
19:21 iggy pillar['foo']['bar'] will cause an exception
19:22 aldevar joined #salt
19:22 iggy salt['pillar.get']('foo:bar') will just return None
19:23 iggy (if either of foo or foo->bar don't exist in pillar that is)
19:24 laertus is it possible to handle exceptions in a salt run?
19:32 MTecknology exception handling means properly getting the exception to the master, and that happens
19:33 MTecknology coding with taste: taking the exception and making it not the exception
19:35 laertus well, i mean you can set up exception handlers in python, using try...except blocks
19:35 laertus and when you get an expected exception you can do something about it
19:36 laertus just wondering if this was possible with salt
19:36 laertus like when a dictionary lookup fails, for instance
19:38 laertus actually, now that i think about it for a second, i realize that in that case you could have just coded up the module call with a default value instead of doing a dictionary lookup.. so in that particular case i guess handling the exception is not necessary
19:41 MTecknology iggy: Am I losing my mind? Is there such thing as "master pillar data", as opposed to a minion running on the master with it's own pillar data?
19:43 MTecknology laertus: that was exactly the point :)
19:43 laertus MTecknology: i was just reading about this:  https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html
19:43 laertus *"By default, the contents of the master configuration file are not loaded into pillar for all minions. This default is stored in the pillar_opts setting, which defaults to False."*
19:44 laertus "The contents of the master configuration file can be made available to minion pillar files."
19:44 laertus maybe that's what the "master pillar data" you ran in to is?
19:45 MTecknology I'm not trying to make master config data available to minions
19:46 MTecknology I wast salt-cloud to pull what it knows from pillar instead of requiring files be created.
19:48 MTecknology I think I'm starting to remember why I took a break from this all those many months ago.
19:49 pbandark joined #salt
19:49 laertus i can only imagine... i'm just getting started and already my mind is swimming
19:51 MTecknology I'm trying to get to the point that I can define a VM in Netbox and then sit back and wait for the notification email about salt highstate having finished running on the new box.
19:52 laertus how long has it taken you to get this far?
19:53 MTecknology 42
19:53 laertus 42 years of using salt?  wow
19:53 laertus ;}
19:54 MTecknology I think I have some stuff about it on my blog
19:55 johnj_ joined #salt
19:55 MTecknology something like this takes a while to build when you're not being paid -- https://imgur.com/a/fjdoE
19:56 Laogeodritt| joined #salt
19:56 swills_ joined #salt
19:56 jf_sebas1ian joined #salt
19:57 jhujhiti_ joined #salt
19:59 winterblack joined #salt
19:59 Trauma joined #salt
20:00 rawzone^ joined #salt
20:00 elkektetet joined #salt
20:00 EugeneKay joined #salt
20:01 TooLmaN_ joined #salt
20:01 dagb_ joined #salt
20:02 v0rtex_ joined #salt
20:07 cmichel joined #salt
20:16 daks joined #salt
20:17 nledez joined #salt
20:18 al joined #salt
20:24 Trauma joined #salt
20:33 RandyT joined #salt
20:33 RandyT joined #salt
20:46 Trauma joined #salt
20:48 noobiedubie joined #salt
20:56 johnj_ joined #salt
21:10 iggy MTecknology: there isn't really pillar in the master context (there actually is in some areas, but I try to avoid it)
21:19 MTecknology I've been trying to avoid writing a bit of pillar data to a flat yaml file that can be passed to map_run. :(
21:19 aldevar left #salt
21:20 MTecknology file.managed: -name: /etc/salt/cloud.map -contents: {{ pillar.get('map_data', '')|yaml }}
21:31 MochaLoca joined #salt
21:35 tiwula joined #salt
21:36 tiwula joined #salt
21:38 tiwula joined #salt
21:40 tiwula joined #salt
21:41 tiwula joined #salt
21:50 ChubYann joined #salt
21:50 xet7 joined #salt
21:50 Gareth joined #salt
21:50 hax404 joined #salt
21:51 BlackSponge joined #salt
21:51 tongpu joined #salt
21:51 Ryan_Lane joined #salt
21:51 rylnd joined #salt
21:51 munhitsu_ joined #salt
21:51 supermike___ joined #salt
21:51 djural joined #salt
21:51 simondodsley joined #salt
21:51 mrbobbytables joined #salt
21:51 kwmiebach joined #salt
21:51 ToeSnacks joined #salt
21:52 Awesomecase joined #salt
21:55 jcristau joined #salt
21:55 v0rtex joined #salt
21:55 dankolbrs joined #salt
21:55 Kax joined #salt
21:56 c4rc4s joined #salt
21:56 nledez joined #salt
21:56 nledez joined #salt
21:56 sjorge joined #salt
21:56 notCalle joined #salt
21:57 johnj_ joined #salt
22:00 cyborg-one joined #salt
22:01 user-and-abuser joined #salt
22:04 dRiN joined #salt
22:07 tiwula joined #salt
22:10 swills_ left #salt
22:10 swills joined #salt
22:13 iggy moving into management sucks... this feels like the best work I've done in months https://github.com/saltstack-contrib/grains-gce
22:27 Processus42 joined #salt
22:38 morgana2313 joined #salt
22:41 morgana2313 Hello! How can I convert a datastructure to a flat string? echo "{{ salt['pillar.get']('lxd:network') | string }} " gives a failed: while parsing a block mapping
22:41 demize joined #salt
22:44 Trauma joined #salt
22:51 psychi[m] joined #salt
22:51 kbaikov[m] joined #salt
22:51 rtr63gdh[m] joined #salt
22:51 freelock joined #salt
22:51 gomerus[m] joined #salt
22:51 viq[m] joined #salt
22:51 hackel joined #salt
22:51 benjiale[m] joined #salt
22:51 ThomasJ|m joined #salt
22:51 jerrykan[m] joined #salt
22:51 theblazehen joined #salt
22:51 aboe[m] joined #salt
22:51 toofoo[m] joined #salt
22:51 renaissancedev[m joined #salt
22:51 fujexo[m] joined #salt
22:58 johnj_ joined #salt
23:05 XenophonF morgana2313: you could convert it to YAML or JSON using the appropriate filter
23:06 XenophonF morgana2313: https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html#salt.utils.jinja.SerializerExtension
23:07 XenophonF Jinja's string(object) filter doesn't work the way you think.
23:07 XenophonF It doesn't pprint objects.
23:07 XenophonF Instead it ensures that a string is in Unicode format
23:07 XenophonF http://jinja.pocoo.org/docs/dev/templates/#string
23:10 XenophonF oh you can pretty-print the object in Python syntax now too
23:10 XenophonF that's new to me :)
23:13 wongster80 joined #salt
23:19 jhujhiti joined #salt
23:23 MochaLoca joined #salt
23:34 tom[] is it possible to pass data from an orchestration sls as jinja variables to a state sls invoked on a minion by salt.state?
23:43 tom[] here's an example that maybe shows what i mean https://gist.github.com/anonymous/7a9628e0c092e0d923fbaf19bc3a6e87
23:46 tom[] sorry, i did that as an anon user https://gist.github.com/spinitron/dea2ca443ac462bc475d30ad8c790c4b
23:54 LocaMocha joined #salt
23:59 ProT-0-TypE joined #salt
23:59 johnj_ joined #salt

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