Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2016-09-06

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

All times shown according to UTC.

Time Nick Message
00:01 jaybocc2 joined #salt
00:07 ninjada joined #salt
00:08 kojiro joined #salt
00:12 Jimlad_ joined #salt
00:16 Jimlad joined #salt
00:28 tapoxi joined #salt
00:28 Jimlad_ joined #salt
00:32 mattp_ babilen: MTecknology: thanks
00:54 Salander27 joined #salt
00:55 ageorgop joined #salt
00:59 oida joined #salt
01:10 DEger joined #salt
01:11 kojiro joined #salt
01:13 edrocks joined #salt
01:15 mattp_ if a sls pulls in another sls conditionally, when is the jinja run on the pulled in sls? is it run time?
01:15 mattp_ like, say an onchanges or onfail conditionally pokes another sls - does the render (and potential calls to say pillar/mine/get) happen at time of invocation?
01:21 oida joined #salt
01:23 catpigger joined #salt
01:26 John_Kang joined #salt
01:27 mpanetta joined #salt
01:29 mpanetta joined #salt
01:30 XenophonF mattp_: there's render time, and then there's state compile time, and then there's job run time
01:30 fxhp joined #salt
01:30 XenophonF so jinja will do it's thing and be done by the time salt gets around to turning the resulting YAML files into data structures that can be fed to the state compiler
01:31 XenophonF that's when things get ordered based on things like onchanges or listen or require_in or whatever
01:37 oida joined #salt
01:47 ilbot3 joined #salt
01:47 Topic for #salt is now Welcome to #salt! | Latest Versions: 2015.8.12, 2016.3.3 | 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
01:49 mattp_ XenophonF: so all yamls are rendered at run/compile time
01:50 kojiro joined #salt
02:08 k_sze[work] joined #salt
02:09 scoates joined #salt
02:11 bastiand1 joined #salt
02:15 XenophonF not rendered, compiled
02:15 XenophonF the .sls files are jinja templates
02:16 XenophonF the resulting text is yaml that gets compiled into state data
02:16 XenophonF that state data gets executed during a highstate/lowstate job on the salt minions
02:16 XenophonF for example, pick an sls file and run state.show_sls on a minion
02:16 XenophonF hang on a
02:17 dyasny joined #salt
02:17 XenophonF hang on i'll post an example
02:19 XenophonF mattp_: https://gist.github.com/xenophonf/b272a578ae78129e09a685cb966aa60a
02:19 XenophonF mattp_: https://github.com/irtnog/salt-states/tree/development/banners
02:19 XenophonF first link is the compiled state data
02:19 XenophonF second link is the source file (banners/init.sls)
02:20 XenophonF the jinja is kind of minimal
02:20 XenophonF you can imagine the output of the jinja renderer as being this file, https://github.com/irtnog/salt-states/blob/development/banners/init.sls
02:20 XenophonF only lines 1 and 24 are empty
02:21 XenophonF b/c the jinja renderer executed the jinja code on those lines and stripped it out of the output
02:21 XenophonF the resulting yaml gets compiled into the gist i shared above
02:21 XenophonF that compiled state data is what ends up getting executed on a minion
02:21 XenophonF salt's really like it's own programming langauge
02:21 XenophonF language
02:22 XenophonF it's use of jinja (or mako, or wempy, or gpg) is akin to the C compiler's use of the preprocessor
02:23 XenophonF when you write states in YAML, you're really crafting a function call
02:24 XenophonF it's very lispy in this sense, as the YAML data structure follows the abstract syntax tree (AST) of the Python function call
02:25 XenophonF i would love to corner @thatch45 and ask him about the reasoning behind this design
02:26 XenophonF it feels very lisp-like to me
02:27 kshlm joined #salt
02:27 evle joined #salt
02:29 XenophonF so just to get back to your original question, any calls to pillar/mine/whatever in a jinja template get executed at render-time, i.e., on the master, before the minion even has a chance to execute the resulting ordered list of state functions
02:31 mattp_ XenophonF: thanks
02:31 systo joined #salt
02:40 ninjada joined #salt
02:48 ninjada joined #salt
02:55 XenophonF np
02:55 XenophonF hopefully i'm making sense
03:01 mattp_ XenophonF: yep. which unfortunately means what i wanted to do isnt going tow ork
03:02 mattp_ ie, imagine instead of os_family in your grain, youve got a piece of state that you want to alter the workflow for, which is determined by a previous state
03:03 mattp_ a contrived example: imagine a cmd.run state that echos rand() > /tmp/file. have a second state that only runs if /tmp/file > 5. how would you do this?
03:08 cyborg-one joined #salt
03:17 akunin joined #salt
03:29 iggy onlyif
03:30 iggy but what you're really asking for is orchestration
03:30 iggy mattp_: ^
03:39 rvaldes joined #salt
03:52 sp0097 joined #salt
03:53 mattp_ iggy: indeed, but with orchestration how do I do that?
03:54 iggy you run the setup state, and then the action state (or just a highstate)
03:55 mattp_ iggy: not following
03:55 mattp_ iggy: in particular, how is the contents of /tmp/file brought back into the setup state to make an actionable decision?
03:56 sjmh joined #salt
03:56 iggy when you do an orchestrate, there are 2 totally separate state runs made
03:56 iggy so the first one runs and generates the data
03:57 iggy then the second one runs (with it's own state render/compile steps)
03:57 _JZ_ joined #salt
03:58 mattp_ iggy: where is this documented / explained? i dont follow or see it on https://github.com/irtnog/salt-states/tree/development/banners
03:58 iggy why are you reading that?
03:59 mattp_ wtf. that is not what i meant to paste
03:59 mattp_ https://docs.saltstack.com/en/latest/topics/orchestrate/orchestrate_runner.html#orchestrate-runner *
04:01 iggy if you look at the "more complex orchestration" example it does almost exactly what you seem to be trying
04:01 iggy except it's running on multiple groups of hosts, whereas you want to run stuff on the same host(s)
04:02 mattp_ iggy: I dont see how. where is the conditional logic between the orch states happening? that is just one to the next
04:03 mattp_ like, what im trying to do is akin to "only run webserver_setup if bootstrap set flag=web which is indeterministic"
04:03 iggy well, you would just put that in your normal states
04:09 iggy onlyif might be the quickest way to get it working... that is exec'ed at runtime, not at compile time
04:12 mattp_ iggy: i see. im more curious about the *right* way, so i can learn
04:12 mattp_ is it to write a custom state?
04:18 brotatochip joined #salt
04:20 DEger_ joined #salt
04:22 ninjada joined #salt
04:24 ninjada joined #salt
04:55 spine55 joined #salt
05:03 raspado hi all... i have a python module that is called on the minions. How can I have the python module create custom grain locally on the minion itself?
05:03 raspado im doing a grains['fspresent'] = True
05:04 raspado but when i do a grains.item, I dont see the grain present
05:12 edrocks joined #salt
05:20 Vaelatern Okay, the OpenBSD modules are very bad at flavors and specific versions for pkg.installed
05:37 om joined #salt
05:37 raspado joined #salt
05:47 ronrib joined #salt
06:06 amy_ joined #salt
06:07 sjorge joined #salt
06:10 AirOnSkin joined #salt
06:11 cyborg-one joined #salt
06:12 hoonetorg joined #salt
06:21 ttrumm joined #salt
06:30 yuhlw_ joined #salt
06:31 kojiro joined #salt
06:32 jenastar joined #salt
06:44 |aaron joined #salt
06:46 |aaron so ive copied the config for salt.states.zpool.present verbatim from the website, just changed my device names and im still getting an error? 'mirror-0' and 'mirror-1' are invalid argument for 'zpool.present' ?
06:46 |aaron even though they are under a "- layout:" key...
06:54 |aaron lmao needed some extra spaces
06:57 Sammichmaker joined #salt
06:57 Sammichmaker joined #salt
07:00 DEger joined #salt
07:06 babilen |aaron: Does that mean that the examples are wrong?
07:09 |aaron babilen: no they are correct, i just typed them by hand and used 2 spaces instead of 4 in one spot and that messed up the yml format i guess
07:09 babilen Ah, great :)
07:10 babilen fsvo 'verbatim'  :D
07:10 |aaron hahahaha yeah my bad lol
07:10 babilen Would have corrected the documentation if that hadn't been the case
07:10 |aaron false alarm sorry haha
07:11 tellendil joined #salt
07:15 ttrumm joined #salt
07:15 |aaron huhm i must be misunderstand zfs.volume_present though.. trying to use it to create a zvol inside my pool, but i keep getting 'cannot create `my-pool-name`: missing dataset name' but i dont want a dataset
07:16 tellendil Hi, I've got trouble installing a lxc jail with salt. I'm running "salt-cloud -p fedora test16" and this gives me https://paste.fedoraproject.org/422591/14731461/ . Any idea what may go wrong ? I tried entering the jail afterwards and wget the url, and it works
07:17 |aaron derp nevermind just have to specify the name like poolname/volumename
07:20 fracklen joined #salt
07:20 ronnix joined #salt
07:20 ninjada_ joined #salt
07:28 oida joined #salt
07:29 Electron^- joined #salt
07:44 dariusjs joined #salt
07:46 ninjada joined #salt
07:47 Rumbles joined #salt
07:48 om joined #salt
07:56 Electron^- joined #salt
08:06 jhauser joined #salt
08:06 akunin joined #salt
08:11 mefu_ joined #salt
08:13 mefu_ hey yo, in a salt state I create users using salts user module, then I want to get autoassigned subids from /etc/subuid and /etc/subgid and use it in other states, how do I do this?
08:17 keimlink joined #salt
08:18 SubOracle joined #salt
08:19 silver310 joined #salt
08:20 silver310 hello, can I use "watch" with multiple files at different paths?
08:20 krymzon joined #salt
08:25 lero joined #salt
08:25 Electron^- joined #salt
08:26 p4ulie_ joined #salt
08:28 lero joined #salt
08:29 babilen silver310: You always watch states, not files
08:29 babilen You can, however, use globbing for that
08:30 p4ulie_ left #salt
08:30 silver310 what do you mean, i can watch a file for changes and restart a service if it does
08:30 silver310 - watch:       - file: /etc/ntp.conf
08:30 babilen No, you watch the state that manages that file from the state that ensures that the service is running
08:30 bdrung_work joined #salt
08:30 p4ulie joined #salt
08:30 babilen Requisites are between states
08:34 ninkotech joined #salt
08:36 giany joined #salt
08:36 richardl Hi there got a question for you all
08:36 richardl I am working on a for loop to make some files
08:36 richardl they need to have . in there names
08:36 richardl I put the code on this link http://pastebin.com/JUh7rJYf
08:37 richardl My question is how do I get the for loop to work with . in the pathname?
08:38 babilen Please don't use pastebin.com, but a better pastebin such as http://refheap.com, http://paste.debian.net, https://gist.github.com, http://sprunge.us, …
08:38 babilen (merci!!)
08:39 babilen http://paste.debian.net/plain/811264
08:39 richardl https://www.refheap.com/122757
08:41 richardl Okay now I have put the code into one of them, do you know how to fix the . in the path name?
08:42 babilen richardl: You could use _ in your variables and replace it
08:43 richardl babilen: the files I am trying to make are required by a docker box which expects the . in the path name
08:44 babilen "and replace it"
08:44 babilen foo|replace('_', '.')
08:47 Electron^- joined #salt
08:48 richardl okay ty
08:51 babilen richardl: Maybe you can prevent the dot lookup, but I'm not exactly sure how
08:52 Reverend is there any way to rename a salt minion on the first highstate? I'm thinking that it'd be nice to have a generic box which gets a role in the first highstate, and then after that gets everything it needs.
08:53 ninkotech_ joined #salt
08:58 babilen Reverend: Change its minion_id you mean?
08:59 Reverend yarp
08:59 Reverend or would it be best ot make a grain for the role?
09:00 babilen You can use pillars for roles also
09:00 babilen (that way you don't have to manage them on the minions and can trust them)
09:00 Reverend I think a grain would be better, as it's on a single tag... like "webserver" or "elastic"
09:00 Rumbles joined #salt
09:00 babilen Why would it be better?
09:02 richardl Hey Babilen, thank you I got the result working now turns out the line can . in the path it was another error I made before in the state
09:02 babilen richardl: Okay, just paste the actual error next time
09:03 babilen That makes it easier to debug problems
09:03 richardl babilen: still thank you for the help non the less I will take your advice for next time, I also booked marked one of the paste websites you linked
09:04 ninkotech joined #salt
09:05 cyborg-one joined #salt
09:06 babilen richardl: Wonderful! Enjoy your time with salt :)
09:07 Reverend babilen- just because it's a single node of data. Is there really any need to put "role: something" into a pillar? or are you suggesting tha I digest the box information into a role from the pillar, instead of adding a static grain?
09:08 fredvd joined #salt
09:09 babilen Reverend: Why is there a "need" to put it into grains? Pillars allow you to keep that information in a single central location, rather than having to manage it in a distributed (and not trustworthy) manner
09:09 kshlm joined #salt
09:09 Reverend yarp. >_< thanks babilen <3
09:10 babilen I mean .. you can put it in grains. Many people do that, but how would you manage that?
09:10 Reverend _grains
09:11 Reverend I have one in there for my EC2 tags.
09:11 babilen And you want to target based on EC2 tags?
09:12 Reverend I already do. The _grains/ec2-tags.py adds grains on the minions for each EC2 tag as grains[ec2-tags][TAG][VALUE]
09:12 Reverend but that'
09:12 Reverend that's only useful for the 'client' tag, or 'environmenmt'. I guess I could add a
09:12 Reverend 'role' tag to select it in salt.
09:12 Reverend but that seems messy
09:13 babilen Why would that be messy?
09:13 babilen I'd recommend to keep the entirety of those "tags" in a single place and to manage it centrally.
09:14 babilen If that's EC2 tags system then use that ...
09:14 Reverend hmm.
09:15 Reverend I -was- hoping to make the roles -very- static, as currently we've got subnets configured for each role. so I was going to assign the role to each subnet, without any tag management needed.
09:16 Reverend but hey - thanks for the advice, it'd duly noted. I'm gonna have to consult the drawing board again :) <3
09:18 JohnnyRun hi all. Do you know a working pacemaker / corosync formula?
09:18 JohnnyRun this one is empty (https://github.com/saltstack-formulas/pacemaker-corosync-formula)
09:18 Reverend ohhh god. last time I used pacemaker, i was trying it in AWS. never, ever do that. i nearly died.
09:18 JohnnyRun :)
09:19 Reverend also - no, I don't. sorry . :(
09:21 akunin joined #salt
09:21 mikecmpbll joined #salt
09:24 dariusjs joined #salt
09:25 fedor joined #salt
09:26 SpX joined #salt
09:30 Rumbles joined #salt
09:41 SubOracle joined #salt
09:41 toanju joined #salt
09:53 N-Mi joined #salt
09:53 N-Mi joined #salt
10:14 krymzon joined #salt
10:21 keimlink joined #salt
10:29 Reverend question open to the floor: how would you check if a minion is in a certain
10:29 Reverend CIIDR
10:29 Reverend CIDR*
10:29 Reverend (in a pillar)
10:35 ttrumm_ joined #salt
10:40 babilen Reverend: What are you trying to do?
10:40 babilen https://docs.saltstack.com/en/develop/topics/targeting/ipcidr.html might come in handy in pillar targeting
10:49 giany joined #salt
10:51 Reverend thank youuuuu. I've made a nodegroup for the subnets... works a treat.
11:02 DEger joined #salt
11:04 dariusjs joined #salt
11:07 amcorreia joined #salt
11:11 kojiro joined #salt
11:16 omega_ joined #salt
11:16 akunin joined #salt
11:18 rsys joined #salt
11:20 omega_ Hi all
11:21 keimlink joined #salt
11:22 omega_ Is it possible to store in pillar value like: key: {{ value }} and afterwards render it with jinja in state file ?
11:23 omega_ i tried to store in pillar like this
11:24 omega_ key: {{ "{{ value "}}}}
11:24 omega_ in state i did {% set value = 'testvalue' %}
11:25 omega_ without success.
11:25 omega_ Any help ?
11:26 jhauser joined #salt
11:35 cyborg-one joined #salt
11:45 babilen omega_: Could you elaborate a bit more on what you are trying to do and paste your pillar and template to one of http://refheap.com, http://paste.debian.net, https://gist.github.com, http://sprunge.us, … ?
11:46 lero joined #salt
11:54 XenophonF omega_: you can't set a pillar key from a state
11:55 XenophonF omega_: you can use jinja, including the set keyword, in a pillar sls file
11:56 XenophonF omega_: here's a concrete example of using jinja with pillar - https://github.com/irtnog/salt-pillar-example/blob/master/environment/template.sls
11:56 lompik joined #salt
11:56 XenophonF it sets a pillar key named 'environment' based the name of the SLS
11:57 XenophonF so i have for example "environment/production.sls" symlinked to "environment/template.sls", where assigning environment.production to a minion in Pillar's top.sls sets "environment: production" on that minion
11:58 XenophonF by the time we get to rendering and executing states, you would have to access that pillar key the same way as any other, e.g., in Jinja via salt['pillar.get']('environment')
11:58 XenophonF or whatever you've called the Pillar keys on your end
11:59 mavhq joined #salt
12:08 omega_ in few minutes i will paste link to my pillars/states.
12:08 toanju joined #salt
12:09 XenophonF OK
12:10 XenophonF you need to realize that there are different "times" in salt
12:11 XenophonF there's pillar render time, and pillar data load time, and salt state render time, and salt state load time, and salt state execution time
12:11 XenophonF (and in that order)
12:12 XenophonF by the time you get to rendering salt states, the time has passed to render and load pillar data, so you can't change it
12:12 ninjada joined #salt
12:12 kojiro joined #salt
12:14 XenophonF even more complicated is the fact that these times occur in different places
12:14 XenophonF so pillar render time, pillar data load time, salt state render time, and salt state data load time all occur on the master
12:14 XenophonF only salt state execution time happens on the minion
12:18 p4ulie joined #salt
12:23 keimlink joined #salt
12:24 ferbla joined #salt
12:24 ttrumm joined #salt
12:26 omega_ here is my pillar file: http://paste.debian.net/hidden/32e5e934/
12:26 omega_ and state file: http://paste.debian.net/hidden/a9cd437d/
12:27 omega_ and cmd
12:27 omega_ salt minion1 state.apply test-state saltenv=dockerhosts pillar='{'project': 'project1', build: '1324'}'
12:28 omega_ I'am trying to pass {{BUILD_NUMBER}} string to salt state from pillar and the set value to it there.
12:31 babilen You can't reference pillars in pillars unless you use something like pillarstack
12:31 babilen (cf. your pillar line 5 + 6)
12:33 amcorreia joined #salt
12:34 omega_ {{BUILD_NUMBER}} is not a pillar. It's variable name what i want to pass to state and set it there.
12:36 edrocks joined #salt
12:37 om joined #salt
12:37 om joined #salt
12:38 babilen What you've shown is, however, your pillar isn't it?
12:39 om joined #salt
12:39 omega_ here is state.apply output http://paste.debian.net/hidden/fe39e9b3/
12:40 omega_ Expected stdout is : MONGO_URL-mongodb://mongo:mongo@mongodb-server-1324:27017/huyak
12:46 ttrumm joined #salt
12:49 gh34 joined #salt
12:50 kojiro joined #salt
12:52 ninjada joined #salt
12:52 omega_ babilen: Can you rephrase question please ? My english not that good ;)
12:53 omega_ XenophonF: any suggestions ?
12:53 Tanta joined #salt
12:55 babilen omega_: The pillar you reference (http://paste.debian.net/hidden/32e5e934/) has "{{ BUILD_NUMBER " in there .. this is not something that will be replaced
12:56 babilen Please also note that your " is off and in fact not: MONGO_URL: 'mongodb://mongo:mongo@mongodb-server-{{ "{{ BUILD_NUMBER }}" }}:27017/huyak'
12:58 babilen I'm also not sure what the nested {{ }} are for
13:00 omega_ babilen: with {{ "{{ BUILD_NUMBER }}" }} result are same.
13:02 babilen Yes, that is the string you are setting. It is *not* expanded
13:03 omega_ babilen: is it possible to expand it in state ?
13:04 DEger joined #salt
13:05 babilen You don't want to expand in a state, but the pillar values
13:05 babilen For that you need something like pillarstack
13:05 babilen (cf. https://github.com/saltstack/salt/issues/23910
13:05 saltstackbot [#23910][OPEN] Please implement static pillars | Hi,...
13:13 racooper joined #salt
13:15 ninjada joined #salt
13:16 Somv joined #salt
13:17 iamtew left #salt
13:17 XenophonF omega_: let me give a different example
13:18 XenophonF i don't use pillarstack
13:18 XenophonF instead i use jinja templates in pillar for values that need to be shared between keys
13:18 XenophonF https://gist.github.com/xenophonf/1f467b5ee0b890e4bb0387b74e7e646d
13:20 XenophonF that pillar sls includes configuration for two different state formulas, one for mysql and the other for wordpress
13:20 XenophonF i couldn't be bothered to copy/paste the wordpress username and password twice, hence jinja
13:20 Somv Hi, I'm a bit of a noob at this, is there a way for the minion to automatically grab the hostname as the minionID -> sudo sh /tmp/install_salt.sh -A 8.8.8.8 -i (hostname)
13:21 XenophonF Somv: something like this? https://raw.githubusercontent.com/irtnog/salt-states/development/hostname/init.sls
13:22 ttrumm_ joined #salt
13:23 numkem joined #salt
13:25 omega_ XenophonF: I also using jinja template in other pillar. But i want to pass build number from jenkins to my pillar file with environment variables  for my nodejs docker. How can i do this ?
13:26 XenophonF so jenkins (presumably in another state?) reports a build number
13:26 Somv XenophonF: I'm not sure, as I said, im really a beginner, what I did wrong was when I tried to install the minion i did "sudo sh /tmp/install_salt.sh -A 8.8.8.8 -i test123" which resulted in that the master rejected the key, I can add the hostname of the machine and it fixes the minion, but is there an option where the "-i"automatically grabs the hostname and uses it as the minion id
13:26 omega_ XenophonF: only way i found it to pass pillar= to state.apply module. Is where another way ?
13:26 Somv Does that make sense? (probably not)
13:26 XenophonF and you want to use that build number in the current state
13:27 XenophonF i'm going to have to say mine + orchestration
13:27 Reverend joined #salt
13:27 Reverend boo
13:27 XenophonF there's no way to have things that tightly coupled in a highstate run
13:27 XenophonF unless you pass the build number around out of band, like write it to a file, and then pick up the contents of that file later on?
13:29 XenophonF Somv: what's install.sh?
13:29 XenophonF er, i mean install_salt.sh?
13:29 akunin joined #salt
13:29 XenophonF something you wrote?
13:30 XenophonF I mean, by default salt-minion uses the hostname as the minion ID
13:30 XenophonF if you want to override the minion ID, you can set that in the salt-minion configuration file
13:31 drawsmcgraw left #salt
13:32 omega_ XenophonF: Can you point me to docs about mine + orcestration
13:32 omega_ ?
13:33 drawsmcgraw joined #salt
13:33 Somv left #salt
13:40 akunin joined #salt
13:41 tapoxi joined #salt
13:41 nicksloan joined #salt
13:44 ttrumm joined #salt
13:44 dariusjs joined #salt
13:45 feld joined #salt
13:45 feld joined #salt
13:46 babilen XenophonF: Have you used https://docs.saltstack.com/en/latest/ref/states/all/salt.states.environ.html before? I'm not sure I like that approach, but it might enable omega_ to pass information between states
13:46 babilen It really is embarassing that you can't easily pass information between SLSs
13:48 perfectsine joined #salt
13:49 edrocks joined #salt
13:49 tapoxi hi everyone, when I create a VM in salt-cloud it doesn't set the FQDN, only the hostname. thoughts on how to set fqdn?
13:50 tapoxi I can do a cmd.run hostnamectl set-hostname after its up but that's hacky
13:50 babilen Or rather: Output of certain states can't act as input to others easily.
13:52 omega_ babilen: It's not my case. I will try to explain again 8) Let's say in my pillar http://paste.debian.net/hidden/fb03fb1b/ env dictionary is template for my state file. In state file i'am doing {% for key,value in env.items() %}. And i want from jinja to expand all {{something}} strings. But it's not happening.
13:53 defrag joined #salt
13:53 omega_ May be there is special escape chars to do this ?
13:53 babilen Maybe if you render jinja twice?
13:53 Taters_ joined #salt
13:54 Salander27 joined #salt
13:54 babilen https://docs.saltstack.com/en/latest/ref/renderers/#multiple-renderers
13:54 babilen so #!jinja|jinja|yaml
13:57 omega_ babilen: hmm... i'am going to tey this ! Thanks.
13:58 babilen I wouldn't say it's conventional, but if it works? ;)
13:58 babilen omega_: This is under the assumption that you want to define "templates" that are then being filled ..?
13:59 m0ntez quit
13:59 babilen Why don't you define the "template" not directly in states (or in an included one), but in pillars?
14:00 armonge joined #salt
14:01 PerilousApricot joined #salt
14:02 ZachLanich joined #salt
14:05 spine55 joined #salt
14:06 omega_ babilen: #jinja|jinja|yaml is trying to render twice pillar file also. 8((
14:06 omega_ vi inire
14:06 jenastar joined #salt
14:10 babilen omega_: Ah, .. well .. it was an idea
14:11 babilen You might want to write you own state module. It really isn't that hard and would allow you to do all sorts of fancy things: https://docs.saltstack.com/en/latest/ref/states/writing.html
14:13 akitada joined #salt
14:13 babilen (if you know Python that is)
14:16 Salander27 joined #salt
14:20 keimlink joined #salt
14:21 systo joined #salt
14:24 sfxandy joined #salt
14:28 kaptk2 joined #salt
14:30 Peter___ joined #salt
14:30 raspado joined #salt
14:30 Peter___ help
14:30 Peter___ send
14:30 Peter___ ?
14:30 * babilen solved all your problems
14:31 babilen Have a nice day!
14:31 Peter___ hello, trying to download salt via email link
14:31 Peter___ but, when I click on the download link, it does nothing....regardless of browser used.
14:32 Peter___ has anybody here ran into this issue?
14:32 mikecmpb_ joined #salt
14:32 cscf What email link?  Why not download from the site?
14:32 cscf Or repositories?
14:33 shanesveller joined #salt
14:35 Peter___ Here's what I did, and perhaps you have a better way? :-)   I went to www.saltstack.com, and went to the "downloads" page.   When you click "download", it asks you for some information (name, email, etc), then when you're done, it sends you an email with a link to "download".
14:36 Brew joined #salt
14:36 edrocks joined #salt
14:36 ekristen joined #salt
14:36 Peter___ the link eventually looks like this 'https://repo.saltstack.com/index.html"
14:37 Peter___ clicking on it does nothing. <sigh>
14:37 cscf Peter___, yes, that's the download page
14:37 cscf Loads fine for me, and I didn't enter any info
14:37 Peter___ hmmm.....
14:37 cscf Peter___, why not install from your distro's repository?
14:38 cscf Unless you need the latest version
14:38 Peter___ that would be cool, but I'm not sure where to grab the repo.   This is a "git" repo?
14:38 Peter___ sorry, i'm a newbee
14:38 cscf Peter___, no, package repository.  What distro are you running?
14:38 Peter___ rhel/CentOS 6.x and 7.x
14:39 Peter___ thanks cscf :-)
14:40 cscf Peter___, well, the download page is https://repo.saltstack.com/index.html#rhel .  You get a blank page or what?
14:40 Peter___ one second....
14:40 tapoxi Peter___ sudo yum install https://repo.saltstack.com/yum/redhat/salt-repo-latest-1.el7.noarch.rpm
14:41 tapoxi sudo yum install https://repo.saltstack.com/yum/redhat/salt-repo-latest-1.el6.noarch.rpm
14:41 cscf Peter___, if clicking the link in your email client does nothing, just copy/paste it to your browser.
14:42 Rumbles joined #salt
14:43 raspado hi all, i have a python module, can I somehow make a grain on the minion through the module ?
14:43 Peter___ Thank you tapoxi, the yum repo link worked.   To Cscf, what happens is I get a "Saltstack package repo" page graphic with a drop-down selection box that says "2016.3 (latest), and another version
14:43 Peter___ When I click on either, nothing happens....the same screen pops up
14:43 cscf Peter___, no contents appear?
14:44 lilvim joined #salt
14:44 cscf Perhaps you have an old browser version?
14:44 Peter___ no, just the same screen.  This occurs in Firefox, WE, and Chrome
14:44 Peter___ probably right....
14:44 cscf Strange.  Or Adblocker or firewall?
14:44 heaje joined #salt
14:45 Peter___ well, if it's using ports 80 or 443, I should be ok
14:45 Peter___ but, at least I'm ok for now...the yum link seems to work ok :-)
14:45 tapoxi Peter___ should look like this http://i.imgur.com/Sxzft8A.png
14:45 tapoxi if it doesn't I'd probably ping someone who works for salt
14:45 tapoxi so other people dont run into the same issue
14:46 Peter___ hi tapoxi, yes, that is exactly what it looks like.   However, in my case, when you select the version you want....the same image pops up
14:46 tapoxi Peter___ no tabs underneath?
14:47 tapoxi the yum repo link is from the CentOS tab
14:48 Peter___ This is embarrasing.....I now see the links and if I had a brain, I would have followed the instructions.   User Error
14:48 cscf lol
14:48 Peter___ Well, thank you for setting Big Dummy here straight....
14:48 tapoxi hahaha
14:48 tapoxi no problem :)
14:49 Peter___ You guys are very cool and patient.  Thank you, thank you, thank you.
14:50 lero joined #salt
14:51 Peter___ Ok guys, thanks for your help and have a good rest of your week.  I promise to read more closely in the future :-)
14:51 tapoxi no problem! have fun with salt
15:01 systo joined #salt
15:02 Salander27 joined #salt
15:04 pipps joined #salt
15:05 PhoenixNull joined #salt
15:09 tapoxi easy way to debug jinja rendering?
15:10 win_salt tapoxi, have you tried using state.show_sls or .show_highstate
15:11 tapoxi win_salt its pillar data
15:12 tapoxi so I can do pillar.items but I don't know why it rendered the pillar the way it did
15:12 win_salt oh thats what you mean, do you have a bunch of logic in them?
15:12 impi joined #salt
15:15 tapoxi yeah
15:15 mikecmpbll joined #salt
15:15 jholtom you can try loading it into jinja yourself
15:15 jholtom you'd have to build the objects it pses
15:15 jholtom *passes
15:15 jholtom and see what it does there
15:16 jholtom is it like an insane amount of logic, or something pretty manageable?
15:17 tapoxi probably insane
15:17 jholtom well then thats not really an option
15:17 tapoxi hah
15:17 jholtom I dunno of a great way to debug it
15:18 tapoxi is logic in pillar frowned upon?
15:18 jholtom no, I don't think so
15:18 jholtom I try to keep my pillars simple though and any heavy logic dealt with in states
15:19 tapoxi yeah I wish that divide were cleaner
15:19 tapoxi I tend to keep 'configuration' in pillar
15:19 jholtom I assume you mean like addressing, special options and such
15:19 jholtom rather than huge lists of packages
15:20 tapoxi yeah
15:20 jholtom when its huge lists of packages, I tend to break it off into a module or something
15:20 tapoxi like what's the dns configuration for xyz datacenter
15:21 pfc joined #salt
15:22 keimlink joined #salt
15:25 bowhunter joined #salt
15:26 Satyajit joined #salt
15:27 keimlink joined #salt
15:31 sp0097 joined #salt
15:36 bluenemo joined #salt
15:38 pipps joined #salt
15:39 win_salt joined #salt
15:41 fredrick joined #salt
15:42 pipps joined #salt
15:43 pipps joined #salt
15:43 fredrick syndic servers would a good use case for this be different regions  in aws?
15:43 kojiro joined #salt
15:44 DEger joined #salt
15:49 TOoSmOotH joined #salt
15:54 Bryson joined #salt
15:55 cmarzullo could be. if you don't have that many minions might not be worth it.
15:56 fredrick Couple hundred minions in each region, but it is painfully slow on builds outside of the region with the master.
15:57 cmarzullo You could still see issues. Not problems. I have a syndic in asia and it' always the last to respond to the master.
15:58 fredrick But do the minions in asia build from the syndic faster?
15:58 cmarzullo If I'm doing stuff 'live' I'll log into the asia syndic.
15:58 cmarzullo yeah
15:59 cmarzullo but the message bus from the master to the syndic will still be slow. But minion to syndic message bus will be fine.
15:59 cmarzullo at least my experience.
15:59 fredrick So if i use salt-cloud and target sydney servers will they build from the syndic or the master in US?
16:01 cmarzullo Your master will send a message over the message bus to AUS. The AUS will then relay the message to the minions. When the minions return their job status to the syndic, the syndic forwards it back to the master.
16:01 fredrick ok.  Sorry just trying to decide if I want multimaster or syndic
16:01 cmarzullo WRT salt-cloud it probably depends on the cloud provider and stuff.
16:01 cmarzullo no worries.
16:02 DEger joined #salt
16:04 spuder joined #salt
16:05 ageorgop joined #salt
16:06 sjmh joined #salt
16:11 fredrick So my master is setup to build itself.  including all the states etc.  do I build the syndic the same and just load the syndic demon?
16:12 fredrick so I would just include my master.sls in my new syndic state?
16:13 fredrick or just need to install salt master and add the master file with syndic_master in it?
16:18 armguy joined #salt
16:24 edrocks joined #salt
16:25 iggy mattp_: a custom state isn't going to help... it'll have the same restrictions as the existing states (i.e. you're generating data after the render)
16:26 edrocks joined #salt
16:26 M-liberdiko joined #salt
16:29 notnotpe_ joined #salt
16:38 notnotpeter joined #salt
16:43 woodtablet joined #salt
16:45 onlyanegg joined #salt
16:46 PerilousApricot joined #salt
16:46 nidr0x joined #salt
16:52 DEger joined #salt
16:54 fxhp joined #salt
16:58 Ashald Hi guys
16:58 Ashald Did anybody see the error like 'Unable to cache file 'salt://path/to/file.sls' from saltenv 'base'.' ?
16:58 Ashald The file exists on the FS, 100%
16:59 Ashald nobody touches it at all
16:59 Ashald And master was able to use that file yesterday
16:59 Ashald And can now
17:00 brotatochip joined #salt
17:00 scubahubby joined #salt
17:00 DEger joined #salt
17:01 scubahubby First time writing a runner, how do I call an execution module?  Im trying to call slack.post_message.
17:02 jenastar joined #salt
17:04 mikecmpbll joined #salt
17:04 ablemann joined #salt
17:08 pipps joined #salt
17:11 cebreidian joined #salt
17:11 t0m0 joined #salt
17:12 ronnix joined #salt
17:12 erik_ joined #salt
17:13 onlyanegg joined #salt
17:14 iggy Ashald: salt-call cp.list_master | grep file
17:14 Ashald ??
17:14 Ashald I mean, what would it do?
17:14 Ashald Everything is OK right now
17:14 Ashald but sometimes we see that error
17:14 M-MadsRC joined #salt
17:14 freelock[m] joined #salt
17:16 t0m0 joined #salt
17:17 amcorreia joined #salt
17:18 cscf Ashald, I have noticed that if a file is open for writing, salt sometimes won't read it.
17:18 Ashald hm..
17:19 erik_ Can anyone help me with rendering a pillar file in a py rendered file?
17:20 cyborg-one joined #salt
17:21 jfindlay Edgan: did you get your question answered?
17:21 DEger joined #salt
17:22 toastedpenguin joined #salt
17:23 fxhp_ joined #salt
17:24 ageorgop joined #salt
17:26 Edgan jfindlay: yeah, I figured it out on my own. Ended up being restart the service after an update, but expected salt had already restarted itself.
17:26 Edgan jfindlay: I know it is unofficial, but loving 2016.9
17:27 toastedpenguin any windows users provide example/recommendation on how to add/check for IIS on a 2012 server after salt-cloud deployment?
17:27 Edgan jfindlay: It includes all the patches/fixes I need, including one pull request I created that was merged last week.
17:28 ronnix joined #salt
17:29 onlyanegg joined #salt
17:29 jfindlay Edgan: nice
17:30 jfindlay good things to hear
17:30 whytewolf scubahubby: check out this runner coming in the next release for ideas https://github.com/saltstack/salt/blob/develop/salt/runners/salt.py
17:31 subahubby joined #salt
17:31 subahubby First time writing a runner, how do I call an execution module?  Im trying to call slack.post_message.
17:33 DammitJim joined #salt
17:43 pipps joined #salt
17:44 subahubby would this be more appropriate on #salt-devel?
17:46 subahubby #salt-devel
17:47 Scubahubby joined #salt
17:51 DEger joined #salt
17:52 tuxx joined #salt
17:54 ZachLanich joined #salt
17:56 bltmiller joined #salt
17:57 ablemann joined #salt
17:58 ageorgop joined #salt
18:01 DammitJim joined #salt
18:01 iggy subahubby: you run modules/states on minions
18:02 iggy so you use the localclient and target the module at a client
18:03 GreatSnoopy joined #salt
18:03 DEger joined #salt
18:06 Fiber^ joined #salt
18:08 scubahubby joined #salt
18:08 Scubahubby_ joined #salt
18:11 DEger joined #salt
18:13 jimklo joined #salt
18:13 Salander27 joined #salt
18:14 Rumbles joined #salt
18:18 cprior joined #salt
18:22 fracklen joined #salt
18:24 Gareth anyone actively using Salt syndic?
18:26 edrocks joined #salt
18:31 pipps joined #salt
18:43 fullstop joined #salt
18:43 fullstop Hi all.  looking at https://docs.saltstack.com/en/latest/ref/states/all/salt.states.pkgrepo.html
18:43 fullstop how do I actually make it do this?  I see it in the pillar.items
18:44 fullstop but how do I get it to actually apply that?
18:47 iggy fullstop: what does states.pkgrepo have to do with pillar.items?
18:47 iggy (i.e. I think you're missing part of your problem description)
18:47 fullstop iggy: perhaps a bad assumption on my part.
18:48 Rumbles joined #salt
18:48 fullstop but it looked like, in the example, with it being "base:" that it belonged in the pillar configuration.
18:48 iggy no
18:48 iggy I mean that's unfortunate naming, but base is also used in states
18:49 iggy but that isn't related to either one of those
18:49 fracklen joined #salt
18:49 _JZ_ joined #salt
18:49 fullstop I understand
18:49 fullstop let me move it over
18:50 fullstop appears to be working
18:50 DEger joined #salt
18:50 fullstop I wanted a state for esl-erlang
18:51 tehsu Is it possible to to run a pillar.get with a variable that gets looped?
18:51 iggy nope
18:55 pipps joined #salt
18:56 tehsu thx
18:58 hasues joined #salt
18:58 hasues left #salt
18:58 cprior proxy minions: When I follow https://docs.saltstack.com/en/latest/topics/proxyminion/index.html and import logging;      ]
18:58 brotatochip joined #salt
18:59 cprior log = logging.getLogger(__file__), in which files does this end up?
19:02 iggy I think /var/log/salt/minion
19:02 rideh joined #salt
19:02 iggy but it'll be somewhere in /var/log/salt/
19:02 iggy shouldn't be hard to find
19:03 jimklo joined #salt
19:03 DEger joined #salt
19:05 cprior Ahh, it is in /var/log/salt/proxy. It seems that I restart'ed salt-master and salt-minion after I made changes to the logging. But it needs a "killall salt-proxy" or such
19:11 Pulp joined #salt
19:18 Salander27 joined #salt
19:19 jimklo_ joined #salt
19:19 keimlink joined #salt
19:19 UtahDave joined #salt
19:20 fredrick tehsu: what are you trying to loop?  would a for loop work?
19:21 pipps joined #salt
19:21 tehsu using a for loop, trying to get pillar data but one the values is part of the loop
19:22 tehsu {{ salt['pillar.get']('test1:{{ loop_value }}:test3') }}
19:22 tehsu trying to do this
19:22 GreatSnoopy joined #salt
19:23 whytewolf {{ salt['pillar.get']('test1:' ~ loop_value ~ ':test3') }}
19:23 tehsu thanks
19:23 tehsu trying it now
19:24 fredrick what whytewolf said.
19:24 babilen You only ever need one level of {{ ... }}
19:25 tehsu thank you guys, it worked :)
19:26 whytewolf {{ var }} is a shortcut for {% echo var %} so if it doesn't make sense to put {% echo var %} in a place then {{ var }} doens't either
19:26 tehsu yeah, makes sense now, cant do it twice
19:26 tehsu first time already does it
19:31 alwaysatthenoc joined #salt
19:31 toanju joined #salt
19:32 sfxandy joined #salt
19:38 mswart joined #salt
19:41 digitalflaunt joined #salt
19:42 teryx510 joined #salt
19:45 DEger joined #salt
19:51 brotatochip joined #salt
19:53 StolenToast how does the minion handle when a unit has changed and requires "daemon-reload" to restart?
19:53 StolenToast does it do the reload and then start the unit?
19:55 StolenToast daemon-reload is a feature of systemd, btw, running salt with centOS 7
19:59 StolenToast and a unit is just a service, in case anyone isn't familiar
19:59 nkuttler StolenToast: you configure that in your state
19:59 nkuttler restart when config changes etc
20:00 StolenToast I mean with modules instead of state, so like <target> service.restart <service>
20:00 StolenToast sounds like it won't do that, though, so I'll just do it by hand
20:00 voileux_ joined #salt
20:05 FroMaster joined #salt
20:06 misconfig joined #salt
20:06 ageorgop joined #salt
20:17 LostSoul joined #salt
20:19 tkharju joined #salt
20:22 LostSoul joined #salt
20:24 pipps joined #salt
20:24 LostSoul joined #salt
20:29 misconfig joined #salt
20:33 lero joined #salt
20:39 k_ joined #salt
20:40 edrocks joined #salt
20:43 brotatochip joined #salt
20:58 tapoxi joined #salt
21:02 raspado hi all
21:02 raspado is there someone who can help me out with a python module? trying to figure out how to set a grain
21:03 pipps joined #salt
21:14 raspado or is there a way to set a local grain on the minion through a python module?
21:15 tellendil joined #salt
21:15 tellendil Hi ! Question about installing salt. Is there a way on fedora to get salt 2016 ? the version in the repo is 2015.05 which is quite outdated
21:16 UtahDave raspado: just a straight python module or a python execution module within Salt?
21:17 UtahDave tellendil: have you tried the bootstrap script?
21:18 tellendil UtahDave: it installs from the official repo
21:18 UtahDave have you tried a git install using the v2016.3.3  tag?
21:20 tellendil UtahDave: no I did not, would that be an install through a package or not ?
21:21 filippos joined #salt
21:21 UtahDave It will install the deps from packages and Salt from git. all automatically.  I think our packager has been working through some changes that fedora has made that caused the delay in packages.
21:21 UtahDave curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com
21:21 UtahDave sudo sh bootstrap_salt.sh git v2016.3.3
21:23 raspado UtahDave: http://pastebin.com/Lnsz02AA take a peek at the else statement. I've got a backup.py script and everything is ok but im now trying to have that script create a grain so I can key off of it in another definition
21:24 tellendil UtahDave: ok thanks I'll try this in a minute. I managed to install it through the redhat 7 repo otherwise and it *seems* to work
21:24 UtahDave tellendil: cool
21:24 raspado UtahDave: forgot to add, my backup.py script is in _modules/
21:25 raspado when I run a salt-call grains.list, I dont see zfspresent
21:25 UtahDave raspado: try  __salt__['grain.set']('zfspresent', True)
21:25 raspado ahhhh ok ok
21:25 UtahDave you can't do it like you have it in your example
21:25 UtahDave https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.grains.html#salt.modules.grains.set
21:25 raspado niceeee thx UtahDave!
21:26 UtahDave you're welcome!
21:28 mschiff_ can anyone confirm, that cp.push ist working in version 2016.3.3 ?
21:32 nsidhu joined #salt
21:34 tellendil UtahDave: the way through git does a pip install sadly :/
21:35 tellendil I'll have to use the rhel one for a bit I guess. anyways thanks for your help !
21:36 nsidhu joined #salt
21:36 UtahDave mschiff_: I noticed this came in yesterday:  https://github.com/saltstack/salt/issues/36060
21:36 saltstackbot [#36060][OPEN] cp.push_dir and cp.push fail | Description of Issue/Question...
21:36 UtahDave tellendil: you're welcome
21:38 mschiff_ UtahDave: Thanks, maybe cp.push is really broken in this release :-/
21:45 nsidhu HexChat: 2.10.2 ** OS: Linux 4.4.0-36-generic x86_64 ** Distro: Ubuntu "xenial" 16.04 ** CPU: 4 x Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz (GenuineIntel) @ 1.12GHz ** RAM: Physical: 7.7GiB, 33.9% free ** Disk: Total: 331.2GiB, 57.6% free ** VGA: NVIDIA Corporation GK208 [GeForce GT 630 Rev. 2] ** Sound: HDA-Intel - HDA Intel HDMI1: HDA-Intel - HDA Intel PCH2: HDA-Intel - HDA NVidia3: USB-Audio - Logitech USB Headset **
21:45 nsidhu Ethernet: Intel Corporation Ethernet Connection I217-LM ** Uptime: 4d 16h 36m 0s **
21:46 nsidhu oops.... wrong menu item ....
21:46 k_ joined #salt
21:50 lero joined #salt
21:52 toastedpenguin joined #salt
21:58 k_ joined #salt
21:59 raspado okay... this one is tough, is there a way to get the exit status code of a command that is ran from a python module? im using "cmd = __salt__['cmd.run'](create_fs)"
22:00 raspado trying to do something like if cmd.status_code == 1, do something
22:02 UtahDave raspado: there are several functions in the cmd module that provide the status code :  https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cmdmod.html#module-salt.modules.cmdmod
22:02 UtahDave raspado: https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cmdmod.html#salt.modules.cmdmod.run_all   gives you basically everything
22:03 raspado UtahDave: excellence, thx again
22:04 raspado nice cmd.retcode will work
22:05 pipps joined #salt
22:06 brotatochip joined #salt
22:18 pipps joined #salt
22:26 ninjada joined #salt
22:28 tehsu can returners be used on the master instead of each minion, looks like it should be placed in the minion config
22:30 nicksloan joined #salt
22:36 ninjada joined #salt
22:37 ageorgop joined #salt
22:43 jnials_ joined #salt
22:46 ninjada joined #salt
22:46 fxhp_ joined #salt
22:54 ninjada joined #salt
23:01 ageorgop1 joined #salt
23:03 edrocks joined #salt
23:03 brotatochip joined #salt
23:04 marie1972 joined #salt
23:16 ninjada joined #salt
23:17 Pulp joined #salt
23:19 keimlink joined #salt
23:22 keimlink joined #salt
23:23 keimlink_ joined #salt
23:25 marie1972 left #salt
23:29 pipps joined #salt
23:31 pipps joined #salt
23:37 mikecmpbll joined #salt
23:39 ZachLanich joined #salt
23:42 smcquay joined #salt
23:46 smcquay joined #salt
23:49 pipps99 joined #salt
23:52 Edgan jfindlay: Having to downgrade to 2016.3.3 from 2016.9. Found a bug in the gitfs code. :(
23:56 ninjada joined #salt

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