Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-01-20

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

All times shown according to UTC.

Time Nick Message
00:04 ronnix joined #salt
00:05 pipps99 joined #salt
00:08 sfxandy joined #salt
00:09 pipps joined #salt
00:11 prg3 joined #salt
00:15 dxiri joined #salt
00:16 ronnix joined #salt
00:20 pipps joined #salt
00:20 spuder joined #salt
00:28 dxiri_ joined #salt
00:45 druonysus__ joined #salt
00:46 debian112 joined #salt
01:08 debian112 joined #salt
01:10 Neighbour joined #salt
01:14 dxiri joined #salt
01:17 mvensky joined #salt
01:26 mvensky joined #salt
01:26 wezaui joined #salt
01:30 mvensky joined #salt
01:32 debian112 joined #salt
01:36 ronnix joined #salt
01:37 spuder joined #salt
01:49 ronnix joined #salt
01:55 amontalban joined #salt
01:55 wombawomba joined #salt
01:56 nZac joined #salt
02:00 spuder joined #salt
02:01 debian112 joined #salt
02:03 nickabbey joined #salt
02:13 prg3 joined #salt
02:25 debian112 joined #salt
02:28 beardedeagle joined #salt
02:28 lorengordon joined #salt
02:33 om2 joined #salt
02:35 rawzone joined #salt
02:41 rawzone joined #salt
02:43 gableroux joined #salt
02:46 rawzone joined #salt
02:47 catpiggest joined #salt
02:48 debian112 joined #salt
02:55 Yamazaki-kun joined #salt
03:08 debian112 joined #salt
03:16 mavhq joined #salt
03:27 blu__ joined #salt
03:33 om2 joined #salt
03:33 debian112 joined #salt
03:43 Nahual joined #salt
03:48 hrumph joined #salt
03:48 hrumph hi
03:49 hrumph what's the best approach to error handling in modules?
03:49 hrumph right now i'm just throwing in exceptions in a module i wrote but i'll catch them in the accompanying state module. is that acceptable?
03:49 hrumph btw i'll probably do a pull request for the module if i decide that it's good enough
03:54 debian112 joined #salt
03:56 stooj joined #salt
04:00 amontalban joined #salt
04:00 amontalban joined #salt
04:03 onlyanegg joined #salt
04:03 iggy hrumph: that seems to be one of the standards...
04:07 hrumph anyway folks it's a run-module/state module for installing windows printers
04:08 hrumph in the state module you can specify a driver along with an ipp printer like (https://my.org/myprinter), and have them both install
04:08 hrumph this is a good way to avoid smb shares for printers and still get the same functionality
04:09 hrumph ipp afaik still doesn't support inclusion of drivers in the protocol
04:09 hrumph but smb isn't a real print protocol
04:09 hrumph so with salt it's win win
04:10 hrumph anyway i guses it would be better if i just finished instead of yakked about it
04:10 qman__ joined #salt
04:11 iggy sounds pretty useful
04:11 hrumph when i say "in the state module" i actually haven't even started it yet
04:11 hrumph but i've got the run module where i want it
04:11 hrumph so they state module is just icing on the cake
04:11 iggy so often, the salt bits seem very focused toward managing an application stack on some servers
04:12 hrumph iggy, and i'd personally like to see less of that focus
04:12 hrumph more focus on just being a general management system for any computer
04:13 hrumph but i suppose that might interfere with bread an butter issues
04:14 Tanta it's extensible
04:14 Tanta I use Salt for management in ways that are sort of deranged and weird
04:17 debian112 joined #salt
04:29 KingJ joined #salt
04:31 dxiri joined #salt
04:40 antpa joined #salt
04:44 wombawomba joined #salt
04:45 debian112 joined #salt
04:47 impi joined #salt
04:53 gnomethrower joined #salt
04:54 gnomethrower Hi guys
04:54 gnomethrower Having some trouble with an SLS
04:54 antpa joined #salt
04:54 gnomethrower I'm wanting to remove nginx, but only if it's installed
04:54 gnomethrower This is what I have so far: http://pastebin.ca/3758668
04:54 gnomethrower mostly just playing around right now
04:55 gnomethrower error is Comment: Recursive requisite found
04:55 gnomethrower which is fair enough as that's exactly what's happening. I just don't know the right way to do what I'm trying to do.
05:01 telx joined #salt
05:15 debian112 joined #salt
05:20 rdas joined #salt
05:26 rdas joined #salt
05:30 armyriad joined #salt
05:33 gnomethrower actually the more I play the more i think it's a bug
05:33 gnomethrower https://github.com/saltstack/salt/issues/38838
05:33 saltstackbot [#38838][OPEN] Failing to remove nginx | Description of Issue/Question...
05:36 armyriad joined #salt
05:36 telx joined #salt
05:40 cyraxjoe joined #salt
05:46 preludedrew joined #salt
05:53 whytewolf gnomethrower: the require isn't needed. it will uninstall it if it is there other wise it shouldn't. but you are right. that does sounds like a bug. unforchantly it might be a bug with the way apt-get is removing nginx. or a bug in the package.
05:55 gnomethrower whytewolf: yep, i came to that conclusion
05:55 gnomethrower (not needing require)
05:55 gnomethrower and simplified things substantially
05:55 gnomethrower but as reported in the bug, nginx doesn't seem to cleanly uninstall at the moment
05:55 gnomethrower even doing it "the right way"
05:55 gnomethrower whereas testing with various other packages works correctly and as intended.
05:56 antpa joined #salt
05:56 whytewolf exactly what i just said. but that might not be a salt bug. it might be a ubuntu bug with that package. if only nginx is doing it
05:56 gnomethrower whytewolf: sorry, not meaning to repeat what you said
05:57 gnomethrower and yeah, that might be the case... will wait to see what Salt devs say since they can probably figure out whether it's a ubuntu packaging bug
05:59 debian112 joined #salt
06:02 amontalban joined #salt
06:02 amontalban joined #salt
06:15 teclator joined #salt
06:19 DEger joined #salt
06:20 debian112 joined #salt
06:43 ecdhe joined #salt
06:50 zer0def joined #salt
06:52 nethershaw joined #salt
06:57 stooj joined #salt
07:03 amontalban joined #salt
07:03 amontalban joined #salt
07:09 rawzone^ joined #salt
07:14 debian112 joined #salt
07:15 dendazen joined #salt
07:16 rawzone joined #salt
07:16 bocaneri joined #salt
07:27 nidr0x joined #salt
07:38 darioleidi joined #salt
07:40 ReV013 joined #salt
07:41 debian112 joined #salt
07:42 Zaunei_ joined #salt
07:44 sknebel_ joined #salt
07:46 mschiff_ joined #salt
07:47 impi joined #salt
07:47 Hazelesque_ joined #salt
07:47 Ashald_ joined #salt
07:48 Armadill0 joined #salt
07:48 tongpu_ joined #salt
07:49 onovy_ joined #salt
07:50 rodr1c_ joined #salt
07:50 rideh- joined #salt
07:50 coldbrew- joined #salt
07:51 coldbrewedbrew joined #salt
07:51 coldbrewedbrew joined #salt
07:52 AbyssOne joined #salt
07:52 guerby joined #salt
07:53 TRManderson joined #salt
07:53 Jarus_ joined #salt
08:01 skeezix-hf joined #salt
08:02 ReV013 joined #salt
08:02 DEger joined #salt
08:03 rawzone^ joined #salt
08:05 Dev0n joined #salt
08:06 om2 joined #salt
08:07 cacasmacas joined #salt
08:08 Straphka joined #salt
08:13 hexa- joined #salt
08:20 mikecmpbll joined #salt
08:26 ivanjaros3916 joined #salt
08:32 wangofett joined #salt
08:32 cswang joined #salt
08:32 j4son joined #salt
08:36 Sammichmaker joined #salt
08:40 samodid joined #salt
08:51 auzty joined #salt
08:57 mikecmpbll joined #salt
09:05 berto- joined #salt
09:05 amontalban joined #salt
09:05 amontalban joined #salt
09:13 pppingme joined #salt
09:14 s_kunk joined #salt
09:16 dariusjs joined #salt
09:17 sfxandy joined #salt
09:18 evle joined #salt
09:23 DEger joined #salt
09:30 praveen joined #salt
09:30 praveen hi all
09:30 praveen i need to get all salt-minion inventory details using salt master
09:31 babilen Assuming you mean its grains: salt 'yourminion' grains.items
09:31 dijit salt '*' grains.items
09:31 ts3pot joined #salt
09:31 dijit haha
09:37 praveen joined #salt
09:37 praveen how to get a grain details from minions like hostname, ip address only
09:38 sh123124213 joined #salt
09:38 necronian joined #salt
09:39 eseyman praveen: salt '<the-minion>' grains.get ip4_interfaces
09:40 ravenx joined #salt
09:40 ravenx anyone have an idea to solve my problem:
09:40 ravenx it is quite simple, i have a repo of my code which contains a configuration template,
09:40 ravenx it essentially contains a bunch of:
09:41 ravenx asdf_key= {{ pillar['app-name']['key_value'] }}
09:41 ravenx and the pillar data is stored in /srv/pillar/app-name/init.sls  as things like key_value: foobar
09:42 ravenx problem now is that, whenever i want to add the key value, i have to update the code repo, which has the config template, AND the /srv/pillar/app-name repo
09:42 ravenx is there anyway to do this with only one repository, without using git as an external pillar
09:43 praveen how to get multiple system defined variables using grains i tried , which is not working
09:44 AndreasLutro ravenx: {% for key, val in pillar.app_name.config.items() %}{{ key }}={{ val }}{% endfor %}
09:44 AndreasLutro that would remove duplication at least
09:44 praveen tried salt '*' grains.get ip4_interfaces, fqdn
09:46 praveen is there any option writing state file to get minions system varibles like ip, hostname etc.,
09:46 babilen praveen: For ip addresses, I'd recommend network.ip_addrs
09:47 babilen praveen: You can reference grains in SLS with {{ grains['foo'] }} for grains of the minion you are executing the state on
09:48 babilen Are you interested in getting grains of *other* minions?
09:48 babilen Or rather: What are you trying to do?
09:49 ravenx AndreasLutro: thanks
09:49 praveen yes, i would like to get all system variables like ip, hostname etc., for all minions
09:49 babilen praveen: Where and whatfor?
09:50 babilen https://docs.saltstack.com/en/latest/topics/mine/ is what you'd use, but feel free to provide additional information
09:50 praveen from salt minions i want to get grains details not all only few things.
09:51 babilen And what is it you plan to do with those details?
09:53 impi joined #salt
09:54 praveen me plan to import all minion values to store it in db and getting into front end by using php.
10:05 sgo_ joined #salt
10:08 fredvd joined #salt
10:08 Reverend joined #salt
10:10 inad922 joined #salt
10:13 jhauser_ joined #salt
10:14 JohnnyRun joined #salt
10:16 Kelsar wouldn't it be easier to query the salt api on the master?
10:16 teclator_ joined #salt
10:24 daxroc Morning folks
10:25 daxroc I'm attempting to disable selinux with selinux.mode state, The state fails but if I execute it via the salt-call works ok.
10:26 daxroc https://www.irccloud.com/pastebin/4zchhXyi/
10:31 gaghiel joined #salt
10:37 sfxandy what is the error daxroc ?
10:37 sfxandy i usually set it to permissive
10:38 daxroc I can set it to permissive but disabled only breaks - no error just one failed state
10:39 sfxandy setting it to disabled requires a reboot, i think...
10:39 sfxandy and does it say why the state fails?
10:40 daxroc Reboot is fine, but the state should report OK  no?
10:40 daxroc https://www.irccloud.com/pastebin/WZT0WbIr/
10:42 sfxandy and you can all the setenforce module and pass disabled and it works?
10:42 moeyebus9 daxroc, the doc says: "name = The mode to run SELinux in, permissive or enforcing"
10:43 sfxandy what version of Salt?
10:47 sfxandy ok so the source code (for the latest version at least) is quite specific daxroc.  it calls the setenforce function and checks the new mode against the desired mode and gives you the errorr you are seeing if the modes do not match
10:50 yuhl___ joined #salt
10:55 dariusjs joined #salt
11:00 ronnix joined #salt
11:00 yuhl___ left #salt
11:01 yuhl___ joined #salt
11:01 debian112 joined #salt
11:03 cuxtud joined #salt
11:07 amontalban joined #salt
11:07 amontalban joined #salt
11:10 ravenx what's the best ways to pass data into salt, not so much pillar, but "flags"
11:11 ravenx in a sense, i want my formulas to run:  './superprogram'   but if i pass it a flag, i want the same formula to run './superprogram --restart'
11:11 ravenx i know i can do it with some jinja logic.
11:11 ravenx but how can i do it with the salt command by passing in the flag:    salt 'server' state.sls superprogram  <--restart>  ?
11:11 ravenx basically on the command line i would like to let my superprogram formula know, that it should include the --restart flag
11:12 JohnnyRun joined #salt
11:16 teclator joined #salt
11:17 Reverend ooo that is interesting
11:18 Reverend I would assume that the option would be interpreted by the 'salt' command and not `superprogram`
11:18 AndreasLutro ravenx: passing pillars on the cli are the only way afaik
11:19 amontalban joined #salt
11:19 amontalban joined #salt
11:21 ravenx :(
11:21 ronnix_ joined #salt
11:21 AndreasLutro s/are/is/
11:22 Reverend I wonder if you could bundle it all together in a single state inside your sls though ravenx
11:22 Reverend so you can call `superprogram.restart`
11:22 ronnix__ joined #salt
11:22 Reverend AndreasLutro - am i right in thinking that's how you call them?
11:23 AndreasLutro no idea, I disagree with the idea of passing arguments to a state.apply call at all
11:23 AndreasLutro states describe the state a system should be in and how to get to that state, you shouldn't treat them like bash scripts
11:23 Reverend true
11:23 Reverend abuse cmd.run
11:23 Reverend that's what i say
11:24 Reverend cmd.run is the biggest mistake saltstack ever made :P haha. "wait, i know the command, i don't need to learn anything, I'll just run it as a command"
11:26 peters-tx joined #salt
11:27 AndreasLutro shrug, lots of things I do can't be achieved without cmd.run
11:27 dariusjs joined #salt
11:30 Reverend I'm just exagerating for comedic effect. I agree. I just have a funny feeling that a lot of people skirt around things by just using that instead.
11:36 debian112 joined #salt
11:37 sgo_ joined #salt
11:46 sh123124213 joined #salt
11:47 dendazen joined #salt
11:58 teclator joined #salt
12:00 evle joined #salt
12:01 wombawomba joined #salt
12:05 ruxu joined #salt
12:10 alvinstarr joined #salt
12:14 amcorreia joined #salt
12:16 cuxtud testing salt-api. when I check the status of salt-api service it is running but displays a few more info http://paste2.org/IkVG3BK1 Is this alright?
12:17 ReV013 joined #salt
12:24 cuxtud I am using rest_cherrypy. master config has these lines http://paste2.org/0WCUwbID . In /etc/salt/master.d I have 2 files salt-api.conf and reactor.conf - contents : http://paste2.org/nesmtnxa
12:24 sgo_ joined #salt
12:26 cuxtud when I do a curl, it doesn't go any further after accepting the post values : http://paste2.org/NYN6EAta
12:26 _Cyclone_ joined #salt
12:28 morissette joined #salt
12:34 tiwula joined #salt
12:42 teclator joined #salt
12:51 jeddi joined #salt
12:56 ReV013 joined #salt
13:03 jschoolcraft joined #salt
13:10 dariusjs joined #salt
13:10 spuder joined #salt
13:22 tiwula joined #salt
13:24 eThaD joined #salt
13:29 darioleidi joined #salt
13:30 darioleidi joined #salt
13:30 lasseknudsen2 joined #salt
13:31 jschoolcraft joined #salt
13:31 ronnix joined #salt
13:33 impi joined #salt
13:33 daxroc moeyebus9: selinux.mode disabled is also a valid state, it's mentioned in the state documentation.
13:33 daxroc My interpretation here would be that if it successfully sets the disabled flag - while it still requires a reboot it should be marked as successful no? as it is it will fail every time until the reboot
13:34 numkem joined #salt
13:34 daxroc *upon reboot it is disabled
13:35 lasseknudsen joined #salt
13:36 daxroc Can you suppress the errors on a state like this ?
13:36 Pulp joined #salt
13:38 ReV013 joined #salt
13:47 dendazen joined #salt
13:51 DEger joined #salt
13:53 debian112 joined #salt
13:55 Brew joined #salt
13:56 rsanting joined #salt
13:56 rsanting left #salt
13:59 godlike joined #salt
13:59 godlike joined #salt
14:00 spuder joined #salt
14:02 ssplatt joined #salt
14:02 Miq joined #salt
14:02 Miq Hello
14:03 Miq Could anyone help me with salt.states.saltmod.runner
14:03 Miq I have a custom runner that works with salt-run
14:03 Miq but when called from sls with salt.runner i get a stacktrace
14:03 Miq File "/usr/lib/python2.7/site-packages/salt/utils/lazy.py", line 101, in __getitem__                   raise KeyError(key)
14:11 cuxtud Miq: What is the service status of master
14:12 tiwula joined #salt
14:12 Miq you mean is it running?
14:12 Miq it is
14:13 Miq other commands work fine
14:13 Miq https://gist.github.com/anonymous/c7710af559baa768af0f40fd73772271
14:16 beardedeagle joined #salt
14:16 debian112 joined #salt
14:16 squishypebble joined #salt
14:20 APIexpert joined #salt
14:30 eThaD joined #salt
14:31 ssplatt i don’t like that i keep getting “Warnings: 'read', 'write', 'user' and 'conf' are invalid keyword arguments” for “ Function: rabbitmq_vhost.present”
14:31 ssplatt when the docs clearly say to use those things
14:33 ssplatt a la https://docs.saltstack.com/en/latest/ref/states/all/salt.states.rabbitmq_vhost.html#salt.states.rabbitmq_vhost.present
14:34 XenophonF ssplatt: are you sure the version of the docs matches the version of salt you're running?
14:35 XenophonF (i've run into that problem more than a few times myself, which is why i ask)
14:35 beardedeagle The code for that state hasn't changed in a year, but it has depreciated for ALL of those
14:35 ssplatt Unpacking salt-common (2016.11.1+ds-1) ...
14:36 beardedeagle deprecated:: 2015.8.0
14:36 ssplatt the development docs still say teh same options
14:36 inad922 joined #salt
14:36 ssplatt i thought the salt docs were getting better....
14:37 beardedeagle The salt docs are great for beginners
14:37 XenophonF here's your chance to submit a PR that fixes a doc bug!
14:37 beardedeagle anything more than that, then you need to go to the code
14:37 ssplatt as if i have time for that
14:37 dendazen joined #salt
14:38 ssplatt i will open an issue in github if there isn’t one already
14:39 ssplatt https://github.com/saltstack/salt/issues/27857  that looks to be about the same
14:39 saltstackbot [#27857][OPEN] Deprecated rabbitmq_vhost functionality conversion steps need to be explained | With the deprecation of https://docs.saltstack.com/en/latest/ref/states/all/salt.states.rabbitmq_vhost.html and the creation of the following items:...
14:39 beardedeagle Just looked at the docs
14:39 beardedeagle it says depreciated in the docs
14:40 ssplatt s/depreciated/deprecated/
14:40 beardedeagle though...it is past being depreciated and fully removed at this point
14:40 beardedeagle yeah
14:40 beardedeagle sorry
14:40 ssplatt heh didn’t mean to grammar nazi but that’s another pet peeve of mine
14:41 beardedeagle it's still really early for me and I haven't had my caffeine drip hooked up to me yet
14:41 wombawomba joined #salt
14:43 ssplatt i guess _user.present:  - perms:  is what i want to replace the vhost part with
14:43 dariusjs joined #salt
14:43 racooper joined #salt
14:45 JohnnyRun hi all. It is possible temporary disable all "service.*" declarations in the state?
14:45 ssplatt put a toggle around them
14:46 edrocks joined #salt
14:46 beardedeagle Maybe I don't understand the question, but :https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.state.html#salt.modules.state.disable
14:46 ssplatt {% if mything.manage_services %}  service defs  {% else %} test.succeed_without_changes {% endif %}
14:47 JohnnyRun I need to build a docker image using salt in the Dockerfile and service does not work due to no init inside container
14:47 ssplatt could probably do a grains.env == docker depending on what the grains look like, as the toggle
14:47 JohnnyRun all the formula use service.* and I would like to ignore all
14:48 JohnnyRun ssplatt, I can't modify all formulas
14:48 beardedeagle Formulas usually follow what ssplatt said, where you have a pillar or default value of service = False|True
14:49 beardedeagle Which then if
14:49 beardedeagle which then if's around that block
14:50 JohnnyRun mhmhm. never seen.. I have a look
14:50 ssplatt JohnnyRun: it sounds like the formulas you’re using don’t work for you so you either need to fork them or not use them
14:51 beardedeagle JohnnyRun: https://github.com/saltstack-formulas/consul-formula/blob/master/pillar.example#L3
14:51 ssplatt or write your own from scratch
14:51 daxroc is there a better way to achieve this?
14:51 beardedeagle https://github.com/saltstack-formulas/consul-formula/blob/master/consul/service.sls#L19-L28
14:51 daxroc https://www.irccloud.com/pastebin/lXxcrobU/
14:51 beardedeagle JohnnyRun: that is an example of how to accomplish what ssplatt pointed out
14:52 ssplatt https://github.com/ssplatt/infratest-formula/blob/master/infratest/init.sls#L6  is an example that my team puts in all of our formulas
14:52 _Cyclone_ joined #salt
14:52 ssplatt two keys to launch. is the idea.
14:54 JohnnyRun beardedeagle, ssplatt : understood. I was hoping for something like "salt.modules.state.disable", but probably there is no way....
14:54 beardedeagle JohnnyRun: I believe I posted that above
14:54 beardedeagle ah, you mean that doesn't work for your needs
14:55 JohnnyRun exactly
14:55 ssplatt we do a lot of if thing.service is defined too
14:55 ssplatt so if the pillar isn’t even there, then it skips a block
14:55 beardedeagle ssplatt: I may or may not steal some of this formula from you, I am setting up kitchen-salt and testinfra right now on my jenkins servers
14:58 PatrolDoom joined #salt
14:58 beardedeagle I am actually using my formula pillars to define my testinfra tests as well. still haven't decided if it is a good or bad idea.
15:01 beardedeagle daxroc: why not manage that file instead?
15:02 gableroux joined #salt
15:02 mpanetta joined #salt
15:02 daxroc Can you manage a system file like that ? I did try that first but it gave me errors - with a random string appended to the filepath  - assumed it was a temp file name and it couldn't create in that path ?
15:03 daxroc beardedeagle: using the pillar data to inform tests ?
15:05 mpanetta joined #salt
15:05 daxroc I would see clear need to duplicate data for the purpose of isolation in testing it will help highlight accidental  pillar changes.
15:05 _Cyclone_ joined #salt
15:05 beardedeagle I control everything salt related
15:05 beardedeagle so no accidental changes are ever made
15:06 beardedeagle since my pillars describe how a pillar should be installed and configured, I just use the values as the expected result for tests
15:06 beardedeagle how a service should be installed* damnit
15:08 daxroc But if you change the pillar and make a mistake your test will pass - do you not think the test and the model data should be isolated (duplicated) with the pillar being the desired state and the outcome checked in the test
15:08 _JZ_ joined #salt
15:09 ReV013 joined #salt
15:09 haam3r Hi! For the file.managed state does salt copy the file over every time, regardless if it already exists in the correct place?
15:09 beardedeagle hence why I still haven't decided if it's a good or bad idea
15:11 beardedeagle haam3r: check the file.managed docs, look for replace
15:12 beardedeagle it defaults to replace=True, create=True
15:14 bluenemo joined #salt
15:14 haam3r beardedeagle: yeah, but in the case of replace:True, it still should not copy the file again if there are no changes...or am I misunderstanding something
15:16 promorphus joined #salt
15:17 promorphus can anyone point me in the direction of a way to set a grain or pillar variable as a result of another state? i.e., when i cmd.run something, i want the output stored in a grain so that i can use it later on in the same state?
15:19 nickabbey joined #salt
15:19 xaRMonx joined #salt
15:21 xaRMonx When a pillar definition is matched, ie: domain:blah.com Does the pillar continue to look further for additional matches?
15:23 xaRMonx http://pastebin.com/3qRvPJ4T for example
15:25 wombawomba joined #salt
15:27 xaRMonx Found the answer, nvm
15:35 nethershaw joined #salt
15:36 Miq hm
15:37 Miq anyone wo knows the salt.runner module?
15:40 beardedeagle haam3r: if I am reading the code right file.manage makes a call to get_managed which caches the file on the minion
15:43 nidr0x joined #salt
15:43 DEger joined #salt
15:46 DEger joined #salt
15:47 beardedeagle promorphus: create a variable that does your cmd.run {% set VAR = salt.cmd.run(YOURCOMMANDHERE) %} then the state.grains.present the variable
15:48 beardedeagle or just call the variable directly if it is going to be used in the same staet
15:48 beardedeagle state*
15:48 beardedeagle Miq: what's your question
15:49 Miq I'm trying to call a runner from sls
15:49 Miq https://gist.github.com/anonymous/c7710af559baa768af0f40fd73772271
15:49 Miq i can't figure out why the key error
15:50 Miq the runner works with salt-run
15:52 keltim joined #salt
15:53 beardedeagle is change a custom runner you wrote?
15:55 Miq yes
15:56 Miq the error remains the same what ever i write as the name of the runner in the sls
15:56 Miq tbh
15:59 nickabbey joined #salt
16:01 ruxu joined #salt
16:02 Miq i think it just fails to find the runner code
16:02 Miq but since the salt-run finds it then i'm not sure where the state module is looking for it
16:03 djgerm joined #salt
16:04 darvon joined #salt
16:05 Ahlee joined #salt
16:06 beardedeagle Probably not the cause, but I think you have an additional space before -name: change.run
16:09 Miq had 3 there
16:09 Miq makes no difference on the error tho
16:12 krymzon joined #salt
16:22 bowhunter joined #salt
16:26 nickabbey joined #salt
16:27 * PatrolDoom mumbles
16:27 PatrolDoom whats the point of automation if you wont embrace it
16:27 * PatrolDoom shivers with frustration
16:27 Miq ?
16:27 seanz joined #salt
16:28 PatrolDoom sigh, just silliness being dealt with. trying ot get salt-ssh used w/ certain part of project
16:28 PatrolDoom and i'm getting push back cause its different than salt
16:28 Miq i need to run stuff about the minion on the master
16:28 Miq aka the minion does not have access to an external api
16:28 Tanta joined #salt
16:28 Miq so the code must run on the master
16:29 Miq ah sorry, you have another subject :D
16:29 PatrolDoom indeed
16:29 * PatrolDoom mumbles to self
16:30 Miq well in theory doing the stuff over ssh is different than doing it with an agent
16:30 beardo joined #salt
16:31 iggy Miq: I'm not sure you can run runners in a minion... the normally only run in the master context (other runners, orchestration, reactor, etc)
16:31 Miq yes it has to run on the master
16:32 Miq i'm just starting it from an sls to get grains and stuff
16:32 Miq as an input for the runner
16:32 iggy not just _on_ the master, but in the master context
16:33 Miq i never need it to contact the minion just use the grains for the minion matched by salt command
16:33 iggy minions have no code for finding runners (no matter if the minion is actually running on the same machine as the master)
16:34 Miq so salt *web* state.sls run_script_onmaster
16:34 Miq and the script gets the minion ID and other stuff
16:34 iggy it's not going to twork
16:34 iggy *work
16:35 iggy state.sls tells a minion to run code
16:35 Miq what is the point of salt.states.saltmod.runner then?
16:36 iggy I'm going to guess it's for orchestrate
16:37 Miq does not totally convince me
16:38 Miq atleast the manual is quite straightforward
16:38 Miq it should to exactly what i want
16:38 Miq but you  gave me an idea :) check the minion logs...
16:39 Miq and you are right
16:39 onlyanegg joined #salt
16:39 Miq damn i'll burn that manual to the ground
16:39 cscf I seem to recall there was a salt-minion setting where you could reject commands from the master until someone logged in and changed it.  Anyone know what it's called?
16:40 Brew joined #salt
16:42 iggy Miq: how about sending a patch to clarify?
16:42 iggy or an issue
16:43 Miq how the heck am i supposed to use that state module then
16:43 Miq target the master?
16:43 iggy that won't work either
16:43 iggy (because that would still be trying to run a runner in a minion)
16:43 Miq figures
16:44 Miq but how does that state work then
16:44 Miq as stated in manual
16:44 Miq anyway, what i need is a runner that can use data from grains an pillar
16:44 anotherzero joined #salt
16:44 Miq of a minion
16:44 iggy I'd say, change your runner up to take an id and it can use client calls to get the data it needs from the minion
16:45 sarcasticadmin joined #salt
16:45 Miq and how do i target then?
16:45 Miq salt-run does not take combound target afik
16:45 iggy salt-run doesn't take any target
16:45 Miq yup
16:46 iggy you would pass it as an arg to your runner and the runner would have to handle dispatching that
16:46 Miq :S
16:46 iggy I'd start here https://docs.saltstack.com/en/latest/ref/clients/index.html#salt.client.LocalClient.cmd
16:47 mavhq joined #salt
16:47 DammitJim joined #salt
16:47 Miq i don't really need cmd
16:47 Miq just prexisting data
16:47 iggy so if you have an arg to your runner that is the target (and possibly another that says what kind of target it is), you can use the above to call out to the minions and fetch the grains and pillar data
16:48 Miq also if i make like 15 calls to the minion and target 100 minions then this will be horrid
16:48 iggy okay
16:48 iggy let's take a step back
16:49 iggy what are you trying to achieve? (high level)
16:49 Miq for a set of minions (defined by a compound match) run a runner for each of them and runner vars come from the said minion grains
16:51 iggy "run a runner" isn't very high level
16:51 Miq what i had in the sls:
16:51 iggy that's implementation detail
16:52 Miq the master needs to contact an api
16:52 Miq and save stuff about the minion there
16:52 iggy now we're getting somewhere
16:52 Miq and also change stuff on minion at the same time
16:52 DammitJim Is there something that I need to tell salt when installing mysql-server-5.7 on Ubuntu 16.04?
16:53 DammitJim For some reason, after I pkg.install it, I can't log on using the root account :(
16:53 iggy could you keep the data needed in mine and then push from mine to the api?
16:53 Miq now i will be a noob and say that i have no idea how mine works
16:54 Miq log into the server or mysql?
16:54 sgo_ joined #salt
16:54 Drunken_Panda anyone played with publisher acls ?
16:54 Miq @dammitjim
16:55 iggy DammitJim: yes, you need to set some debconf settings (otherwise the minion hangs waiting on input and the package never really gets fully installed)
16:55 Drunken_Panda my gitlabbuilds user is still getting a failed to auth error and this is my publisher acl config
16:55 iggy i.e. percona-xtradb-cluster-server/root_password (but you change the first part with the server package name)
16:55 Drunken_Panda https://gist.github.com/anonymous/d2ff4422810c0668b047063312af86bb
16:56 DammitJim iggy, really? is this a new problem with Ubuntu 16?
16:56 DammitJim log into mysql's root default account
16:57 iggy DammitJim: not new afaik, we've always seen it (at work and personally)
16:57 DammitJim hhhmmmm... I didn't have this issue when I installed mysql 5.6 on Ubuntu 14.04
16:57 DammitJim strange... I was cursing a 16.04 LOL
16:58 DammitJim thanks, so I could just pass data in the pkg.installed with root and an empty password, right?
16:58 Miq when you manually install mysql then dpkg asks questions
16:58 Miq those questions must be answered by salt also
16:58 DammitJim Miq, you are right
16:58 DammitJim or salt just goes with a default?
16:58 iggy we have that debconf.set stuff in our formulas at work
16:58 DammitJim meaning, for the password for root, one can just press enter and not enter a password
16:58 iggy and in my salt (and I had it at my last job too)
16:59 Miq i'm not aware that there is any default
16:59 DammitJim is debconf.set ran on install of mysql-server?
16:59 Miq pressing enter is still action :)
16:59 iggy so trusty, xenial, and wheezy
16:59 Miq uh, salt mine.... read some about it now
16:59 Miq seems such an overkill for a simple task
17:00 DammitJim no, something is not right here...
17:00 DammitJim hhmmmm
17:00 Miq everything i need is present just the damn way to trigger runner on master is missing
17:02 iggy DammitJim: https://gist.github.com/iggy/e1b2bb30dad9756c116e44cd45401d43 for inspiration maybe
17:02 samodid joined #salt
17:02 Miq well i can keep doing it the old way :) salt -C "xxx and not xxx" tes.ping | sanitize | script.py    and then scripts asks data from the minions passed by from the pipe
17:02 iggy it's for percona, but same difference, different package name
17:02 Miq but that makes me ashamed :D
17:03 DammitJim iggy, are you saying that I can interact with mysql-server even if I can't log on as root using mysql-client?
17:03 DammitJim I've used debconf.set in the past for creating users and changing passwords on mysql users, but haven't experienced this "lockout"
17:04 iggy DammitJim: no, I'm saying you should purge your existing install and install it another way
17:04 DanyC joined #salt
17:04 DammitJim where I can't log on as the root user
17:04 DammitJim how else?
17:04 Miq debconf is a module
17:04 DammitJim I did a manual install and that worked (sudo apt-get install mysql-server-5.7)
17:04 Miq it interacts with dpkg not mysql
17:04 cyborg-one joined #salt
17:04 DammitJim then I restored my snapshot and did from salt: pkg.installed for mysql-server-5.7
17:04 DammitJim but I can't do root to log on
17:05 iggy yes, because the root user is kept in the database
17:05 sh123124213 joined #salt
17:05 DammitJim Miq, so, again, using debconf would be able to reset my passwords?
17:05 Miq no
17:05 Miq when it's allready set
17:05 DammitJim oh, then how do I gain access to mysql?
17:05 Miq apt-get purge does not delete the DB
17:05 iggy debconf can only influcence what the password is set to at install time
17:05 DammitJim right!
17:05 Miq so the old first install db is still used
17:06 DammitJim Miq, I am talking about a VM snapshot with a clean server
17:06 iggy if you are just trying to get into a mysql database... that is way outside the scope of salt
17:06 DammitJim I'm not "removing" mysql after my installs.. that's too much work
17:06 iggy but I'd start with google how to reset mysql root password
17:06 Miq the question is if the mysql was even installed?
17:06 DammitJim no, that's not the question Miq
17:06 DammitJim say I spin up a brand new Ubuntu server
17:07 DammitJim (I've done this test)
17:07 DammitJim then I install mysql-server-5.7 using salt
17:07 Miq so you say that salt just made a random password for the mysql root?
17:07 DammitJim then I try to log on as root, I CANNOT log on
17:07 DammitJim I build a brand new ubuntu server
17:07 DammitJim then install mysql-server-5.7 through apt-get install
17:07 DanyC left #salt
17:07 DammitJim and I am able to log on to mysql as root
17:07 DammitJim so, what is salt doing?
17:07 Miq apt-get install ask you questions right?
17:07 iggy because when you install by hand it asks you questions
17:07 DammitJim I don't know waht salt is doing... that's what I am trying to understand
17:08 DammitJim but that would mean that noone can install mysql-server from salt
17:08 iggy those questions it asks are what debconf.set is answering
17:08 DammitJim and that doesn't sound right
17:08 DammitJim thanks iggy
17:08 DammitJim so, debconf.set will answer those questions while it's being installed?
17:08 Miq yes
17:08 DammitJim that's pretty cool
17:08 DammitJim ok, I am sorry for missing this
17:08 dariusjs joined #salt
17:09 DammitJim so, salt is smart enough to go through the state file I build and pick up my debconf.set settings
17:09 DammitJim you guys are the best. thank you!
17:10 iggy you could do the same thing outside of salt fwiw
17:10 DanyC_ joined #salt
17:11 iggy (most config mgmt will do this already I suspect)
17:11 DanyC_ left #salt
17:11 dariusjs joined #salt
17:11 Miq so if i'd figure out orchestrate then that would allow me to run the runner on master with the needed data?
17:14 filippos joined #salt
17:19 iggy no
17:19 iggy you'd still have to make calls to the minions to get said data
17:19 * Miq laughs
17:19 Miq i almost hate you now
17:20 iggy I do what I can
17:20 iggy ;)
17:21 whitenoise joined #salt
17:22 Miq i just can't accept this :)
17:23 iggy realistically, the way I'd do it is only have the minion report changes when something changed, and then bubble that up to the master via reactor... but I'm not sure what your exact setup is
17:25 Miq i have 2-3 diffrent api's that are only accessable by the master
17:25 Miq the most simple one is the object atm
17:26 Miq i need to change the root password on the minion and then save that password in the api along with the minion data
17:28 iggy do you change it regularly? on demand? at system provisioning?
17:28 DanyC joined #salt
17:29 Miq mostly at provisioning but also later
17:29 DanyC left #salt
17:30 Miq atm i need to change a lot of prexisting ones
17:30 candyman88 joined #salt
17:30 iggy so you have some state that is changing the passwords? Why not fire an event from that state up to the master and let the reactor do the api work
17:31 woodtablet joined #salt
17:31 iggy you can send data with event.send so ship the new password with that then the master doesn't need to make any calls back to the minion
17:32 Miq hmm
17:32 Miq atm the runner changes the pw
17:32 Miq but that can be changed
17:33 iggy the runner makes a call to the minion on the node to change it?
17:33 Miq have to check how the event send is encrypted and loged then
17:33 Miq yes
17:34 iggy but you're worried about making calls to the minion...
17:34 Miq or not even a call as such, basic cmd run with hashed password
17:34 iggy in any case, gotta get ready for work
17:34 Miq that keeps the pw from moving around
17:35 Miq but thanks that was a good idea
17:36 theblazehen joined #salt
17:38 moeyebus9_ joined #salt
17:38 dariusjs joined #salt
17:38 DanyC joined #salt
17:40 markizano can you define a returner for a state ran within state.orchestrate ?
17:43 whytewolf check the ret option in saltmod https://docs.saltstack.com/en/latest/ref/states/all/salt.states.saltmod.html#salt.states.saltmod.state
17:46 mavhq joined #salt
17:46 raspado joined #salt
17:51 dariusjs joined #salt
18:00 nickabbey joined #salt
18:00 djgerm joined #salt
18:02 DEger joined #salt
18:07 ruxu joined #salt
18:07 keldwud joined #salt
18:07 dariusjs joined #salt
18:07 pcn joined #salt
18:08 keldwud does anybody have an example of using require in salt to call a specific stanza in a different state file? I have not found the answer here:  https://docs.saltstack.com/en/latest/ref/states/requisites.html#requisites  or here  https://docs.saltstack.com/en/latest/ref/states/ordering.html
18:09 keldwud for example: I have a foo.sls with a cmd.script that has a requirement. the requirement is a file.managed that resides in bar.sls under the name baz.
18:09 keldwud so I understand that if both stanzas were in the same file, I could call it with require: file: baz
18:10 keldwud but is there a way of calling baz from require: if baz resides in bar.sls?
18:12 keldwud or is everything flat and it doesn't matter which sls file baz resides in, I can call baz from any sls in the same directory?
18:13 s_kunk joined #salt
18:15 J0hnSteel joined #salt
18:22 whytewolf keldwud: the minion needs to know about both files. so if both files are in top then yes. you can just include the other stanza. however if not. or if you are calling the sls directly you need to include the other file
18:24 keldwud I have both files in the include
18:25 keldwud which is in the init.sls
18:28 DammitJim iggy, what were you saying about installing mysql and then waiting forever and never finishing the installation?
18:32 edrocks joined #salt
18:35 antpa joined #salt
18:36 whytewolf DammitJim: from what i remeber from ubuntu and the issue mysql install would ask questions if debconf wasn't set that would cause salt to not be able to finish the install. since it needed a prompt.
18:36 whytewolf DammitJim: so you have to do something like this https://gist.github.com/whytewolf/6526bfc300ba8f583be6
18:41 Sketch til https://www.reddit.com/r/saltstack/
18:41 dxiri joined #salt
18:42 hackel joined #salt
18:43 pipps joined #salt
18:44 Tanta joined #salt
18:48 cebreidian joined #salt
18:51 ssplatt if i do a “for k,v, in thing.iteritems()” in jinja, is there a way to reconstruct the full K:V dictionary? like if i want to pass - data: {{ k:v }} into a file.managed jinja template. and in the template do {{ data|json }} ?
18:52 DEger joined #salt
18:53 ssplatt i was doing the for k,v to make the filename {{k}}.conf
18:53 ssplatt but i need teh full dict in the template.
18:59 sgo_ joined #salt
18:59 dxiri joined #salt
19:04 pipps joined #salt
19:06 pipps99 joined #salt
19:06 pipps99 joined #salt
19:07 cliluw joined #salt
19:07 Praematura joined #salt
19:09 pipps99 joined #salt
19:15 ivanjaros joined #salt
19:17 pipps joined #salt
19:20 iggy ssplatt: do you have any pseudo-code you could share? Not super clear from that description
19:21 ssplatt similar to https://gist.github.com/ssplatt/c864913d17db53a8b771f8efb7ce585d
19:21 ssplatt trying to figure out how to remake teh dict
19:21 ssplatt but use the name at the top level as the name of the file.
19:22 iggy why do you need it like that?
19:22 ssplatt i was just goign thrut eh sensu docs and thats how they broke up all the files under conf.d
19:22 ssplatt but inside of teh file they need the top level name too
19:23 ssplatt was trying to replicate but not duplicate blocks
19:23 iggy just pass k and v as 2 different context items
19:23 ssplatt well in teh conf.j2 i was just going to {{ data|json }}
19:23 ssplatt so it just spit it out
19:24 ssplatt instead of having to actually template it out fully
19:24 iggy hmm
19:25 ssplatt dict(**items)¶
19:25 ssplatt A convenient alternative to dict literals. {'foo': 'bar'} is the same as dict(foo='bar').
19:25 iggy restructure your pillar to be a list of dicts and just loop over the list and pull the k out of the dict and put the whole dict in the file?
19:25 ponyofdeath joined #salt
19:26 sknebel joined #salt
19:27 woodtablet what is a good way to create specific pillar values for specific machines ? i was originally thinking of doing grain match to hostname, but then i would have to have pillars for all the machines right ?
19:28 iggy ssplatt: added a comment
19:28 iggy woodtablet: there are literally infinite ways to do that
19:29 woodtablet iggy: ya, but what is one way so i dont have pillar files for each host ?
19:29 cscf woodtablet, it depends on your situation.  I have a mix of per-machine, per-room, per-service, etc pillars
19:29 woodtablet iggy: sorry
19:29 iggy woodtablet: I'd suggest looking at all the available pillars first and then see what makes the most sense for you
19:29 iggy https://docs.saltstack.com/en/latest/salt-modindex.html#cap-p
19:29 cscf woodtablet, well, do some of the minions share variables?  Because you can keep those in a common file.
19:30 woodtablet cscf: yes, some do, i have those in a core pillar
19:30 iggy we have a pre-existing cmdb/ipam thingy at work... it keeps all that data per minion id
19:30 gableroux joined #salt
19:30 druonysus__ joined #salt
19:30 iggy on my personal stuff, yeah, I just assign files by minion_id
19:32 woodtablet iggy: but how are you assigning the files? basically i want a top.sls to go through a hosts folder full individual pillar files, and only give data to hosts that files in that folder. i dont want it crash though if a host doesnt have a file in that folder ( this is waht i suspect will happen)
19:32 iggy we don't have files
19:32 iggy we use an ext_pillar
19:33 woodtablet cscf: i have a core pillar and a per service pillar, now i am trying to work in a per host pillar
19:33 iggy or you mean my personal stuff? yeah, I ensure each host has a file
19:33 woodtablet iggy: i am using stack for ext_pillar =D
19:33 iggy and yeah, it'll crap itself if the file doesn't exist
19:33 woodtablet iggy: you gave me taht idea a few weeks ago
19:34 woodtablet iggy: that is what i feared
19:34 cscf woodtablet, there's a /etc/salt/master option that I forget that lets you make a directory with subdirs equal to minion ids, and load everything in them
19:34 iggy you could modify the stack pillar (put it in your own ext_modules dir) to not crap out if the file doesn't exist
19:34 cscf Here: https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.file_tree.html#module-salt.pillar.file_tree
19:35 cscf But rather than reading .sls files as YAML, it reads with the key being the filename and the data being the contents.  Nice for some things, not for others.
19:36 woodtablet iggy: i am guessing, i would need to write a ext_module that would return a blank dict.. hehe i see
19:36 iggy in any case, I think you are going to have to write some code
19:37 woodtablet cscf: ahh thanks! i ll take a look
19:41 ssplatt iggy: {% set full = {k:v} %}  does work
19:41 ssplatt -data: {{ full}}
19:41 iggy whatever works
19:42 ssplatt not sure its the best way to do it.  so your comment was to just do “for k in thing.iteritems()”  right?  instead of k,v
19:42 woodtablet iggy: thanks again for your help too
19:42 xet7 joined #salt
19:43 iggy ssplatt: minus .iteritems() (and making your data a list of dicts)
19:43 ssplatt oh yeah i don’t want a list. not a fan of merging strategy for lists in salt right now
19:43 ssplatt without changing default settings
19:43 ssplatt some of our formulas we need the list merge == overwrite list
19:44 ssplatt some we actually want them to merge but we’ve worked out how to do that as dict instead of list
19:44 SaucyElf joined #salt
19:47 nickabbey joined #salt
19:48 keldwud I keep receiving a warning: "'group' and 'user' are invalid keyword arguments for 'archive.extracted'. If you were trying to pass additional data to be used in a template context, please populate 'context' with 'key: value' pairs. Your approach will work until Salt Carbon is out. Please update your state files" but when I read the documentation at https://docs.saltstack.com/en/latest/ref/states/all/salt.states.archive.html the examples
19:48 keldwud show that user and group are still in use
19:48 keldwud is there a better way to chown the files upon extraction so that they are owned by a specific user?
19:50 Edgan joined #salt
19:51 Tanta cmd.run
19:52 Tanta with an onlyif req, with a test ! -f "/one/file/extracted"
19:52 Tanta er maybe that logic is off
19:53 Tanta keldwud, here is an example: http://pastebin.com/33f3419a
19:55 whytewolf keldwud: i see user and group still in the code. not sure why you would be getting keyword argument errors with them
19:56 whytewolf what do you get when you run salt-call --verion on that minion?
19:56 keldwud so archive.extracted *is* capable of changing file ownership upon extraction like file.directory and file.managed, there just might be something funny with my environment?
19:56 keldwud I'll check
19:56 whytewolf opps that should be --version
19:57 keldwud I figured as much :)
19:57 keldwud ahhh, this might be why
19:57 keldwud salt-call 2015.5.10 (Lithium)
19:58 keldwud unfortunately, I don't get to decide when to update our salt :(
19:58 keldwud if I updated, that would probably resolve my isssue, right?
19:58 druonysus__ joined #salt
19:58 whytewolf ahh yeah that version did NOT have user and group, or even kwargs
19:58 keldwud ahh, and that also explains why I'm having such a rough time calling requirements from other state files
19:59 whytewolf the closest thing to user is archive_user but that is the user that does the extracting
20:00 whytewolf if you can't upgrade go with what Tanta said cmd.run with an onlyif checking the extraction is complate
20:00 Tanta http://pastebin.com/33f3419a, whytewolf
20:00 Tanta this is how I actually do it for my work
20:00 cacasmacas joined #salt
20:00 keldwud thank you for the workaround, Tanta
20:01 Tanta sure man
20:01 Tanta I think I forgot why I didn't do what you wanted to do
20:01 Tanta but that might be why
20:01 bluethundr joined #salt
20:01 keldwud I bet that's probably it, Tanta. I was trying to use a documented feature that isn't available in my old version of salt
20:02 Tanta hehe yeah, I use CentOS 7 with the EPEL packages
20:02 Tanta so a lot of the new stuff isn't available to me
20:03 bekks https://techcrunch.com/2017/01/20/the-white-houses-lgbt-rights-page-has-disappeared/
20:03 DEger joined #salt
20:03 bekks Sorry, copy/paste error.
20:03 whytewolf really wish documentation went back into the older versions beyond the current stable
20:03 keldwud I kept trying to use this feature https://docs.saltstack.com/en/latest/ref/states/requisites.html#omitting-state-module-in-requisites and have spent the last couple hours trying to figure out why it wasn't working. I really should have checked the version of my environment before working!
20:04 ssplatt if i can {{ data|yaml(False) }} to get it to render not in a single line, why can i not |json(False) or |jason(pretty=True)?
20:05 whytewolf cause jason really doesn't like make up?
20:06 keldwud whytewolf: hurr
20:06 keldwud :)
20:06 * ssplatt chuckles
20:07 DammitJim am I supposed to do decisions on the version of mysql-server in a map.jinja file? where if it is ubuntu 16, do mysql 5.7, but if it is ubuntu 14, do 5.6?
20:08 DammitJim then I need to do a lookup  in my state file?
20:08 bekks you could just install mysql-server, which defaults to 5.6 on 14.04, and to 5.7 on 16.04
20:09 whytewolf ^
20:09 DammitJim you know how this works, but maybe you guys have more experience...
20:10 DammitJim say in 4 years, there are mysql-server 5.7, 5.8, and 5.9 for Ubuntu 16
20:10 DammitJim would they upgrade if I do a dist-upgrade?
20:10 beardedeagle I hate SOX audits
20:10 DammitJim I want to avoid that
20:10 DammitJim besides I have a ton of servers where I only insatlled mysql-server-5.6 on Ubuntu 14 and I don't have mysql-server
20:10 whytewolf ubuntu seems to take the same route as redhat and stick to a major version per major version
20:10 DammitJim production is almost untouchable for stuff like this
20:11 DammitJim right, I wouldn't want to automatically upgrade to the version when doing a dist-upgrade... that's too much work
20:11 DammitJim but then you hear how you should stay up to date
20:11 DEger joined #salt
20:11 DammitJim *sigh*... where to begin??!!!
20:11 whytewolf but yes use map.jinja for building a dict that you use in your state that sets versions
20:11 DammitJim that's all, right?
20:12 whytewolf https://docs.saltstack.com/en/latest/topics/best_practices.html
20:12 whytewolf or https://docs.saltstack.com/en/latest/topics/best_practices.html#modularity-within-states
20:12 DammitJim yeah, I'm reading that now
20:13 Jimlad joined #salt
20:13 DammitJim grains.filter_by how does it know what I'm looking for?
20:13 bekks DammitJim: Until 2021, the default for mysql will not change, in Uuntu 16.04
20:14 DammitJim it'll stay at 5.7?
20:14 bekks Yes.
20:14 DammitJim oh, I know now... for some reason for 14, we couldn't install mysql-server because a year a go it would install 5.5
20:14 DammitJim sometime later it did update to 5.6
20:14 DammitJim so, bekks what are you basing this on?
20:15 bluethundr guys.. I'm trying to add EBS volumes when I launch ec2 instances into the amazon cloud
20:15 bluethundr but when the server spins up, I can log into it. But the extra EBS volumes I want arent' there
20:16 bluethundr can someone please look at the profile I'm using and offer a suggestion?
20:16 bluethundr https://gist.github.com/bluethundr/e9a3fb74549a77027eb6daca81f9a61d
20:16 bekks DammitJim: On the fact that packages will not have random version bumps without a very good reason.
20:16 bekks DammitJim: and why do you try to install mysql-server when you already have a mysql-server-x.y package installed?
20:17 DammitJim but it could, right?
20:17 DammitJim I do know, who said that?
20:17 DammitJim I have a salt state that specificallly installs 5.6
20:17 teclator_ joined #salt
20:17 DammitJim but now that we are moving to 16.04, we would like to go with 5.7
20:17 DammitJim that's all
20:18 bekks 0120 211438 < DammitJim> oh, I know now... for some reason for 14, we couldn't install mysql-server because a year a go it would install 5.5
20:18 bekks There you did say it.
20:19 bekks DammitJim: If you want to go with 5.7, install mysql-server
20:19 cebreidian joined #salt
20:19 DammitJim bekks, when did I say that I am installing mysql-server over a mysql-server-x.y installation?
20:19 DammitJim I never said that
20:19 DammitJim we tried it manually and that's what it did, then we dropped that solution
20:20 whytewolf DammitJim: by default the grain grains.filter_by looks up by os_family. but it has options see https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.grains.html#salt.modules.grains.filter_by
20:20 bekks DammitJim: I even quoted when you said it :)
20:21 bekks DammitJim: However, having 16.04 and wanting mysql 5.7, just install mysql-server
20:21 DammitJim I said: oh, I know now... for some reason for 14, we couldn't install mysql-server because a year a go it would install 5.5
20:21 DammitJim so, Ubuntu did change their default from 5.5 to 5.6 at some point
20:22 DammitJim because the default now is 5.6
20:22 DammitJim so, your assumption about 2021 is incorrect
20:22 nickabbey joined #salt
20:23 DammitJim but let me double check my sources
20:23 bluethundr whytewolf: any ideas?
20:23 DammitJim bekks, my apologies...your statement is correct about not changing minor versions
20:23 bekks DammitJim: So, CURRENTLY you want 5.7. Whats the issue NOW with installing mysql-server which defaults to mysql-server-5.7?
20:23 bekks :P
20:24 DammitJim but for Ubuntu 14, I can't do mysql-server because the default is 5.5 and not 5.6 as that's what our requirements call for
20:24 whytewolf bluethundr: I don't know i don't work with aws instances
20:24 bluethundr whytewolf: ok
20:24 DammitJim there is no issue... I just need to use grains to determine the version... I can't go with everyone's suggestion about just blindly installing mysql-server
20:24 bluethundr DammitJim: how about you? think you can take a look at my paste?
20:24 DammitJim it won't support my 14.04 servers
20:25 DammitJim oh no, you can't call my name bluethundr ... you are going to wear it out
20:25 bekks DammitJim: It doesnt need to. Because we are talking about 16.04
20:25 bluethundr gee thanks
20:25 DammitJim where's the pastie, bluethundr ?
20:26 DammitJim bekks, it needs to... I need to be able to support ubuntu 14 and 16
20:26 bluethundr here ya go: https://gist.github.com/bluethundr/e9a3fb74549a77027eb6daca81f9a61d
20:26 DammitJim what's the problem?
20:27 bluethundr the ec2 server launches, but no EBS volumes are created
20:27 bluethundr just the root EBS, not the extra ones
20:27 DammitJim oh, sorry... I don't know what ebs is...
20:27 bluethundr elastic block store
20:27 tom[] joined #salt
20:27 bluethundr they're like drive volumes you attach to AWS servrs
20:28 DammitJim I'm not that familiar with salt-cloud, sorry
20:28 bluethundr ok
20:28 bluethundr thanks anyway
20:28 Sketch s/salt-cloud/aws/
20:28 DammitJim I use salt-cloud just to take snapshots and delete them on my vmware environment
20:28 DammitJim haven't gotten the chance to play more
20:28 DammitJim oh yeah, now called aws
20:28 elektrix so if you set a grain in a salt state, and another state checks the value of that grain (e.g. {% if 'bar' in grains['foo'] %}), how do you get the grain to be loaded before that next state does the check?
20:29 cscf elektrix, isn't a - require: good enough?
20:29 whytewolf elektrix: you don't... jinja in states renders before the states are ran
20:29 elektrix whytewolf: ok...thanks
20:30 amcorreia joined #salt
20:30 elektrix I was setting role grain in states based on hostname, then hoping that states could be applied based on the set roles
20:30 elektrix will have to figure something else out
20:31 whytewolf elektrix: the closest you can get is using salt orchenstrate to first do the setting the grains then run the highstate. this being two different calls to the minion allos the grains to be set
20:31 darthzen joined #salt
20:32 elektrix ok, this might give me an excuse to start looking at salt orchestrate
20:34 cebreidian joined #salt
20:35 tom[] can salt-ssh give more detail to jinja evaluation errors? for example, "Rendering exception occurred: Jinja Jinja variable 'blah object' has no attribute 'blah'" is good info but knowing the file and line of the expression that jinja could not evaluate would be great
20:35 jas02 joined #salt
20:37 adelcast joined #salt
20:38 DammitJim whytewolf, I still don't understand how filter_by knows to look at the osrelease in grains
20:38 mvensky joined #salt
20:40 whytewolf salt['grains.filter_by']({your dict with the info you want to filter by}, grain="osrelease",default='14.04')
20:40 whytewolf it isn't defficult
20:41 pipps joined #salt
20:42 DammitJim oh, the grain='osrelease' I didn't see or grain='os'
20:42 DammitJim thanks
20:44 rem5 joined #salt
20:44 pipps joined #salt
20:47 DammitJim why do they show using a merge with pillar data on the example?
20:53 nickabbey joined #salt
20:55 paant joined #salt
20:55 whytewolf because it is a normal way of doing it. as a way of hey i can have these defaults but i can also override that with pillar.
21:01 edrocks joined #salt
21:02 cro joined #salt
21:03 DammitJim oh, pillar would override that if I decided to do so... got it!
21:05 eliasp joined #salt
21:05 adelcast joined #salt
21:06 beardedeagle joined #salt
21:07 pipps joined #salt
21:09 cypher543 joined #salt
21:11 moeyebus9_ joined #salt
21:13 debian112 joined #salt
21:13 elektrix so before I waste more time...If I use reactor, it "should" be able to set a custom grain when the minion is first started (i.e. deployed), then any grains that are tested against using jinja in state files should find those grains?
21:14 elektrix https://docs.saltstack.com/en/2015.5/topics/reactor/
21:14 whytewolf yes
21:15 elektrix awesome
21:15 ronnix joined #salt
21:17 overyander is there a command i can run on a minion to sync custom modules or is running highstate the only way?
21:18 overyander i'm trying to test a module that i'm updating and don't want to have to run highstate every time i change a line.
21:18 whytewolf saltutil.sync_modules or saltutil.sync_all
21:18 overyander awesome, thanks
21:18 beardedeagle joined #salt
21:19 overyander whytewolf are you a dev? or do you dev on salt stuff?
21:19 whytewolf i have submitted pr's before but honestly I'm just a user. that has been here a while :P
21:21 overyander ok. this will be my first one.
21:22 overyander i'm adding some features and modifying some existing things in the windows license module
21:23 eightyeight joined #salt
21:23 whytewolf nice
21:32 gableroux joined #salt
21:34 DEger joined #salt
21:36 tercenya joined #salt
21:39 dendazen joined #salt
21:43 mikecmpbll joined #salt
21:48 tercenya joined #salt
21:55 amontalban joined #salt
21:55 tercenya joined #salt
21:58 necronian joined #salt
21:59 jas02 joined #salt
22:03 tapoxi Hi everyone
22:03 tapoxi anyone have a good diagram that explains how salt works?
22:03 dendazen joined #salt
22:03 tapoxi I swear I found a great one a few months ago and now I need it for a ppt
22:04 overyander can someone double check this https://gist.github.com/jeffclay/8ab96fbe34996df0609dc6ddc1ed4e4d   i want to confirm that my CLI example is actually the proper way to do this.  thanks.
22:07 cscf tapoxi, what part of how it works?  Master <-> minion communication? States and Pillar? etc? There's a lot of views
22:07 nledez joined #salt
22:07 nledez joined #salt
22:07 tapoxi cscf: low level. master/minion bus
22:09 jaybocc2 joined #salt
22:12 skullone I think I just noticed odd behavior... if I invoke a state.apply via Salt command line, the state is executed in the order the sls functions are defined
22:12 skullone but if I execute that same state via the Salt API - the state is executed in a different order :\
22:14 nledez joined #salt
22:14 nledez joined #salt
22:16 skullone is that possible?  =/
22:17 overyander with salt, anything is possible. :)
22:19 skullone :p
22:20 MTecknology also, I disagree with anyone that advocates *not* using proper requisites because the order of the file covers it.
22:21 nshttpd_ overyander: can I target things based on custom grains at highstate?
22:21 MTecknology skullone: rather than looking at state.apply, you'd wanna be looking at state.show_{low,high}state
22:22 overyander i haven't used custom grains, but from what i know. custom grains, modules, etc. are syncd first when running highstate so i would imagine that after the minion has synced it then you can reference it like you would any other grain.
22:22 nshttpd overyander: yeah, that's what I thought and cursed at too.
22:23 nshttpd haven't gotten it to actually work.
22:23 overyander do you have to restart the minion service for custom grains to apply?
22:23 skullone MTecknology: this state isnt actually applied to hosts - only run via state.apply
22:23 MTecknology you have to restart salt to effect changes in the configuration files
22:24 nshttpd I'd have to go back and look at it to remember what all different ways I tried to get it to work. I gave up after about a week of fighting with it.
22:24 overyander nshttpd i have 0 experience with custom grains. custom modules, some. and those are synced at the beginning of highstate and you can verify that through looking at the minion logs.
22:25 overyander nshttpd take a look at the full logs when you run highstate, if you don't see the info you need, then enable debug level logging on the minion and try again. you'll have more info than you ever wanted. :P
22:25 MTecknology skullone: considering state.apply is meant to conditionally pick a code path based on input, I would assume there's plenty of room in there for "funny business"
22:26 skullone yah, this is a simple state though, just 3 functions (stop a service, extract files to a dir, and start a service), no includes, or anything
22:26 skullone so, hope thered be very little funny business available to even do :p
22:26 skullone whats interesting, the state.apply via the salt-api always seems to do it the same order (though not the order in the sls)
22:27 skullone while salt state.apply 'hostname' state is the correct order
22:28 MTecknology care to gist your sls?
22:28 nshttpd overyander: I'll try it again here at some point .. I do know that after initial boot and highstate, if I force a highstate again it works fine. So it's that initial boot, install the minion and highstate has some sort of timing issues.
22:28 skullone sure
22:29 overyander you might try putting module.run saltutil.sync_all at the very beginning of highstate
22:29 skullone https://gist.github.com/brentrjones/16b19888e9d937e95c7bef4cef47498f
22:33 nshttpd overyander: I've got a sync_grains in there after auth, but I'll try a sync_all.
22:35 MTecknology skullone: "file.absent: - name: /var/cache/salt/minion/extrn_files" is ... ehm... brain-scratching
22:36 skullone well, i hit an issue where salt would just use the cached file always
22:36 skullone as in, it'll download it once, and never go get a fresh copy
22:37 skullone but thats another issue  ;)
22:37 skullone master and minions are 2016.11.1 btw
22:38 MTecknology skullone: I should share with you my gogs states. They'll likely help you understand a better way of salting. :)
22:38 skullone i did mostly puppet for "states", and salt for executing commands, so im using it 'pretty 101' level so far
22:38 MTecknology just gotta get my personal laptop out, up, and on
22:38 DanyC joined #salt
22:39 MTecknology puppet seems to have a "this is how you scripted it, now use that logic and turn it into obfuscated pulp"
22:39 MTecknology workflow *
22:40 MTecknology ansible seems to be "this is your script, we'll run it for you"
22:40 MTecknology salt is more "I want this thing this way, do it."
22:41 skullone what ive done with salt, i prefer it over puppet, for sure
22:41 DanyC left #salt
22:41 Tanta puppet is junk
22:43 Twiglet joined #salt
22:44 sh123124213 left #salt
22:44 sh123124213 joined #salt
22:46 MTeck joined #salt
22:46 MTeck skullone: It's not perfect, but this works until I finally get gogs packaged in debian.  https://gist.github.com/MTecknology/7670c44a0723e9454fb8a5d3cc851dc5
22:47 stooj joined #salt
22:49 Trauma joined #salt
22:49 Twiglet joined #salt
22:49 yawniek joined #salt
22:50 nledez joined #salt
22:50 skullone have you seen the cache become permanently stale before?
22:52 overyander having an issue with a function of this salt module. i think it's the way i'm trying to get the value of "osfullname" from grains, or maybe how i'm trying to trim off the first 11 chars of that result or maybe both. any ideas?  https://gist.github.com/jeffclay/9d18284fc82e5f36d3c2cfccb05c9273
22:53 overyander whytewolf   ^^ that's how i understood you to say was the correct way to get grain items from within a module. i think i missed something
22:55 MTecknology skullone: unpossible.
22:56 MTecknology skullone: the pillar attributes make it impossible. The only issue I just noticed is the -if_missing
22:57 whytewolf overyander: you want grains.get not grains.item grains.item returns an dict with the grain name you asked for. grains.get returns only the value
22:57 overyander whytewolf ah, thanks
22:57 overyander let me try that
22:57 MTecknology ignore that one... I stuck that in there to prevent auto-upgrades .. not something you probably have to care about
22:58 pipps joined #salt
22:58 overyander whytewolf do i need the single quotes around osfullname ?
22:58 whytewolf you need quotes of some kind. it is a string afterall
22:58 overyander ok, just making sure.
23:00 masber joined #salt
23:01 tercenya joined #salt
23:02 pipps joined #salt
23:02 cacasmacas joined #salt
23:02 jas02 joined #salt
23:09 MTecknology skullone: lol... now that I'm looking this over more, I /should/ be unpacking gogs to /var/gogs/<version>/ and then symlink from /opt/gogs/... that would be a *much* better way now that I'm looking at it more.
23:13 skullone shrug
23:14 keldwud is there a way to call variables while setting a new variable with my jinja templating? i.e. to embed variables? example: {% set env = 'test' %} /n {% set device = '//cifs/foo/bar_'env'_baz' %}
23:14 keldwud with env being the 'embedded' variable
23:14 dxiri joined #salt
23:14 keldwud when I try it, salt complains about it
23:15 keldwud error: expected token 'block_end', got 'env';
23:15 pipps joined #salt
23:15 sjorge joined #salt
23:16 MTecknology keldwud: you mean... how do I concatenate a string in jinja?
23:16 MTecknology to which I respond... same as python
23:17 MTecknology but you could also use ~ instead of + since you're working on a string
23:17 keldwud ahh
23:17 keldwud yeah, I was suspecting I could just use +
23:17 keldwud I'll try that
23:17 keldwud not familiar with ~
23:18 keldwud thanks for rephrasing my question in a better way
23:19 keldwud when you put it that way, I felt kind of sheepish for not realizing it was so simple
23:20 MTecknology no worries. rephrasing is a great way of breaking down a problems into it's simpler components
23:22 MTecknology keldwud: ~ is strictly concatenation where + does what + does
23:22 keldwud k, that changed the behavior. now it knows I'm trying to call a variable. just doesn't think it has been set yet. so I'll try the ~
23:23 keldwud got a 'referenced before assignment' complaint
23:23 MTecknology gist?
23:24 MTecknology I let you gist while I p[ee]!
23:28 MTecknology awe :(
23:28 keldwud totally went over my head!
23:28 MTecknology gist.github.com
23:28 MTecknology skullone: did you check out the low/high data yet to get an idea what's different?
23:30 MTecknology gtmanfred: You happen to think there's any chance you'd have a chance to help me write those unit tests next week? :D
23:30 skullone MTecknology: not yet
23:32 debian112 joined #salt
23:33 skullone just dont get why low/high would be different if run via salt-cli, vs api
23:35 nledez joined #salt
23:38 MTecknology skullone: right... looking at that data is meant to help reveal that answer. (or at least a direction to look) ;)
23:43 MTecknology feel free to toss that on gist and I can also look
23:43 * MTecknology is kinda (but not very) curious
23:44 skullone wait a minute
23:44 skullone oh boy...
23:44 skullone the salt-api return json is not in any particular order
23:45 skullone it says __run_num__ seemingly to show the order the sls was applied
23:51 MTecknology skullone: whatcha seein'?
23:52 skullone on the run output, you get ""__run_num__": 2,"
23:52 skullone or 0, etc
23:52 skullone whatever order the function in the sls ran in
23:52 skullone and.. its in order :\
23:52 jaybocc2 joined #salt
23:52 skullone but, the entire output of the run is just jumbled up
23:55 MTecknology ah
23:55 Sketch joined #salt
23:56 MTecknology skullone: so the execution order (the important one) is correct and the output display order is not?
23:56 MTecknology however, the correct data /is/ being shipped back, just not applied?
23:57 skullone yah, the run_num is in the order i want it in, but yah, the json output back from the API is just out of order for whatever reason
23:58 skullone so, mystery solved apparently
23:58 CeBe joined #salt
23:59 nledez joined #salt
23:59 nledez joined #salt
23:59 rem5 joined #salt
23:59 debian112 joined #salt

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