Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-10-25

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

All times shown according to UTC.

Time Nick Message
00:06 jas02 joined #salt
00:22 pryorda joined #salt
00:38 Felgar joined #salt
00:43 jeffspeff joined #salt
00:44 swa_work joined #salt
00:48 jas02 joined #salt
00:58 omie88877777 joined #salt
00:59 mTeK joined #salt
01:00 notCalle joined #salt
01:00 dh joined #salt
01:00 dagb joined #salt
01:24 cyborg-one joined #salt
01:31 jas02 joined #salt
01:56 ilbot3 joined #salt
01:56 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
02:17 jas02 joined #salt
02:30 pipps joined #salt
02:44 blu_ joined #salt
02:50 evle joined #salt
02:58 jas02 joined #salt
02:59 pipps joined #salt
03:00 pipps joined #salt
03:01 packeteer joined #salt
03:03 mikecmpbll joined #salt
03:16 hexa- joined #salt
03:18 dxiri joined #salt
03:24 dxiri joined #salt
03:50 mavhq joined #salt
03:51 threwahway joined #salt
03:58 jas02 joined #salt
04:02 mikecmpbll joined #salt
04:33 tiwula joined #salt
04:34 jas02 joined #salt
05:09 JPaul joined #salt
05:13 darioleidi joined #salt
05:21 LocaMocha joined #salt
05:27 nkuttler what do /j #openstack
05:31 felskrone joined #salt
05:39 jas02 joined #salt
05:49 Ricardo1000 joined #salt
06:20 jas02 joined #salt
06:30 jas02 joined #salt
06:30 Miouge joined #salt
06:35 DanyC joined #salt
06:51 hojgaard joined #salt
06:56 jas02 joined #salt
06:58 yuhl joined #salt
06:59 threwahway joined #salt
07:07 EthPyth joined #salt
07:09 ibro joined #salt
07:14 usernkey joined #salt
07:41 robman joined #salt
07:43 jas02 joined #salt
07:48 jas02 joined #salt
07:53 do3meli joined #salt
07:53 do3meli left #salt
07:55 DanyC joined #salt
08:03 toanju joined #salt
08:05 darioleidi joined #salt
08:07 threwahway joined #salt
08:14 pbandark joined #salt
08:16 jas02 joined #salt
08:22 ivanjaros joined #salt
08:23 jas02 joined #salt
08:24 hoonetorg joined #salt
08:28 Ricardo1000 joined #salt
08:35 jas02 joined #salt
08:42 Mattch joined #salt
08:49 N-Mi joined #salt
09:01 yuhl_ joined #salt
09:05 swa_work joined #salt
09:05 michiel left #salt
09:08 jas02 joined #salt
09:10 aldevar joined #salt
09:15 threwahway joined #salt
09:22 _KaszpiR_ joined #salt
09:34 mage_ ange: yes, I'm using rsync over ssh
09:39 yuhl joined #salt
09:40 yuhl_ joined #salt
09:56 ange mage_: ok, thanks
10:00 viq whiteinge: I see people trying to use #saltstack and you're set as owner, maybe it would be an idea to redirect them here?
10:19 pualj joined #salt
10:22 Miouge joined #salt
10:25 Miouge joined #salt
10:31 mikecmpbll joined #salt
10:32 `mist joined #salt
10:36 `mist Hi, i'm trying to deploy https://hub.docker.com/r/linuxserver/transmission/ using saltstack but i don't understand how to bind the uid and gid. They are specified with -e gid -e uid according to the dockerhub page. How would i do this in salt?
10:38 Naresh joined #salt
10:42 darioleidi joined #salt
10:45 ogzy joined #salt
10:46 ogzy is it possible to use saltstak ui to complete a vm cycle on vcenter? Like opening a vm from template and customize it a bit like changing network inerface etc
10:46 ogzy if so whihc ui should i used?
11:00 jas02 joined #salt
11:01 pualj joined #salt
11:13 viq ogzy: the only UI salt has is the enterprise one
11:13 viq Otherwise it's all just text and APIs
11:16 viq `mist: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.docker_container.html
11:18 viq `mist: where -e specifies environment variables, and the state above lets you set that as well
11:25 EthPyth joined #salt
11:40 cyborg-one joined #salt
11:44 evle joined #salt
11:59 usernkey joined #salt
12:01 `mist viq: so it would be    environment: - gid: 1001 - uid: 1001 for example?
12:02 EthPyth joined #salt
12:03 viq `mist: close, but apparently it would need to be   environment: - PUID: 1001 - PGID: 1001
12:03 `mist viq: gid and uid are shell variables not environment variables though, aren't they?
12:04 viq -e in docker create sets environment variables
12:04 viq and kinda "what's the difference?"
12:05 `mist hmmm i guess one is local and the other is global
12:06 viq Which one is which? ;)
12:06 viq Since if you do "EDITOR=vim sudoedit /some/file", I guess you'd try to call it a shell variable, but you just set an environment variable
12:06 masuberu joined #salt
12:07 viq That will last only as long as the command you're executing, but that's all you need in case of docker.
12:08 `mist omg that worked! =D
12:10 darioleidi joined #salt
12:10 viq \o/
12:13 Nahual joined #salt
12:15 `mist hm.... it didn't write anything to the config directory... odd
12:20 `mist well, thats not your problem. Thanks for salt hilfe viq ^^
12:21 viq :)
12:35 gnomethrower_ joined #salt
12:35 aldevar joined #salt
12:49 gh34 joined #salt
12:55 numkem joined #salt
12:56 threwahway joined #salt
12:59 Brew joined #salt
13:01 Miouge joined #salt
13:09 omie888777 joined #salt
13:12 _KaszpiR_ joined #salt
13:16 cablekevin joined #salt
13:17 racooper joined #salt
13:23 edrocks joined #salt
13:29 aldevar joined #salt
13:46 oida joined #salt
13:48 FuzzyVeg joined #salt
13:49 FuzzyVeg left #salt
13:50 mikecmpbll joined #salt
13:53 packeteer joined #salt
14:00 aldevar left #salt
14:02 ooboyle Edgan: Got it. Thanks, you've been very helpful.
14:12 threwahway joined #salt
14:17 cgiroua joined #salt
14:29 sarcasticadmin joined #salt
14:41 beardedeagle joined #salt
14:45 dxiri joined #salt
14:49 stewgoin joined #salt
14:52 choke joined #salt
14:58 edrocks joined #salt
14:59 _KaszpiR_ joined #salt
15:00 tiwula joined #salt
15:15 jbkc85 joined #salt
15:20 relidy joined #salt
15:22 jas02 joined #salt
15:39 lompik joined #salt
15:44 Hybrid joined #salt
15:46 edrocks joined #salt
15:49 mchlumsky joined #salt
15:51 ooboyle joined #salt
15:53 XenophonF joined #salt
16:01 mchlumsky_ joined #salt
16:02 Brew joined #salt
16:09 jas02 joined #salt
16:11 aagbds joined #salt
16:11 aagbds left #salt
16:12 omie888777 joined #salt
16:19 XenophonF oh I get it
16:21 XenophonF how do I get a salt state to pass the current environment to an execution module?
16:22 XenophonF I want the selinux.module state to install an SELinux module, but it's calling the selinux.install_semod function, which only looks in the base environment
16:24 kuchi joined #salt
16:24 cmichel joined #salt
16:28 mpanetta joined #salt
16:28 XenophonF oh haha I already reported this bug
16:29 XenophonF I guess I'd better get cracking on that PR, eh gtmanfred?
16:35 sahama joined #salt
16:39 sahama hi
16:39 sahama i can send pillar in cmd like this ==> salt-ssh pc state.apply minion pillar='{"master_ip":"localhost"}'. but i can`t pass it in code like this ==> SSHClient().cmd(['pc'], 'state.apply', ['minion'],tgt_type='list', pillar={'master_ip': "localhost"})
16:40 sahama how can i pass dynamic pillar to statefile dynamically in python code?
16:40 jas02 joined #salt
16:41 jas02 joined #salt
16:44 ivanjaros joined #salt
16:45 Hybrid joined #salt
16:47 Deliant joined #salt
16:50 sahama i found answer:
16:50 sahama i should pass pillar as kwarg and NOT kwargs
16:52 choke joined #salt
16:54 choke Hey everyone, hoping you all can get me on the right path for what I need to do... https://gist.github.com/jblac/87338185b562b5b6f9e5493356db544b -- i've added a synopsis @ the bottom of this gist outlying my problem, and what I need to figure out how to do.
16:54 cyborg-one joined #salt
16:56 sahama left #salt
16:58 pipps joined #salt
16:59 bildz are you now able to use pillar data in a salt repo script file?  i.e.  salt 'server' cmd.script salt://scripts/set-file-timestamp.ps1 shell=powershell pillar='{"filename": "C:\file.txt"}
16:59 bildz not*
17:00 choke disregard my question -- choke is a moron and asked in the wrong channel.
17:03 chowmeined joined #salt
17:12 tkharju joined #salt
17:18 edrocks joined #salt
17:22 pipps joined #salt
17:25 evle1 joined #salt
17:28 nick123 joined #salt
17:32 edrocks joined #salt
17:32 XenophonF bildz: if that's a Jinja template, I think you also have to pass template=jinja
17:32 DammitJim joined #salt
17:40 cgiroua_ joined #salt
17:42 vishvendra joined #salt
17:42 toanju joined #salt
17:45 wes joined #salt
17:48 swa_work joined #salt
17:51 westone joined #salt
17:52 gtmanfred XenophonF: yes please!
17:52 Trauma joined #salt
17:53 xet7 joined #salt
17:58 _KaszpiR_ joined #salt
18:07 nixjdm joined #salt
18:07 jbkc85 joined #salt
18:08 cgiroua joined #salt
18:08 jbkc85 Hi all, I was wondering if there was a way to check if a file existed on salt master prior to loading it in top.sls
18:08 jbkc85 basically we have a setup at the moment that is loading 'secrets', and Its getting stuck on said secret files if they don't exist.  I don't want to go 'touch' a file thats empty
18:08 jbkc85 Id rather it just default at that point
18:14 lordcirth_work jbkc85, you are keeping the secrets in Pillar, right?
18:15 jbkc85 Yes?  Its in a separate pillar_root
18:15 jbkc85 (Warning: Im still relatively new to Salt)
18:15 lordcirth_work jbkc85, do you generally have a 1:1 mapping between minions and secrets?
18:16 lordcirth_work Or nodegroups and secrets?
18:27 jbkc85 um...
18:27 jbkc85 I think its 1-1, but I don't like that :-)
18:27 jbkc85 I want to do more of a 1-default, and if 1-1 exists, overwrite the default
18:27 _JZ_ joined #salt
18:28 swa_work joined #salt
18:32 grains joined #salt
18:35 dxiri_ joined #salt
18:36 ChubYann joined #salt
18:37 westone joined #salt
18:40 swa_work joined #salt
18:44 socket- joined #salt
18:46 pipps joined #salt
18:48 lordcirth_work jbkc85, so one thing you can do is define secret: False for '*', and then secret: 'secretstring1' for each minion
18:49 nomeed joined #salt
18:49 lordcirth_work and then in jinja: {% if secret %} {{ secret }} {% endif %} sort of thing
18:51 pualj joined #salt
18:52 pipps joined #salt
18:53 gmoro_ joined #salt
18:54 pipps99 joined #salt
19:00 _KaszpiR_ joined #salt
19:01 gmoro joined #salt
19:03 jbkc85 But in the top.sls, its looking for a specific file
19:03 jbkc85 Like "secret.grains['server_name']"
19:03 jbkc85 And thats where it is failing if it doesn't exist
19:03 jbkc85 I don't want that failure
19:03 jbkc85 Though I want it to pick up IF its there
19:06 swa_work joined #salt
19:08 westone joined #salt
19:10 lordcirth_work jbkc85, One thing you could try is file_tree
19:11 lordcirth_work https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.file_tree.html#module-salt.pillar.file_tree
19:11 lordcirth_work This allows you to drop your secret into a directory named for the minion, so each minion has it's own file
19:12 sjorge joined #salt
19:13 jbkc85 Ahh, thanks...I will look into this
19:13 jbkc85 One other potentially quick question if you don't mind
19:13 jbkc85 Im loading a pillar to bring in 'my_env: test'
19:13 jbkc85 Running pillar.items it works fine
19:14 jbkc85 However, when I try to load it in my SLS file (set working_env = pillar['my_env'])
19:14 jbkc85 It says str object has no attribute directories
19:16 jbkc85 https://gist.github.com/jbkc85/2ca497348d5893d80fb5486ae752fab2
19:17 lordcirth_work jbkc85, pillar.get( "{{ working_env }}/shared" ) is wrong
19:18 lordcirth_work Or at least, odd.  You normally use :, not /, in pillar paths
19:18 lordcirth_work And using {{ }} inside {% %} is wrong; you don't need it, you're already in jinja
19:19 lordcirth_work What type is my_environment supposed to be? a dict?
19:21 jbkc85 Just a string
19:21 jbkc85 > {%- set shared = pillar.get( {{ working_env }} + ":shared", {} ) %}?
19:22 jbkc85 Err, sorry.  No "{{" "}}"
19:22 lordcirth_work remove the {{ }}
19:22 jbkc85 Yea, its still the same error of 'str object' has no attribute 'direcotires'
19:22 lordcirth_work Then I think it should work
19:22 lordcirth_work Ok, so that means you are trying to use a string as a dict somewhere
19:23 jbkc85 Rendering SLS 'base:microservice/ms-1' failed: Jinja variable 'str object' has no attribute 'directories'
19:23 lordcirth_work I've never tried to generate the pillar location via jinja
19:23 nixjdm joined #salt
19:24 jbkc85 my_environment: test
19:24 jbkc85 Maybe I need to do "test"
19:25 lordcirth_work That would be simpler
19:25 lordcirth_work I don't even use envs
19:26 lordcirth_work Well, I guess this isn't a salt env you're referring to
19:27 jbkc85 Nah, a folder struct
19:28 jbkc85 Pillars are like 'dev', 'test'
19:28 jbkc85 And inherit different values based on the hostname
19:29 westone joined #salt
19:32 jfelchner joined #salt
19:32 tkharju joined #salt
19:32 XenophonF jbkc85: there's also the `ignore_missing` flag in top.sls
19:32 XenophonF can't find it documented anywhere though :(
19:33 jbkc85 I saw that somewhere but when I put it in it broke, couldn't figure out the correct way
19:33 XenophonF https://github.com/irtnog/salt-pillar-example/blob/master/top.sls
19:33 XenophonF line 99
19:34 XenophonF note that I get away with that b/c the other matches are PCREs
19:35 XenophonF otherwise I'd get an error about having duplicate IDs in the base dictionary
19:38 westone joined #salt
19:48 guest007 joined #salt
19:49 guest007 left #salt
19:53 XenophonF every time Salt goes to install something on my CentOS boxes, it does a repository metadata refresh
19:53 XenophonF every
19:53 XenophonF time
19:54 XenophonF it make highstates so freaking slow
19:54 XenophonF what do?
19:54 xet7_ joined #salt
19:54 lordcirth_work XenophonF, cache_valid_time
19:54 lordcirth_work https://docs.saltstack.com/en/latest/ref/states/all/salt.states.pkg.html#salt.states.pkg.installed
19:55 XenophonF debian-only :(
19:56 lordcirth_work XenophonF, oh sorry, didn't notice that
19:56 lordcirth_work Well, now you know what your next PR should be :P
19:56 xet7bot joined #salt
19:57 XenophonF hah
19:57 jbkc85 Oh, thanks XenophonF
19:57 XenophonF salt.modules.yumpkg.install's refresh kwarg defaults to False
19:57 jbkc85 And I found out all my other issues, so thank you all =)
19:57 XenophonF jbkc85: you're welcome
20:00 jbkc85_ joined #salt
20:01 westone joined #salt
20:01 nick123 joined #salt
20:04 XenophonF joined #salt
20:08 inad922 joined #salt
20:08 Miouge joined #salt
20:12 mist1231 joined #salt
20:14 jas02 joined #salt
20:14 XenophonF joined #salt
20:15 XenophonF and Salt appears to be ignoring `reload_modules: True`?
20:15 XenophonF grrrrrrrr
20:17 mist1231 Hi Guys. Can anyone see why this extremely simple user state is not working? https://thepasteb.in/p/WnhzmJWk09rUV
20:19 laertus joined #salt
20:20 pipps joined #salt
20:21 XenophonF mist1231: what error are you getting?
20:21 mist1231 Comment: Failed to create new user transmission
20:22 westone joined #salt
20:22 mist1231 ok i actually solved it
20:22 nixjdm joined #salt
20:23 XenophonF how?
20:23 mist1231 seems you cant use gid if the group doesn't exist. instead one must use gid_from_name: True
20:23 XenophonF oh cool
20:23 mist1231 so it wont create a group using gid
20:23 mist1231 thats borderline a bug
20:24 mist1231 XenophonF: how would i create a require on that state?
20:25 XenophonF you'd add a requisite like `user: Create transmission user`
20:25 XenophonF https://docs.saltstack.com/en/latest/ref/states/requisites.html
20:26 mist1231 ah brilliant. thank you
20:28 grains left #salt
20:28 westone joined #salt
20:30 mist1231 i'm new to require. XenophonF would require: - sls: software.docker also work? or should i instead use require: - pkg: docker-ce
20:30 mist1231 i'm trying to understand in which order stuff is being executed, and if it matters
20:30 pipps joined #salt
20:33 XenophonF in a require, the `sls` requisite would run the state after ALL the states in the specified SLS have been executed
20:34 XenophonF in a require, the `pkg` requisite would run the state after ONLY the specified pkg state ran
20:34 XenophonF you probably shouldn't use the sls requisite
20:34 sarcasticadmin joined #salt
20:35 XenophonF IMO requisites should not span SLSes
20:36 XenophonF I really should write my rules down.
20:37 XenophonF Rule 1: Requisites only reference states within the same SLS.
20:37 XenophonF Rule 2: Don't use include/extend.
20:38 XenophonF Rule 3: If you absolutely have to glue two SLSes together, do so in a way that doesn't prevent people from running the source SLSes individually.
20:38 edrocks joined #salt
20:39 XenophonF Rule 4: Don't write a state when you could use Pillar data instead.
20:40 mist1231 ooo you're gonna hate me
20:40 mist1231 i haven't really used pillar data except once
20:40 mist1231 lol
20:40 XenophonF Not if you remember Rule 5: Always. Be. Configuring.
20:40 * XenophonF is a winner.
20:44 XenophonF hm, guess that joke fell flat oh well
20:44 mist1231 lol
20:45 mist1231 XenophonF: so i've got this state:  https://thepasteb.in/p/lOhONQvZXQxHB
20:45 mist1231 but the require isn't being respected. it seems like it goes ahead and runs the transmission: before the Create user
20:45 chitown joined #salt
20:46 mist1231 which creates a directory with root permissions that ruins everything
20:46 jas02 joined #salt
20:48 pipps joined #salt
20:48 XenophonF well you have a syntax error
20:48 mist1231 huh
20:48 XenophonF `require` should be another keyword argument in the list under docker_container.running
20:49 jas02 joined #salt
20:49 XenophonF it helps if you visually put things in order top to bottom
20:49 mist1231 Oh....
20:49 XenophonF and IIRC salt executes states in that order, top of the file to the bottom of the file
20:49 XenophonF so you may not need that require to get things to execute properly
20:50 XenophonF https://docs.saltstack.com/en/latest/ref/states/compiler_ordering.html
20:51 XenophonF anyone hitting this error on CentOS Linux 7.4/Salt Minion 2017.7.2?
20:51 XenophonF Exception raised when processing __virtual__ function for salt.loaded.ext.module.selinux. Module will not be loaded: 'module' object has no attribute 'which'
20:54 inire joined #salt
20:56 JAuz joined #salt
20:57 vishvendra joined #salt
20:59 _JZ_ joined #salt
21:02 yuhl joined #salt
21:03 edrocks joined #salt
21:04 jab416171 joined #salt
21:05 XenophonF of course the selinux module works fine on another CentOS 7.4 server
21:07 bryceml joined #salt
21:08 pipps joined #salt
21:20 lru joined #salt
21:23 nixjdm joined #salt
21:34 testgtmanfred joined #salt
21:35 saltstacktesting joined #salt
21:36 pryorda joined #salt
21:44 xMopxShell What's the best way to query pillar data without touching minions? E.g. some module that retrieves values off the master, only
21:44 xMopxShell I've found the pillar_roots module, which is able to read the contents of pillar files on the master. But it doesn't process the files.
21:46 xMopxShell d'oh, found pillar.show_pillar
21:47 JawnAuz joined #salt
21:50 _JZ_ joined #salt
22:01 jbailey_ joined #salt
22:02 pipps joined #salt
22:22 nixjdm joined #salt
22:23 _JZ_ joined #salt
22:23 jas02 joined #salt
22:31 oida joined #salt
22:31 pbandark joined #salt
22:36 pipps joined #salt
22:39 Felgar joined #salt
22:42 pbandark joined #salt
22:57 dxiri joined #salt
22:58 dxiri joined #salt
23:01 nick123 joined #salt
23:03 barloj joined #salt
23:05 masuberu joined #salt
23:31 nick123 joined #salt
23:51 pipps joined #salt

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