Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2016-11-08

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

All times shown according to UTC.

Time Nick Message
00:00 IgorK__ no
00:00 pipps joined #salt
00:00 hemebond Have you pasted your file_roots config somewhere? State directory listing?
00:01 IgorK__ Post on gist.github dirs tree?
00:02 hemebond Yip.
00:02 IgorK__ ok 5 sec
00:02 hemebond And your file_roots config.
00:02 IgorK__ here is
00:02 IgorK__ https://gist.github.com/mymtwcom/89cb686c338d2fb69c490652c5806ac6
00:04 IgorK__ my file_roots config - https://gist.github.com/mymtwcom/b397fe68d98ae4d385f7a5ce3862c3c4
00:04 hemebond That's your top.sls
00:05 IgorK__ but I have no file_roots config
00:05 hemebond It's in your master config.
00:05 hemebond Have you not changed the defaults?
00:05 IgorK__ nope
00:05 hemebond Okay then you only have a base environment.
00:05 IgorK__ I don't know where is master config
00:05 IgorK__ yes
00:06 hemebond So your top.sls shouldn't reference a dev environment since you only have a base environment.
00:06 hemebond Do you actually want to setup a dev environment?
00:06 IgorK__ yes I'm trying. If it will work I will add onthers
00:06 edrocks joined #salt
00:06 IgorK__ *others
00:07 hemebond Okay so first you have to edit your file_roots setting on the master to include another environment.
00:07 hemebond By default it just has base
00:07 rem5 joined #salt
00:07 hemebond So you need to add an entry for dev and point it to a directory (preferably _not_ under the base environment directory)
00:08 IgorK__ wait 1 sec. but in next link, there are exists environments in top.sls https://docs.saltstack.com/en/latest/topics/tutorials/states_pt4.html#practical-example
00:09 rem5 joined #salt
00:09 hemebond Yes, but you have to have file_roots to point to where the state files for that environment is.
00:10 hemebond http://paste.debian.net/893459/
00:10 IgorK__ ok, but there are not showed how to create file_roots
00:11 IgorK__ is it simply file `file_roots` in my salt directory?
00:11 hemebond https://docs.saltstack.com/en/latest/topics/tutorials/states_pt4.html
00:11 hemebond That shows you how to configure your master for multiple environments.
00:11 hemebond Simply the beginning of the article you linked to.
00:12 rem5_ joined #salt
00:12 IgorK__ no, I simply don't see what is file_roots
00:12 hemebond Have you looked in your /etc/salt/master file?
00:13 IgorK__ is it file in `salt` dir, how it called and etc
00:14 rem5 joined #salt
00:15 IgorK__ I looked. Commented file
00:17 cebreidian joined #salt
00:21 sp0097 left #salt
00:21 IgorK__ joined #salt
00:21 jas02 joined #salt
00:22 amontalban joined #salt
00:23 pcn does anyone have a wrapper around salt-call for an hourly highstate that also checks for the health of the minion, e.g. is it running, can it comunicate with the master, etc?
00:43 Edgan pcn: you want a salt dashboard to check the status of all minions?
00:44 mlb joined #salt
00:45 Rubin https://github.com/saltstack/salt/issues/3551
00:45 saltstackbot [#3551][OPEN] "backup" param in file states is inconsistent | The file.sed, file.comment, and file.uncomment states have a 'backup' param which defaults to '.bak'. The file.managed has one, but it defaults to an empty string. file.managed utilizes the backup feature that was added several releases ago. I haven't looked at the code for these other states, but if they don't use backup_mode they should. The inconsistency in this parameter is conf
00:45 pcn Edgan: not exactly.  I'm looking for something I can use with each minion to check its individual health.
00:46 hemebond pcn: A monitoring solution, e.g., Shinken, Nagios, Icinga.
00:46 pcn E.g. it'd be nice to be able to confirm that the master is responsive, etc.
00:47 pcn So I'm not explaining myself well.  I'm not looking for a central dashboard at all.
00:47 pcn I am looking for a tool that will live on the minion and which will diagnose whether a minion is running, working, etc.
00:47 hemebond Then what's the use in checking?
00:48 hemebond And then what?
00:48 Edgan pcn: wrap, "salt-call test.ping" in a script and feed it to your monitoring system
00:48 Edgan pcn: and it will tell you if the master is responsive
00:48 pcn And then lots of things.  My question is whether the tool exists.
00:48 Rubin ooh thats a good idea
00:49 Edgan pcn: I don't think most people both to go that far.
00:49 Rubin pcn, do you already run icinga or something similar?
00:50 Rubin feel like you could do some magic to integrate test.ping into that
00:50 Edgan pcn: it does return a proper return code on success and failure
00:51 Rubin you could either patch it into snmp
00:51 pcn the timeout on salt-call appears to be 8 minutes
00:51 Rubin or have an icinga master run on the salt master
00:51 pipps joined #salt
00:51 Edgan pcn: it wasn't on my system. It returned much faster
00:51 pcn if the minion process is stopped, how long is the timeout on that?
00:58 pcn never mind though, I can limit that.
00:59 pcn still, if the minion is down make sure to put limits in such tests, or to alert on the absence of inpt
00:59 pcn yeah, 8 minutes
00:59 abednarik joined #salt
00:59 fracklen joined #salt
01:02 toastedpenguin joined #salt
01:06 pipps joined #salt
01:09 pipps99 joined #salt
01:11 pipps joined #salt
01:12 matth is it possible to use " !=" in a if statement in an sls file ?
01:12 iggy there is an engine that watches minion state
01:12 toastedpenguin joined #salt
01:13 iggy matth: yes
01:13 matth thans
01:13 matth thanks
01:13 pcn iggy I'm looking at tooling for defensive self-repair on the minion
01:14 ALLmightySPIFF joined #salt
01:14 lempa joined #salt
01:14 John_Kang joined #salt
01:15 John_Kang hi there
01:16 John_Kang is it possible to use require and onchanges in the one definition ?
01:16 hemebond John_Kang: yes
01:16 iggy yes
01:16 John_Kang oh...
01:16 toastedpenguin1 joined #salt
01:16 John_Kang but It didn't seem to work
01:16 John_Kang let me pastebin it
01:19 nidr0x joined #salt
01:20 John_Kang http://pastebin.com/EGiLqQfU
01:21 rem5 joined #salt
01:21 John_Kang I wanted to execute onwership_tomcat when the source is changed and tomcat user exists
01:21 hemebond John_Kang: https://docs.saltstack.com/en/latest/ref/states/requisites.html
01:21 hemebond e.g.,
01:21 hemebond - file: /usr/local/src/tomcat.tar.gz
01:23 John_Kang in case of the user tomcat is already existing, it doesn't excute the ownership_tomcat
01:23 John_Kang that's why I am not sure if i can use the multi requisites in that case
01:28 hemebond Your onchanges is wrong. That was the first thing I saw.
01:29 hemebond Your indentation seems all over the place.
01:29 iggy "In version 2016.3.0, the state module name was made optional. If the state module is omitted, all states matching the ID will be required, regardless of which module they are using."
01:30 hemebond Oh wow.
01:30 iggy that said, I wouldn't rely on that... 2016.3 is still fairly new and if you end up with a minion with an old version it's going to crap itself when it sees that
01:31 nicksloan joined #salt
01:32 iggy John_Kang: do you see decompress_tomcat run but not ownership_tomcat? because they have the same onchanges, so one should not run without the other
01:34 hemebond ownership should also require the decompress, no?
01:34 hemebond Otherwise could it not run beforehand?
01:42 infrmnt1 joined #salt
01:47 John_Kang i just got back, sorry for late response
01:59 jas02 joined #salt
02:01 matth is it possible to loop a pillar which have this structure : instances: ['val1', 'val2', 'val3'] ?
02:01 iggy matth: yaml should parse that as a list automatically
02:03 matth if the pillar is like that :       level_1:     level_2:      instances: ['val1', 'val2', 'val3']       how should look the loop, i'm a bit confused about that.
02:04 matth {% for instance in pillar.get('level_1:level2:instances', {}).items() %}
02:05 codeape joined #salt
02:07 matth iggy: :D got it.
02:07 iggy yeah, that's a list, not a dict
02:07 iggy hopefully that was the solution you came up with
02:08 matth without the .items()
02:08 iggy and change the default to [] instead of {}
02:08 matth hoo right.
02:14 DammitJim joined #salt
02:23 jas02 joined #salt
02:23 netcho_ joined #salt
02:24 rem5 joined #salt
02:24 rem5 joined #salt
02:26 mpanetta joined #salt
02:27 west575 left #salt
02:38 John_Kang iggy: hemebond: sorry to be late, It says "Recursive requisite found" on decompress_{{ tomcat_src }}
02:38 John_Kang uh oh pastebin has been expired
02:39 John_Kang http://pastebin.com/14kA1ZgF
02:39 John_Kang If i remove 12 line, it works
02:39 John_Kang but i don't want to excute it unless the source file changes
02:41 sebastian-w joined #salt
02:42 hemebond John_Kang: Which state fails with that message?
02:46 John_Kang decompress_{{ tomcat_src }}
02:46 John_Kang the comment says Recursive requisite found
02:46 hemebond decompress_tomcat fails with that message?
02:46 John_Kang yes
02:46 hemebond I don't know what tomcat_src is
02:46 John_Kang if i remove 11,12 lines
02:46 John_Kang it works
02:46 John_Kang ah sorry
02:46 John_Kang /usr/local/src/tomcat.tar.gz
02:46 hemebond Line 4 is incorrect.
02:46 John_Kang oh.. really?
02:46 hemebond Well you have no state called decompress_{{ tomcat_src }}
02:46 hemebond or decompress_/usr/local/src/tomcat.tar.gz
02:46 catpigger joined #salt
02:46 hemebond So I'm not sure why you're getting that message.
02:46 John_Kang sorry, actually, the pastebin was made by hand
02:46 hemebond ah
02:46 John_Kang because I can't use clipboard on my laptop
02:46 John_Kang let me give you clarification again
02:46 John_Kang the error says that "Recrusive requisite found" on decompress_tomcat
02:46 John_Kang if i remove 11,12 lines, it works then
02:46 hemebond Change "- /usr/local/src/tomcat.tar.gz" to "- file: /usr/local/src/tomcat.tar.gz"
02:46 John_Kang roger that
02:46 hemebond And make sure those lines are indented properly.
02:47 John_Kang kk
02:47 hemebond Paste it into http://yaml-online-parser.appspot.com/ to make sure it parses how you expect.
02:49 John_Kang it doesn't work
02:50 hemebond What doesn't work?
02:50 John_Kang it is the same as before
02:50 hemebond Need you to paste exactly what you're running.
02:50 John_Kang okay
02:50 John_Kang let me try
02:53 akhter joined #salt
02:54 John_Kang http://pastebin.com/UW5pwSUK
02:55 John_Kang pasted it with error
02:55 hemebond change "- file: /usr/local/src/{{ tomcat_src }}.tar.gz"
02:55 hemebond to "- file: deploy_{{ tomcat_src }}"
02:56 John_Kang yeah, that is the same as previous one
02:56 John_Kang you had me to change it to file
02:57 hemebond It's the second half that needs to be changed this time.
02:57 John_Kang once, i will change it back again as your advice
02:57 hemebond You just had a file path
02:57 hemebond What you need is the state ID.
02:57 hemebond The format is "- module: state_id"
02:57 hemebond You just had "- /path/to/gz/file"
02:58 John_Kang okay
02:58 John_Kang changed to
02:58 John_Kang - onchanges:
02:58 John_Kang -deploy_{{ tomcat_src }}
02:58 hemebond You've lost the file:
02:58 John_Kang but result is the same :(
02:59 hemebond "- file: deploy_{{ tomcat_src }}"
02:59 John_Kang uh?
02:59 John_Kang - file: deploy_{{ tomcat_src }}
02:59 hemebond The module is "file"
02:59 hemebond Correct
02:59 John_Kang kk
02:59 John_Kang same T.T
03:00 hemebond Can you update your gist?
03:00 John_Kang okay
03:01 fracklen joined #salt
03:02 John_Kang https://gist.github.com/upgradeksh/f85dd8ba6bab747a25edf8fcc5edb536
03:02 hemebond Can you add the highstate output to it?
03:02 John_Kang sure
03:04 John_Kang but the highstate too big to see
03:06 John_Kang hemebond: i am sorry but i can't upload the hightstate for security reason :(
03:06 hemebond Not even the bits related to the states you're debugging like you did before?
03:06 hemebond That's all I need to see is what you pasted before.
03:08 John_Kang but the state is not in the top file
03:08 John_Kang the state will be using explicitly
03:08 John_Kang with salt-call
03:08 hemebond Sorry, when I said highstate output I just meant the result output like you did in http://pastebin.com/UW5pwSUK
03:08 John_Kang ah
03:09 John_Kang i thought state.show_highstate
03:09 hemebond No, no, the output format is the highstate format.
03:09 hemebond highstate output format.
03:09 John_Kang okay'
03:11 John_Kang commected
03:11 John_Kang commented*
03:11 John_Kang i am sorry give me 1min, brb
03:11 bastiandg joined #salt
03:12 hemebond Okay I see the problem.
03:12 hemebond You currently have "- file: decompress_{{ tomcat_src }}" on the "decompress_{{ tomcat_src }}" state
03:12 hemebond What you want is "- file: deploy_{{ tomcat_src }}"
03:12 hemebond "deploy", not "decompress"
03:24 jas02 joined #salt
03:25 John_Kang hemebond: sorry? i don't get it
03:25 hemebond You got the state ID wrong in the onchanges
03:25 John_Kang on decompress_{{ tomcat_src }} ?
03:25 hemebond Yes
03:26 hemebond It should be "deploy"
03:26 John_Kang ah...
03:26 John_Kang uh?
03:27 hemebond http://paste.debian.net/893491/
03:28 John_Kang yeah that's typo
03:28 John_Kang let me try run it again
03:29 John_Kang when i paste it to gist there was a typo
03:29 John_Kang it was deploy_ originally
03:31 John_Kang hemebond: btw, i appreciate for you time
03:31 John_Kang thank you so much
03:31 hemebond Happy to help :-)
03:33 John_Kang let me try to keep finding the clue :(
03:33 hemebond Recursive reference means you are trying to require the state you're already on (the deploy/decompress mixup) or a state that requires your state.
03:34 hemebond (probably just the former actually)
13:06 ilbot3 joined #salt
13:06 Topic for #salt is now Welcome to #salt! | Latest Versions: 2015.8.12, 2016.3.4 | 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
13:06 rem5_ joined #salt
13:10 edrocks joined #salt
13:12 keimlink joined #salt
13:13 DanyC joined #salt
13:34 awiss joined #salt
13:36 jas02 joined #salt
13:37 Brew joined #salt
13:45 amcorreia joined #salt
13:56 abonilla joined #salt
14:02 numkem joined #salt
14:06 IgorK__ joined #salt
14:06 IgorK__ Hello
14:06 ferbla joined #salt
14:06 IgorK__ can anyone help with this question https://github.com/saltstack/salt/issues/37536 ?
14:06 saltstackbot [#37536][OPEN] No matching salt environment for environment 'dev' found", "No matching sls found for 'dev.backend' in env 'dev' | I'm trying to create environments for my project...
14:09 jas02 joined #salt
14:09 xenocode joined #salt
14:13 schemanic_ joined #salt
14:16 schemanic_ Hello
14:16 Rumbles hi
14:16 stooj joined #salt
14:16 Rumbles not sure about environments IgorK__, I don't use them, I'm sure someone will get back to you though
14:17 DEger joined #salt
14:17 schemanic_ yesterday I was here asking for some help with SaltStack on Amazon Linux. apparently it's using python 2.6 while all of my python modules that I'm trying to install are on python 2.7. Can anyone help me get it installed and using python 2.7?
14:18 IgorK__ Amazon have no python 2.7 preinstalled? really?
14:18 schemanic_ No IgorK, it does
14:18 Rumbles quick google gets me: https://gist.github.com/jnrbsn/8062545
14:18 Rumbles looks like it's a red hat based distro
14:18 racooper joined #salt
14:19 Rumbles centos 6 probably if it uses 2.6
14:19 schemanic_ No guys
14:19 schemanic_ python2.7 is installed
14:19 Rumbles it's installed but not the default
14:19 Rumbles ?
14:19 Rumbles don't change it
14:19 schemanic_ no its the default too
14:19 Rumbles it will probably not boot if you change the default
14:19 Rumbles ok
14:19 Rumbles so what's the probalem?
14:20 Sketch by the default do you mean it's /usr/bin/python
14:20 * Rumbles can't spell
14:20 schemanic_ yes I mean by default it's /usr/bin/python
14:20 Sketch where did you install salt from?
14:20 schemanic_ https://repo.saltstack.com/#amzn
14:20 schemanic_ from that
14:21 Rumbles ok, what's the problem?
14:21 schemanic_ the saltstack that gets installed explicitly calls python 2.6
14:21 schemanic_ salt --versions-report
14:22 schemanic_ here let me gist it to you:
14:22 Sketch yep, looks like it actually installs the salt for rhel6
14:22 Sketch name=SaltStack 2016.3 Release Channel for Amazon Linux
14:22 Sketch baseurl=https://repo.saltstack.com/yum/redhat/6/$basearch/2016.3
14:22 DEger joined #salt
14:22 schemanic_ how do I fix that? I need pygit support
14:23 Sketch did you install python 2.7 manually, or did it come that way?
14:23 schemanic_ it came that way
14:23 Sketch i guess salt's amazon repo must be out of date then...
14:23 Rumbles you shouldn't fix salt, it's probably set up right, if you need pygit you should probably install it for puthon2.6
14:23 schemanic_ you CANT
14:23 Sketch you might try installing the rhel7 repo instead
14:23 Rumbles no, rhel machines use python 2.6 as the default python
14:24 Sketch rhel7 uses python 2.7
14:24 Rumbles sorry rhel6
14:24 Rumbles you can't what?
14:24 Sketch i'm assuming he means pygit doesn't support python2.6
14:24 schemanic_ you cant install pygit2 under python2.6
14:25 Sketch (which i have no knowledge of either way, but 2.6 is pretty old so i wouldn't be too surprised)
14:25 Rumbles you can it's just not officially supported
14:25 schemanic_ Is there a way to tell salt to install from the rhel7 repo
14:25 schemanic_ ?
14:25 Rumbles or at least their docs say i should work
14:25 Sketch anyway, if it came with python2.7 and not python2.6, it sounds like he would likely be better off using the rhel7 repo instead
14:25 racooper python-pygit2 is in EPEL for CentOS 6
14:26 racooper do not install a CentOS 7 repo on CentOS 6. ever. you'll screw up more than you'll gain from it.
14:26 Rumbles schemanic_, what do you get from "cat /etc/redhat-release" ?
14:26 schemanic_ a moment
14:26 schemanic_ there is no such file
14:26 Sketch schemanic_: you could either modify the existing /etc/yum.repos.d/salt-<version_.repo file to point to redhat/7/ instead of redhat/6/
14:26 Rumbles ah right
14:26 Rumbles worth a shot
14:26 Rumbles sorry :)
14:26 schemanic_ there is /etc/system-release
14:26 Sketch or just install the rhel7 repo from https://repo.saltstack.com/#rhel
14:27 Rumbles what's in that?
14:27 racooper schemanic_,  can you post the output of 'uname -a'?
14:27 Rumbles or that
14:28 schemanic_ https://gist.github.com/anonymous/a1d68a89a21236ff21d0f5d2059173a9
14:29 racooper yeah...that's not CentOS 6. I'm highly doubtful it's even centos, at least not one that #centos would support.
14:29 racooper centos 6 is running kernel 2.6.32. Looks like that's some bastardized amazon....thing.
14:29 Rumbles it's just centos like
14:30 GnuLxUsr joined #salt
14:30 Rumbles 4.4 is probably a fedora fork
14:30 Sketch since it has python 2.7, i'd guess it's centos 7 based with an updated kernel
14:30 racooper if you're running in AWS you can load an actual CentOS image and start from there; you'd be better off.  Or you can go to Amazon for support, since it's their OS mess.
14:30 Rumbles schemanic_, did you try "yum install python-pygit2" like racooper suggested??
14:31 schemanic_ no I did not
14:31 Rumbles you never know
14:31 schemanic_ no such package
14:31 Tanta joined #salt
14:31 racooper CentOS 7 is kernel 3.10.0, so it's not even that.  like Rumbles said, it may be taken from fedora. I would not trust any of the normal repositories on that system.
14:32 Rumbles or "yum search pygit"
14:32 Sketch either way, looks like the salt amazon packages are out of date.  i'd try the rhel7/centos7 ones and see if they work.
14:32 schemanic_ no dice Rumbles
14:33 Rumbles not sure then #aws might be your friend
14:33 Rumbles sorry
14:33 Rumbles ##aws
14:33 jeddi joined #salt
14:37 writtenoff joined #salt
14:40 akhter joined #salt
14:41 yelin joined #salt
14:42 schemanic_ I'm going to try with the RHEL packages and see what happens
14:42 nicksloan joined #salt
14:43 yelin hi there, I've got a strange thing on salt 2016.3.3. I deleted a state from my top.sls, but salt still want to apply it. Is there a cache or something like this ? Thanks :=)
14:44 greyeax_ joined #salt
14:45 IgorK__ salt '*' saltutil.clear_cache
14:45 IgorK__ or saltutil.sync_all
14:46 _JZ_ joined #salt
14:46 subsignal joined #salt
14:46 Sketch i have noticed that 2016.3.3 seems to continue to cache old grains even after a saltutil.sync_all
14:47 Sketch to the point where i sometimes have to restart the minion to get it to actually update
14:47 IgorK__ but he need to sync states
14:48 yelin There is no effects with those two commands
14:48 yelin I tried to stop the minion, run the command and restart it.
14:49 babilen "salt-run fileserver.update"
14:50 patarr joined #salt
14:50 jas02 joined #salt
14:51 yelin There is no effects either
14:52 yelin It still try to apply the state :(
14:54 ronnix joined #salt
14:56 babilen yelin: How did you "delete" it?
14:56 ronnix joined #salt
14:58 yelin I deleted the line which match the server in the top.sls
15:01 gtmanfred it is odd to troubleshoot someones issue live in a github issue...
15:03 gtmanfred https://github.com/saltstack/salt/issues/37536
15:03 saltstackbot [#37536][OPEN] No matching salt environment for environment 'dev' found", "No matching sls found for 'dev.backend' in env 'dev' | I'm trying to create environments for my project...
15:09 gtmanfred racooper: that is amazon linux, not centos 7, it lists it at the top in /etc/system-release
15:09 lorengordon heh, yeah, salt seems to often get usage questions as github issues...
15:10 mpanetta joined #salt
15:10 lorengordon the live troubleshooting is a new one to me though :p
15:11 mpanetta joined #salt
15:12 schemanic_ Okay so trying to install from redhat/centos repo says that there are packages missing
15:13 gtmanfred schemanic_: what are you trying to do, get pygit2 on python27 in amazon linux?
15:13 schemanic_ yes gtmanfred
15:13 gtmanfred pip install it
15:13 schemanic_ install saltstack?
15:13 gtmanfred pip install pygit2
15:13 schemanic_ already done
15:13 gtmanfred then what is the problem? that salt is in a python26 environment?
15:14 schemanic_ saltstack on amazon linux FORCES you to use python 2.6
15:14 Danksgiving2016 joined #salt
15:14 gtmanfred if you can't get it to work, pip install saltstack
15:14 schemanic_ yes gtmanfred
15:14 gtmanfred it won't be supported, but amazon linux is already just best effort support anyway
15:14 gtmanfred or stop using amazon linux
15:14 gtmanfred it is a bastardized version of a stable operating system
15:14 schemanic_ I dont have a choice in the matter to be honest
15:15 schemanic_ the company has standardized around it
15:15 gtmanfred is there a reason you cant use GitPython?
15:15 gtmanfred because that should be able to be pip installed on python26
15:15 schemanic_ gitPython doesn't allow you to use ssh
15:15 gtmanfred yes it does, it just requires more configuration outside of salt
15:15 gtmanfred set your ssh key in ~/.ssh/config
15:15 gtmanfred and it can be used
15:16 yelin anyone have another idea for my problem ? :)
15:16 schemanic_ does gitpython require libssh?
15:16 gtmanfred no
15:16 schemanic_ ahh
15:17 schemanic_ can I use gitpython for pillar as well?
15:17 gtmanfred yes
15:17 schemanic_ k. let me give that a shot
15:17 gtmanfred I use it for both
15:17 schemanic_ I'll be picking your brain I guess. Thanks for the pointer
15:17 gtmanfred but i also use git:// links... but I used to use ssh links for my pillars when they had ssl certs in it
15:18 Danksgiving2016 Good morning! Any renderer experts in here?
15:18 gtmanfred schemanic_: schemanic_: if you can ssh to git with your /root/.ssh/config and not have to put in a password, then just put git@<domain>:path/to/gitrepo as your repository in the configuration
15:18 gtmanfred Danksgiving2016: ask the question please
15:18 Danksgiving2016 sure thing
15:18 Danksgiving2016 I have a state with the a variable set to:   {% set arguments = (queue.get('arguments')|json %} and when it renders it sets arguments to "{'x-dead-letter-exchange': 'wasabiError', 'x-message-ttl': 86400000}"
15:18 tiwula joined #salt
15:19 Danksgiving2016 any idea how to get that to actual JSON using double-quotes instead of single quotes?
15:19 keltim joined #salt
15:19 gtmanfred what is queue?
15:20 Danksgiving2016 https://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.queue.html
15:20 AndreasLutro Danksgiving2016: your problem is that queue.get('arguments') returns a string, not a dict
15:21 Danksgiving2016 is there a better way of doing that?
15:21 gtmanfred AndreasLutro: but he is trying to pass it through |json to dump it
15:21 AndreasLutro Danksgiving2016: that documentation page doesn't show how you got the "queue" variable in your sls
15:22 gtmanfred {%- set queue = salt.queue %}
15:22 Danksgiving2016 yeah, I inherited this state
15:22 Danksgiving2016 {% for queue_name, queue in pillar['engineering_services']['queues'].items() %}
15:23 gtmanfred Danksgiving2016: you could use the load_json filter instead of json and do
15:23 AndreasLutro ok so look for the pillar file that defines engineering_services -> queues
15:23 gtmanfred {%- load_json as argument %}
15:23 gtmanfred {{queue.get(arguments)%}
15:23 gtmanfred {%- endload %}
15:23 AndreasLutro that ^ will work if you can't fix it at the root
15:24 AndreasLutro for whatever reason
15:24 Danksgiving2016 so that needs to go in the pillar?
15:24 gtmanfred but the |json i don't know if that works
15:25 Danksgiving2016 yeah, I tried |json|safe also
15:25 gtmanfred https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html#salt.utils.jinja.SerializerExtension it certainly looks like it should
15:25 gtmanfred oh
15:25 gtmanfred i know the problem
15:25 gtmanfred Danksgiving2016: yeah, you would need to make sure that queue.get returns a dictionary, not a string, cause json does not do a json.dumps, it just converts it to json with double quotes
15:26 gtmanfred so you need to do a load_json to convert it to a dictionary first
15:26 gtmanfred Danksgiving2016: try queue.get('arguments')|load_json
15:26 gtmanfred as described under the load_filters in that doc i just linked
15:26 Danksgiving2016 will do. I'll report back shortly
15:27 Danksgiving2016 thanks so much!
15:28 ivanjaros joined #salt
15:30 v0rtex joined #salt
15:31 DEger joined #salt
15:34 cscf When I run ' salt-call grains.get ip4_interfaces ' I get a list of interfaces and IP's, like I expect.  How do I get just the IP for eth0?  Neither space or a . then worked
15:34 cscf * then 'eth0' worked
15:35 Danksgiving2016 salt * network.interface_ip eth0 always works for me
15:35 Danksgiving2016 also, TemplateRuntimeError: Unable to load json from {'x-message-ttl': 86400000, 'x-dead-letter-exchange': 'wasabiError'}
15:35 mikecmpb_ joined #salt
15:37 cscf Danksgiving2016, ok network.interface_ip eth0 worked.  Is that a grain?
15:38 jas02 joined #salt
15:38 cscf {{ network.interface_ip['eth0'] }} didn't work, network not defined
15:39 jas02 joined #salt
15:39 gtmanfred cscf: {{salt.network.interface_ip('eth0') }}
15:40 gtmanfred it is a module, not a grain
15:40 Danksgiving2016 gtmanfred typed it faster than I could
15:40 cscf gtmanfred, excellent thanks
15:40 gtmanfred alternatively
15:40 gtmanfred salt-call grains.get ip4_interfaces:eth0:0
15:41 gtmanfred or {{salt.grains.get('ip4_interfaces:eth0:0')}} will give you the first ip in the list of eth0 ips
15:42 cscf Is it better practice to use grains instead of modules?
15:43 gtmanfred ¯\(°_o)/¯
15:43 gtmanfred depends on what you are trying to do
15:43 gtmanfred whichever one works best, In this case, I usually use the network module
15:43 cscf Ok thanks
15:45 gtmanfred cscf: there is also a subnet network module, that can find the ip address on a server that falls  in a specific cidr
15:45 gtmanfred which is super usefull
15:45 cscf gtmanfred, that does sound useful
15:46 cscf So you can say ' what's the IP on the management network'
15:46 gtmanfred yeah
15:47 jas02 joined #salt
15:49 pcn so, I'm back to sqare 1.  How wold I test to see if the local minion is running and connected to a master? Using salt-call test.ping will work even when the minion isn't running.
15:49 gtmanfred salt-call saltutil.is_running
15:50 gtmanfred nah, not that
15:50 gtmanfred hrm
15:51 haam3r joined #salt
15:51 schemanic_ gtmanfred
15:51 Sketch pcn: uh, no it won't
15:51 gtmanfred pcn: you could just check ps aux | grep salt-minion ?
15:51 schemanic_ I installed pip 2.6 and then installed gitpython and salts STILL did not pick it up
15:52 gtmanfred Sketch: yes it will, salt-call starts up a new minion instance, it doesn't send commands through a currently running salt-minion daemon
15:52 Sketch oh, i see
15:53 schemanic_ wait
15:53 gtmanfred that is why salt-call can be slower than a salt \* test.ping, and you can see stuff like refreshed grains when you do salt-call pillar.get
15:53 schemanic_ I need to restart it
15:53 gtmanfred but not when you do salt \* pillar.get
15:54 gtmanfred because the minion starts up and refreshes everything, whereas the constantly running minion needs to trigger a pillar_refresh
15:55 pcn gtmanfred: I can see if it's running, but I can't see if e.g. it's still pointing to a dead saltmaster after I've re-configured the masters IP address in the minion conf.
15:55 pcn I'm looking for ways to ask the minion how it's doing.
15:55 gtmanfred i am not sure that there is a way to ask the minion that, cause there is not a way to connect to a running minion, except through the master
15:56 gtmanfred so i would just do a salt-run manage.status on the master, and if the minion is listed as down, restart it
15:57 keimlink joined #salt
15:57 pcn my use case is to recover after replacing a salt master in ec2, so I want to have the information necessary to determine that I need to force the minion to restart.
15:57 pcn especially in the absence of a saltmaster
15:58 schemanic_ Can someone please help me understand why salt cant find python modules when I know that pip2.6 is installed and the salt packages are installed
15:58 gtmanfred throw an import sys; print(sys.path) in the salt-master executable, and see what it prints out
15:58 gtmanfred and if the path to the gitpython module is in that path
15:59 schemanic_ gtmanfred, I just tried doing what you said and going with gitpython  and no dice, I installed pip 2.6 then installed gitpython and salt --versions-report still says that gitpython is not installed
15:59 yelin left #salt
15:59 schemanic_ gtmanfred, where is the salt-master executable?
15:59 gtmanfred `which salt-master`
15:59 gtmanfred then add PYTHONPATH variable with that path in it to sysconfig file for the salt-master daemon
15:59 gtmanfred daemon/init.d file since amazon linux still hasn't moved to systemd
16:04 schemanic_ gtmanfred, my python2.6 packages are going to /usr/local/lib/python2.6/site-packages, which isnt in the sys.path that was printed from your instruction
16:05 gtmanfred take your sys.path, add /usr/local/lib/python2.6/site-packages to it, and drop that in probably... /etc/sysconfig/salt-master
16:06 gtmanfred https://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH
16:06 schemanic_ gtmanfred, no that doesnt exist. there is /etc/init.d/salt-master
16:06 gtmanfred check /etc/init.d/salt-master, it should source /etc/sysconfig/$NAME
16:06 gtmanfred which is /etc/sysconfig/salt-master
16:07 schemanic_ that file doesn't exist though
16:07 gtmanfred it should also have a [ -f /etc/sysconfig/$NAME ] to make sure that file doesn't exist
16:07 gtmanfred that is fine, make it
16:07 Ni3mm4nd joined #salt
16:07 gtmanfred the init.d file probably has a check if it exists before sourcing it
16:07 schemanic_ but what If I have multiple pythons on the system?
16:07 schemanic_ is PYTHONPATH local to thepython version?
16:07 gtmanfred that is ok, the PYTHONPATH will only apply to the salt-master command in that one init.d script
16:07 gtmanfred it is only local to that bash script /etc/init.d/salt-master
16:08 schemanic_ well /etc/init.d/salt-master doesn't look for /etc/sysconfig/anything
16:09 gtmanfred curl -F 'f:1=<-' ix.io < /etc/init.d/salt-master
16:09 pcn gtmanfred: do you think that in the long term there'd be an interest in the minion having a status socket, endpoint, or something in order to get some insight into the minion locally?
16:11 gtmanfred sure, it would be usefull to be able to query the configured informatino about the minion locally
16:11 gtmanfred schemanic_: gimme that ix.io link of the init script
16:11 schemanic_ gtmanfred, http://ix.io/1Dtn
16:11 gtmanfred schemanic_: put the PYTHONPATH in /etc/default/salt
16:12 schemanic_ um
16:12 schemanic_ okay
16:12 schemanic_ that file doesnt exist
16:12 gtmanfred make it
16:12 gtmanfred if [ -f /etc/default/salt ]; then
16:12 gtmanfred . /etc/default/salt
16:12 gtmanfred fi
16:12 schemanic_ should I just make it and have that one line be in it?
16:12 gtmanfred yes
16:12 gtmanfred it doesn't get pacakged because the package would overwrite it
16:13 gtmanfred that line specifically exists in init scripts so that you can pass in environment variables like this
16:13 gtmanfred just put in export PYTHONPATH='<output of sys.path>:/usr/local/lib/python26/site-packages'
16:14 gtmanfred that way when the salt package updates, /etc/default/salt doesn't get overwritten
16:14 gtmanfred also not, the init.d script checks that the file exists with -f before sourcing it
16:14 gtmanfred also note*
16:15 schemanic_ okay I've added /usr/local/lib/python2.6/site-packages to the list object printed by the sys.path call we made earlier
16:15 gtmanfred now service salt-master restart and it should load
16:15 gtmanfred it won't appear in your salt --versions-report though
16:16 gtmanfred unless you run PYTHONPATH=.... salt --versions-report
16:16 gtmanfred also PYTHONPATH should be delimited like $PATH
16:17 schemanic_ Okay hang on a minute
16:17 amcorreia joined #salt
16:17 schemanic_ so I shouldint put things into /etc/defaults/salt in ['A', 'B', 'C'] form
16:17 gtmanfred no, it should be A:B:C
16:18 gtmanfred import os, sys; print(os.pathsep.join(sys.path))
16:18 gtmanfred in salt-master will print it out in the right format
16:19 gtmanfred you actually might be able to get away with just setting PYTHONPATH=/usr/local/lib/python26/site-packages
16:20 schemanic_ when you say that gtmanfred, do you mean like, the global environment variable?
16:20 gtmanfred schemanic_: tee /etc/default/salt <<< export PYTHONPATH=/usr/local/lib/python26/site-packages
16:20 gtmanfred schemanic_: https://docs.python.org/2/using/cmdline.html#envvar-PYTHONHOME describes how it should work, and from reading it, if you run the tee command i just gave you and restart salt-master, it should load the gitpython
16:21 schemanic_ got no such file or directory
16:21 gtmanfred or just run PYTHONPATH=/usr/local/lib/python26/site-packages salt --version-report
16:21 gtmanfred versions*
16:22 gtmanfred schemanic_: PYTHONPATH=/usr/local/lib/python26/site-packages salt --versions-report | curl -F 'f:1=<-' ix.io
16:23 schemanic_ http://ix.io/1DtD
16:23 schemanic_ still not installed
16:23 akhter joined #salt
16:24 schemanic_ its because you misspelled the path for python and i've been pasting you
16:24 schemanic_ hold on
16:24 schemanic_ its not python26 it's python2.6
16:24 gtmanfred bah sorry
16:24 sh123124213 joined #salt
16:24 schemanic_ not your fault
16:26 schemanic_ still not installed
16:26 gtmanfred this might be a case where the salt command is actually asking the master
16:27 schemanic_ Well yeah salt --versions-report replies even when salt-master is the only thing on the machine
16:27 gtmanfred can you make the /etc/default directory if it doesn't exist, and put 'export PYTHONPATH=/usr/local/lib/python2.6/site-packages' in it and restart the salt-master, and see if it loads gitpython in the master logs?
16:27 schemanic_ gtmanfred I have /etc/default/salkt
16:27 schemanic_ /etc/default/salt rather
16:27 gtmanfred with export PYTHONPATH=/usr/local/lib/python2.6/site-packages ?
16:27 schemanic_ right now it reads 'PYTHONPATH=/usr/local/lib/python2.6/site-package'
16:28 gtmanfred cool, throw export in front just to be certain that it is there for the python binary when salt-master gets run
16:28 gtmanfred then check if your git environment gets loaded
16:28 schemanic_ export  PYTHONPATH=/usr/local/lib/python2.6/site-packages
16:29 schemanic_ k, service salt-master restart
16:29 edrocks joined #salt
16:30 schemanic_ salt --versions-report reports the same thing
16:30 schemanic_ nothing changed
16:30 schemanic_ oh
16:30 schemanic_ in the master logs
16:30 schemanic_ hang on
16:30 gtmanfred check the /var/log/salt/master and see if it got loaded, because if you have /usr/local/lib/python2.6/site-packages/git it should load
16:31 ferbla joined #salt
16:33 schemanic_ nothing in the salt master log
16:34 schemanic_ I dont understand what's missing here
16:34 gtmanfred can you set the salt master to run with -l debug ?
16:34 abednarik joined #salt
16:35 gtmanfred because then it will print out if it loaded the git python module
16:35 gtmanfred also, make sure you don't have your gitprovider hard set to pygit2
16:36 schemanic_ gtmanfred, no its a new server that never had pygit on it
16:36 schemanic_ so what, service salt-master start -l
16:36 schemanic_ ?
16:37 gtmanfred put export MASTER_ARGS="-l debug" in /etc/default/salt
16:38 schemanic_ are you sure it's not /etc/defaultS
16:39 schemanic_ okay I've got debug messaging going
16:39 schemanic_ should I hit the log again?
16:39 gtmanfred from the init.d script, it is /etc/default
16:39 gtmanfred if [ -f /etc/default/salt ]; then
16:39 gtmanfred . /etc/default/salt
16:39 gtmanfred fi
16:40 tapoxi joined #salt
16:40 gtmanfred yeah, service salt-master restart
16:40 gtmanfred grep -i git /var/log/salt/master
16:40 schemanic_ less +G /var/log/salt/master | grep git gets nada
16:41 jas02_ joined #salt
16:41 gtmanfred you have the git backend configured already yeah?
16:41 schemanic_ no
16:41 schemanic_ there is no configuration on the system yet
16:41 gtmanfred configure it, and then see if the master imports it
16:41 schemanic_ what?
16:41 schemanic_ that doesn't make sense
16:41 schemanic_ I want to see that salt knows about gitpython before I try to set it up
16:42 schemanic_ why would it not load it? the problem is that it can't see the modules
16:42 N-Mi joined #salt
16:42 schemanic_ How do we know that it's actually using the python path that we set?
16:42 gtmanfred it takes two seconds to throw a sample one in there...
16:42 gtmanfred fileserver_backend:
16:42 gtmanfred - git
16:42 gtmanfred gitfs_remotes:
16:42 gtmanfred - git://github.com/gtmanfred/issue-37096
16:43 gtmanfred at least then it will give you an error that it can't load git python
16:43 gtmanfred cause it should try and show something like this `[DEBUG   ] gitpython gitfs_provider enabled`
16:44 gtmanfred so, if you don't enable the git fileserver backend, why would it ever want to load gitpython?
16:44 schemanic_ yep
16:45 schemanic_ 2016-11-08 16:44:27,550 [salt.utils.gitfs                                     ][CRITICAL][28632] No suitable gitfs provider module is installed.
16:45 gtmanfred grr
16:45 gtmanfred it is odd, cause it is seeing gitdb
16:45 gtmanfred which is a dependency of gitpython
16:45 gtmanfred schemanic_: pip26 freeze | curl -F 'f:1=<-' ix.io
16:46 schemanic_ http://ix.io/1Du3
16:46 schemanic_ see, it's there
16:46 gtmanfred that is super annoying
16:46 gtmanfred python26 -c 'import git; print git.__file__'
16:47 Rumbles you know you can just run git commands from within a python script right?
16:47 Rumbles might be easier than fixing this :)
16:47 schemanic_ No
16:48 schemanic_ It needs to work the way it says it's supposed to work
16:48 gtmanfred Rumbles: i am a masochist, see https://github.com/saltstack/salt/issues/37536
16:48 saltstackbot [#37536][OPEN] No matching salt environment for environment 'dev' found", "No matching sls found for 'dev.backend' in env 'dev' | I'm trying to create environments for my project...
16:48 schemanic_ I get a traceback
16:49 schemanic_ https://gist.github.com/anonymous/24c089e24efe7a02363fb1ae472acb4e
16:49 gtmanfred awesome
16:49 gtmanfred hrm, that is not a full traceback
16:49 gtmanfred python26 -c 'import git; print git.__file__' | curl -F 'f:1=<-' ix.io
16:49 schemanic_ I have to go though
16:49 gtmanfred schemanic_: try GitPython 1.0.1
16:49 sarcasticadmin joined #salt
16:49 gtmanfred schemanic_: pip26 install GitPython==1.0.1
16:49 schemanic_ It's not just that
16:50 schemanic_ its ALL pip modules
16:50 gtmanfred great
16:50 schemanic_ it sees NONE of them
16:50 schemanic_ thats the point
16:50 cmarzullo 561586
16:50 gtmanfred I would say, pip install salt to the python27 environment
16:50 gtmanfred instead of using the package
16:50 yetanotherzero joined #salt
16:50 schemanic_ does that get me EVERYTHING?
16:50 schemanic_ master, minion, cloud, api?
16:50 gtmanfred yes
16:51 schemanic_ okay. I'll try that next
16:52 Rumbles hmmmm, does anyone know if it's possible to reload apache if apache2ctl configtest succeeds? I was asking about this yesterday and I got this: https://paste.fedoraproject.org/475729/ but it doesn't seem to work
16:52 Rumbles when the file changes the state doesn't reload apache
16:53 gtmanfred Rumbles: get rid of the cmd.wait
16:53 gtmanfred and put an `onlyif: apachectl configtest` on the service.running
16:53 kukacz joined #salt
16:54 Rumbles thanks I will try
16:54 gtmanfred Rumbles: http://ix.io/1Du5
16:55 gtmanfred sorry, the onlyif should be in line with the reload
16:55 Rumbles but I only want it to run if the file changes that's why the apache-config-test state watches the config file
16:55 gtmanfred ahh, then put a watch on the file
16:56 Rumbles so, I want it to watch the file, if the file changes, run the configtest, if that passes, reload apache
16:56 gtmanfred also, i would use listen, cause then it will restart it at the very very end of all states running
16:56 Rumbles I have soemthing similar for nginx which works
16:56 haam3r joined #salt
16:56 gtmanfred http://ix.io/1Du7
16:56 amontalban joined #salt
16:57 gtmanfred Rumbles: ^^
16:57 Rumbles ok, I will test thanks
16:58 gtmanfred also, i love people using the apache configfile state that I wrote, was a fun day when I sat down and figure out the code to generate apache config files from yaml, eventually need to do it for nginx
16:58 Rumbles so it was you!
16:58 gtmanfred yes
16:58 Rumbles haha
16:58 gtmanfred https://github.com/saltstack/salt/blame/develop/salt/states/apache.py
16:59 Rumbles cool, it works well
16:59 Rumbles I had problems with LDAP auth, but I think that's me & apache not salt
16:59 nawwmz joined #salt
17:00 nawwmz using the openstack driver for salt-cloud, how do I add volumes?
17:00 gtmanfred we do have a bug out there working with salt + ldap via freeipa + eauth
17:00 nawwmz is it the same way as the nova driver?
17:00 abonilla joined #salt
17:00 subsignal joined #salt
17:00 gtmanfred nawwmz: i do not believe that the openstack driver has support for volumes
17:00 nawwmz omg
17:01 gtmanfred no references to volumes in https://docs.saltstack.com/en/latest/ref/clo
17:01 gtmanfred https://docs.saltstack.com/en/latest/ref/clouds/all/salt.cloud.clouds.openstack.html
17:01 nawwmz yeah :\
17:02 Rumbles hmmm that didn't restart apache either gtmanfred
17:03 shbst joined #salt
17:03 nawwmz gtmanfred: is the novaclient the alternative (best solution) for most comaptibility?
17:03 gtmanfred nawwmz: yes
17:03 gtmanfred Rumbles: can you paste your current set of states?
17:04 Rumbles 1 sec
17:04 gtmanfred Rumbles: also, I believe the onlyif in the sites-enabled symlink should be acutally an 'onchanges'
17:04 gtmanfred onlyif and unless are actually commands run on the commandline through cmd.retcode
17:04 Rumbles ok
17:06 Rumbles current config https://paste.fedoraproject.org/475745/62475514/ gtmanfred
17:06 gtmanfred oh
17:06 gtmanfred hrm...
17:06 gtmanfred give me a minute
17:06 Rumbles np
17:07 gtmanfred i gotta setup a minion to test on
17:07 Rumbles :)
17:08 Rumbles fyi, this is my nginx one I based my apache one on: https://paste.fedoraproject.org/475747/
17:08 Rumbles which seems to work well
17:08 gtmanfred so, you want a full restart instead of a reload?
17:09 Rumbles uh
17:09 Rumbles don't mind
17:09 gtmanfred or no, you want a reload
17:09 Rumbles it's not critical
17:09 jimklo joined #salt
17:09 gtmanfred yeah, lemme get this ubuntu minion up
17:10 * Rumbles shouldn't have waited until 5pm to find out this wasn't working still
17:12 gtmanfred lol
17:12 gtmanfred it is an apache: that you are watching, not file:
17:13 Rumbles sorry, don't get what you mean...
17:14 Rumbles is thata  thing?
17:14 Rumbles oh right
17:14 gtmanfred Rumbles: http://ix.io/1Duk
17:14 gtmanfred ID: reload-apache2
17:14 Rumbles oh right
17:14 gtmanfred and then it works for me
17:15 Rumbles cool
17:15 gtmanfred if i set it to Deny for instead of Deny from, it says onlyif could not execute
17:15 Rumbles I am testing again now
17:15 gtmanfred Comment: onlyif execution failed
17:15 gtmanfred and you could go back to the old way you were doing it with cmd.wait if you want the command to actually fail out
17:15 erewok joined #salt
17:15 gtmanfred fail out and show as red*
17:15 erewok Hi, all. I want to write a custom salt state.
17:15 gtmanfred have you read the document on it?
17:15 erewok but I want to install a 3rd-party lib for that custom state
17:16 Rumbles so that would return red if the configtest failed?
17:16 gtmanfred Rumbles: the one I gave you won't be red if the configtest failed
17:16 erewok and I can look up the location of site-packages that salt on my machine will use.
17:16 Rumbles yeah I meant if you used cmd.wait sorry
17:16 gtmanfred yeah if you used the cmd.wait, if the config test returned with a non 0, then it would be red in your highstate output
17:16 erewok but I Want to know if there's a generic way to figure out the salt python location
17:17 gtmanfred erewok: drop 'import sys; print sys.path' into the salt-master executable file?
17:17 toastedpenguin joined #salt
17:17 gtmanfred or make a custom module with that, that just returns the sys.path
17:18 erewok hmm. alright. I guess that's one way to go.
17:18 gtmanfred def sys_path():
17:18 erewok yeah, now that I think about it, what I want to do won't work
17:18 gtmanfred return sys.path
17:18 nicksloan joined #salt
17:19 Rumbles yey that worked
17:19 Rumbles thanks gtmanfred
17:19 gtmanfred dope
17:19 gtmanfred no problem o/
17:20 Rumbles cya o/
17:20 edrocks joined #salt
17:20 bltmiller joined #salt
17:22 gtmanfred aight, i am going to go make lunch, be back in an hour o/ good luck everyone
17:23 ozux joined #salt
17:25 abednarik joined #salt
17:29 yetanotherzero joined #salt
17:33 kcloinger joined #salt
17:34 wryfi joined #salt
17:34 kcloinger so why is salt and window desktop have differnt sorry about updates
17:34 kcloinger it is 64 copy of windows 2016
17:35 matth is it possible to access the pillar data in python via salt API ? I tried few things but it's complaining that __opts__ is not set, any idea ? thanks by advance
17:36 XenophonF joined #salt
17:37 ozux__ joined #salt
17:38 XenophonF babilen: i upgraded my freebsd master to 2016.3.4 today and couldn't replicate the problems i had with my centos master yesterday :(
17:38 Edgan joined #salt
17:39 XenophonF i'm going to upgrade the centos master to 2015.8, next
17:41 dendazen joined #salt
17:42 jas02 joined #salt
17:46 gtmanfred matth: you would need to load the pillar module using the minion_mods in salt.loader
17:46 akhter joined #salt
17:46 matth gtmanfred: would you mind to give me an example plese ?
17:47 gtmanfred matth:wait, which salt-api are you using? the salt client api or the salt-api with rest_cherrypy?
17:47 matth it's for a runner
17:47 matth python module.
17:48 jas02_ joined #salt
17:48 gtmanfred if you are in a runner module, you should be able to just do __runner__['pillar.show_pillar']('minion1')
17:48 matth gtmanfred: I just need to import salt.client for that ?
17:49 bltmiller joined #salt
17:49 gtmanfred you don't need to load anything
17:49 gtmanfred if you are writing a runner module, the __salt__ is already available in there
17:49 gtmanfred (sorry, not __runner__ i meant __salt__)
17:50 Elsmorian joined #salt
17:50 ronnix joined #salt
17:52 DEger joined #salt
17:53 gtmanfred matth: https://docs.saltstack.com/en/carbon/ref/states/all/salt.states.cloud.html
17:54 pipps joined #salt
17:55 matth gtmanfred:  __salt__['pillar.show_pillar']('minion1') will give me all the pillar for a specific minion ?
17:55 gtmanfred if you are in a runner module, it will give you all the pillar information about the minion1 minion
17:55 sh123124213 joined #salt
17:55 matth gtmanfred: ok, is it possible to target a specific pillar directly ?
17:56 Miouge joined #salt
17:56 gtmanfred not from a runner
17:56 gtmanfred if you want to do that, you need to initialize a LocalClient and do a local.cmd('pillar.get', 'pillar:to:get')
17:57 subsignal joined #salt
17:57 gtmanfred https://docs.saltstack.com/en/latest/ref/clients/#salt.client.LocalClient
17:57 matth oki. I thought it was possible to do so without using local.cmd.
17:57 matth but it's fine :)
17:58 matth thanks for the explaination.
17:58 sh123124213 gtmanfred: is there anyway to disable grains from loading at startup ?
17:58 kcloinger ERROR executing 'win_update.list_updates': The following keyword arguments are not valid: fields=['Title', 'Description'] WTF on 2012
17:59 schemanic_ hello gtmanfred, I'm about to proceed with pip installing saltstack to my amazon linux server
17:59 gtmanfred sh123124213: not as far as i am aware
17:59 Trauma joined #salt
17:59 nawwmz with salt-cloud/openstack, do I need to create a volume first before defining it in a profile? In ec2, we simply add the volume info and it creates it as part of the bootstrap process
18:00 nawwmz oh actually... probably not
18:02 pipps joined #salt
18:02 sh123124213 gtmanfred: thnx
18:04 losh joined #salt
18:08 schemanic_ gtmanfred, sudo pip install salt doesn't create any services or files on the system when you install it
18:09 schemanic_ it also doesn't create executables or... anything like whats documented
18:10 onlyanegg joined #salt
18:11 gtmanfred i just did it this morning, it creates the executables, it might put them in /usr/local/bin/, so you might have to add that to your path
18:12 fracklen joined #salt
18:12 schemanic_ how to you kick services this way? also where is /etc/salt and all the files that should be there?
18:12 gtmanfred it does not make any configuration files or service files, you will need to manage that, because that is the job of the package manager of the distribution, but since you can't use the package for the distro, because GitPython can't be installed there, you will need to manage it yourself
18:13 gtmanfred pip installs never put that stuff in place, because pip has know system like a backups file like rpm or dpkg do
18:13 gtmanfred has no*
18:13 jas02_ joined #salt
18:14 gtmanfred schemanic_: https://github.com/saltstack/salt/issues/37250 here is a bug discussing why that is the way it is
18:14 saltstackbot [#37250][OPEN] Salt config files not installed | Description of Issue/Question...
18:14 Miouge joined #salt
18:14 schemanic_ Thats not going to help me I'm afraid. I don't know what's supposed to be there or not, so I wont know that I'm missing something
18:14 pipps joined #salt
18:15 schemanic_ also I cant see where to trigger services
18:15 gtmanfred the files don't have anything configured by default anyway
18:15 schemanic_ yes but they inform what *can* be configured
18:15 gtmanfred they only ever use the default systems, so you just need to put the things that you want to configure in /etc/salt/master
18:15 sh123124213 gtmanfred : can you help me try to understand where os_data() in grains/core.py is called from ?
18:15 gtmanfred schemanic_: https://github.com/saltstack/salt/tree/develop/conf there are all the defaults
18:15 gtmanfred sh123124213: i cannot right now
18:15 sh123124213 I'll be here :P
18:16 schemanic_ Again managing things this way will be way too difficult
18:16 gtmanfred sh123124213: it should be somewhere under this function https://github.com/saltstack/salt/blob/develop/salt/loader.py#L619
18:16 schemanic_ I think I'm going to kill my server and try centos
18:17 sh123124213 if opts.get('skip_grains', False):
18:17 gtmanfred schemanic_: do it, you will have significantly less trouble
18:20 sh123124213 gtmanfred: thnx
18:21 haam3r joined #salt
18:22 lorengordon docs url for develop now points to carbon?
18:22 lorengordon e.g. https://docs.saltstack.com/en/carbon/topics/targeting/nodegroups.html
18:23 lorengordon kind of going to break link permanence, won't it? once carbon is released?
18:23 schemanic_ gtmanfred, where do I launch services from since service salt-master etc doesn't work with pip?
18:24 lorengordon huh, `develop` still works. but `carbon` is what google search is returning
18:24 gtmanfred lorengordon: they don't, yeah google is breaking it https://docs.saltstack.com/en/develop/topics/targeting/nodegroups.html
18:24 abonilla joined #salt
18:24 gtmanfred schemanic_: copy the init.d file on your own
18:24 pipps joined #salt
18:25 gtmanfred either write your own or try the same one from github https://github.com/saltstack/salt/blob/develop/pkg/suse/salt-master
18:25 lorengordon gtmanfred: cool, no problem then. if i'm googling, link permanence isn't so important...
18:25 gtmanfred that is the one the archlinux package installed
18:25 gtmanfred lorengordon: yeah, it is unfortunate, we are looking into fixing it
18:25 gtmanfred lorengordon: there is a bug already open
18:25 lorengordon oh ok, good
18:25 nawwmz we define "ssh_interface: private_ips" in our provider config, if we also define this at the profile level, will the profile config override the provider config?
18:26 schemanic_ Yeah that's not going to work. I am not going to splice this together piecemeal from the working package. The whole point of what I'm trying to do revolves around being able to reconstitute a master from one file  - /etc/salt/master. This is terrible for disaster recovery
18:27 schemanic_ I mean don't get me wrong I really appreciate your help this far
18:27 gtmanfred so, this just comes down to the fact that you can't use amazon linux then
18:27 gtmanfred because you can't have gitpython isntalled on python26 in amazonlinux environment
18:28 schemanic_ yes essentially.
18:28 schemanic_ well
18:28 schemanic_ no I can have gitpython installed on python26
18:28 schemanic_ but salt wont find it
18:28 schemanic_ thats the problem
18:28 gtmanfred not just that, it wouldn't load
18:28 gtmanfred it wasn't that salt couldn't find it
18:28 gtmanfred salt cloudn't import it
18:29 gtmanfred you tried to import it yourself in python26 binary with -c 'import git; print git.__file__' and it spit that error about unittests
18:29 schemanic_ ah thats true.
18:30 schemanic_ where does that git.__file__ come from anyway?
18:30 gtmanfred it is a builtin for all modules
18:30 gtmanfred it shows you which file has been used for importing the module
18:30 nawwmz in a map file, I have multiple hosts defined but i only want to target one host to build by name, how can that be done?
18:30 schemanic_ I'm wondering if theres another thing I havent installed yet
18:31 nawwmz thinking something like salt-cloud -m mymapfile 'cloud1-box'
18:31 gtmanfred nawwmz: you can't
18:31 gtmanfred the map file is specifically meant for managing the whole thing
18:31 bltmiller joined #salt
18:31 nawwmz hmm ok thx gtmanfred
18:34 nawwmz in salt-cloud/nova, within block_device, what exactly is "id: <image_id>" ?
18:34 nawwmz trying to create a new volume, so it wouldnt have any predefined volume id per se
18:34 gtmanfred nawwmz:have you used novaclient from the commandline?
18:35 kcloinger https://gist.github.com/sarasfox/79e192df6c0ee1d3e260a3aa9ce20196 so what i'm i doing wrong
18:35 nawwmz gtmanfred: a little, is the image_id the actual os image?
18:35 gtmanfred nawwmz: do nova help boot
18:35 gtmanfred and check the --block-device help
18:35 nawwmz kk thx
18:36 gtmanfred the block_device does the exact same stuff that the block-device does on the command line
18:36 nawwmz ahh k
18:37 gtmanfred nawwmz: this is still on my radar to add, but here is it all spelled out with a little more information http://ix.io/1DvA
18:37 Miouge joined #salt
18:37 gtmanfred nawwmz: if you want a blank volume, set source=blank and don't set id
18:37 nawwmz ahhhh thats it thx gtmanfred!
18:38 s_kunk joined #salt
18:38 gtmanfred no problem
18:39 impi joined #salt
18:44 nawwmz gtmanfred: is shutdown: <preserve/remove> the same as ec2's "del_root_vol_on_destroy" ?
18:45 akhter joined #salt
18:45 gtmanfred yes
18:45 nawwmz kk
18:45 gtmanfred but i think it only pertains to if the volume is a system root
18:45 gtmanfred but i am not 100% on that
18:45 nawwmz mmk
18:45 Rumbles joined #salt
18:45 gtmanfred it is worth keeping an eye on
18:46 nawwmz roger that
18:50 DammitJim joined #salt
18:51 DammitJim is there an easy way to clear out cache on a minion?
18:51 DammitJim the cache folder is like 1.5GB
18:52 kcloinger salt is doing a great job of failing to run windows updates
18:53 kcloinger So far it is liying or breaking
18:54 sp0097 joined #salt
18:54 nawwmz DammitJim: just an fyi, I've cleaned the entire cache directory but that caused the minion to fail and not run, forgot what i did to fix it but just to let you know in case you decide to go that route :)
18:54 DammitJim no problem
18:55 nawwmz DammitJim: https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.saltutil.html
18:55 nawwmz read the clear_cache
18:58 DammitJim ok
18:58 Elsmorian joined #salt
19:02 mavhq joined #salt
19:07 bowhunter joined #salt
19:08 subsignal joined #salt
19:10 XenophonF gtmanfred: del_root_vol_on_destroy only deletes the system root at termination
19:10 XenophonF IIRC there's another flag you can set that will delete other attached volumes at termination
19:11 XenophonF i trashed my aws setup for salt-cloud else i could tell you what it was
19:11 gtmanfred cool
19:11 XenophonF del_all_vol_on_destroy
19:11 gtmanfred cool, yeah i don't think openstack has an equivalent.
19:12 XenophonF https://docs.saltstack.com/en/latest/topics/cloud/aws.html
19:12 joka__ joined #salt
19:12 XenophonF no, i don't think so :(
19:17 samodid joined #salt
19:18 edrocks joined #salt
19:21 Elsmorian joined #salt
19:22 pipps joined #salt
19:23 pipps99 joined #salt
19:24 jas02_ joined #salt
19:26 nicksloan joined #salt
19:28 nawwmz gtmanfred: do you know how i can create an ephemeral disk the same size as the volume im creating? in ec2, we dont define the size for ephemeral not sure how to do that in openstack
19:30 austin_ joined #salt
19:30 austin_ i'm a little confused on syndic. the syndic shares the config with minion
19:30 gtmanfred just pass ephemeral under the block_device as the type
19:30 austin_ so should the syndic be seen as a minion itself?
19:30 nawwmz gtmanfred: kk thx
19:31 gtmanfred nawwmz: everything i know about the way openstack does block devices was in that ix.io i posted earlier
19:31 mikecmpbll joined #salt
19:31 nawwmz roger that
19:32 gtmanfred austin_: a syndic is only a way to push information from minions to the master, it does no commands, minions connect to it, and take commands from the master and then pass results back
19:33 austin_ gtmanfred: the downstream minion pings w/o
19:33 austin_ so clearly syndic was working
19:33 austin_ but if i ran manage.status, the syndic would show down
19:34 austin_ if i ran test.ping
19:34 austin_ the syndic would fail but the downstream minion1 would ping
19:35 austin_ but i think i may have solve that problem by pointing the minion config to the ip of master
19:35 austin_ it just was not clear in the syndic doc
19:35 austin_ if you ran a minion as well (which is what it suggests because why wouldn't you if you get performance boost)
19:39 Miouge joined #salt
19:43 MajObviousman hmm, this thing I'm doing seems like it should be possible, but I'm not sure the proper idiom to use or look up
19:44 gtmanfred austin_: i would email the salt-users mailing list so that more of the salt developer take a look at that comment.  Unfortunately I am working on something in the nova driver right now and can't go testing the syndic
19:44 gtmanfred sorry
19:44 MajObviousman if I have a distinct set of pillar data for each minion, can I do something like 'roles.crypto.{{ minion }}' in the pillar top file?
19:44 lionel joined #salt
19:49 austin_ gtmfred: ooooo good luck.
19:50 MajObviousman yep, looks like that works
19:50 MajObviousman not sure if it's a best practice or not
19:51 pipps joined #salt
19:53 xet7 joined #salt
19:54 sarcasticadmin left #salt
19:54 nidr0x joined #salt
19:54 dps joined #salt
19:55 geomacy joined #salt
19:55 gtmanfred austin_: it is my own fault, i wrote the original one, and I did an awful job of it :(
19:55 gtmanfred but... not entirely my fault,because keystoneauth1 didn't exist back when I originally wrote this
20:00 fracklen joined #salt
20:04 fracklen_ joined #salt
20:04 akhter joined #salt
20:06 keimlink joined #salt
20:10 heaje joined #salt
20:10 athaller joined #salt
20:12 amontalban joined #salt
20:16 iggy the openstack support in salt could use some freshening
20:16 iggy we wrote our own modules because we couldn't get the salt ones to work reliably
20:17 gtmanfred yeah
20:17 athaller joined #salt
20:17 gtmanfred i am working on refreshing the whole thing for nitrogen
20:17 * whytewolf can't wait for nitrogen
20:17 iggy ^5
20:17 gtmanfred https://github.com/saltstack/salt/issues/30272
20:17 saltstackbot [#30272][OPEN] [salt-cloud][nova] Move all openstack* command things over to using shade | http://docs.openstack.org/infra/shade/index.html...
20:18 gtmanfred which hopefully means that i will also have to do a few more patches to shade and get free pass to the openstack summit in boston
20:18 iggy subscribed
20:20 Miouge joined #salt
20:20 gtmanfred right now i am updating the nova driver to use keystoneauth1 to load the session for novaclient though, that is the first important thing
20:22 gtmanfred but right this second, i have to go buy $200 worth of whiskey to get through the election coverage tonight
20:23 nawwmz in openstack volumes, theres two types of volumes, performant and standard, how can I choose this as an option within my salt-cloud config?
20:27 akhter joined #salt
20:28 iggy use the salt.cloud modules/states instead
20:31 ronnix joined #salt
20:36 * MajObviousman hasn't yet used syndic
20:37 MajObviousman still low on the automation scaffolding with this environment
20:38 whytewolf i have not either. although it is in my todo for my next personal project. which i am dreading
20:38 MajObviousman dreading why, if I may ask
20:38 abednarik joined #salt
20:38 tiwula joined #salt
20:38 * MajObviousman chucks a ? onto the end of that last line
20:39 iggy last I tried it, it still didn't support mine, publish, grains caching, or master job cache properly
20:39 iggy although, that may have changed since then
20:39 tiwula joined #salt
20:40 whytewolf because it is a pretty big project. basicly starting with only an os on some hardware. and one box that is salted, build the salt-master then the openstack infrastructure/ then launch vms in the openstack infrastructure and keep updating all of the configs in tandum to make sure they are all working together
20:42 whytewolf it is just a lot of labor for a personal project
20:42 pipps joined #salt
20:43 whytewolf the end states should also exist on a public github repo. with base pillars in a private github repo
20:44 iggy I've been trying to work to that direction... really hard to have integrity for personal stuff
20:44 whytewolf this is very true
20:52 Elsmorian joined #salt
20:52 jschoolcraft joined #salt
20:52 jas02 joined #salt
20:55 whytewolf huh, never noticed that before. status.cpuinfo only returns the data on one processor in a system that has more then one physical processor
20:55 codeape joined #salt
20:58 tiwula joined #salt
20:58 promorphus joined #salt
20:59 keimlink joined #salt
21:01 ninjada joined #salt
21:01 yu_ joined #salt
21:07 DammitJim joined #salt
21:10 promorphus joined #salt
21:13 promorphus conceptual question: A minion phones in to the master, and as a result of a reactor, changes a file (on it's own server). After that action, I'd like the master to take an action in response to it. how exactly would I accomplish this?
21:13 akhter joined #salt
21:14 pipps joined #salt
21:16 iggy fire another event?
21:16 sh123124213 joined #salt
21:16 whytewolf have your original reactor setoff a orchestration?
21:18 promorphus how would I fire an event on the master in relation to a file change on a minion?
21:19 promorphus also, how would the orchestration work? (pointing me to docs is fine, I'm just not sure where to start)
21:19 whytewolf https://docs.saltstack.com/en/latest/topics/orchestrate/orchestrate_runner.html#orchestrate-runner
21:20 iggy !salt states.event.send
21:20 saltstackbot https://docs.saltstack.com/en/latest/ref/states/all/salt.states.event.html#salt.states.event.send
21:21 promorphus thanks, the event should handle this nicely. @whytewolf, I looked at that, but that seems to essentially orchestrate a series of events. Is it possible to trip that with a reactor?
21:22 abonilla joined #salt
21:23 whytewolf promorphus: orchestration is a series of commands that could go to many different servers. and yes you can trigger orchestration with reactors. see second example here https://docs.saltstack.com/en/latest/topics/reactor/#advanced-state-system-capabilities
21:24 promorphus thanks a ton, we've been manually kicking this off and it's been annoying as anything
21:30 tapoxi how do I do a dry run of state.apply?
21:31 mntnman joined #salt
21:31 tapoxi http://hastebin.com/ezarezejup.py
21:32 tapoxi oh nm
21:33 toanju joined #salt
21:33 gtmanfred test=True
21:33 tapoxi yeah the docs on salt.modules.state are a little confusing
21:33 tapoxi it just says 'test;
21:34 abonilla_ joined #salt
21:35 ronnix_ joined #salt
21:36 pipps joined #salt
21:42 abednarik joined #salt
21:52 ninjada joined #salt
21:53 onlyanegg joined #salt
21:56 sarcasticadmin joined #salt
21:57 wangofett I'm trying to get terse output... but it looks like something else entirely
21:59 dendazen joined #salt
21:59 akhter joined #salt
22:02 wangofett https://gist.github.com/waynew/3ce0c5ea621860b1efd71af47f9b8992
22:03 ninjada joined #salt
22:04 wangofett that's from salt --state-output=terse 'myminion' state.highstate
22:04 pipps99 joined #salt
22:06 pipps99 joined #salt
22:12 rem5 joined #salt
22:12 matth I try to use the event to trigger reactors. It's working fine, however, I have problems to get access to the data submitted by the event. I compiled the reactor and the event at http://pastebin.com/daP9RR4m. How do I get access to the data of the event from the reactor ? I tried {{ data['my_field'] }} and {{ data['data']['my_field'] }}  but it's emtpy. thanks you
22:16 ronnix joined #salt
22:19 nawwmz anyone familiar with centos?
22:19 haam3r joined #salt
22:20 akhter joined #salt
22:21 pipps joined #salt
22:22 jhauser joined #salt
22:22 whytewolf nawwmz: ask the question. if someone is they will answer
22:24 nawwmz re: centos7, my sysctl config is symlinked as "99-sysctl.conf -> ../sysctl.conf" seems like 99 is taking precedence over my custom config, anyone run into this?
22:24 nawwmz I cant do /etc/sysctl.d/98-postgres.conf and try to make my changes take precedence, not sure why the default is 99
22:25 cliluw joined #salt
22:26 Renich joined #salt
22:27 matth nawwmz: you dont need to put a number.
22:27 matth just put postgres.conf
22:28 matth that's why your setting are overwrite
22:32 akhter joined #salt
22:35 Xopher joined #salt
22:36 nawwmz matth: i tried but no cigar, if you could - check out my sysctl output http://pastebin.com/WLCz804D search for "kernel.sem"
22:37 nawwmz am i doing something wrong?
22:38 matth what's the problem ?
22:39 pipps joined #salt
22:39 nawwmz matth: basically that there may be kernel.sem defined in /etc/sysctl.conf but id like to override that value somehow using sysctl.d/
22:40 haam3r joined #salt
22:42 gtmanfred so, 99-sysctl.conf overrides everything is my understanding... but you could try putting 99-zzzz-postgres.conf
22:47 pipps joined #salt
22:48 nawwmz let me try
22:49 nawwmz nope still the same thing argghhh haha
22:50 nawwmz i dont get it, it loads /etc/sysctl.d/99-sysctl.conf, then it loads my custom config, then it loads /etc/sysctl.conf
22:50 pipps joined #salt
22:50 nawwmz and /etc/sysctl.conf is a symlink to 99-sysctl.conf
22:51 gtmanfred it shouldn't ever load /etc/sysctl.conf
22:51 gtmanfred that was deprecated in systemd
22:52 gtmanfred from what I was told
22:52 gtmanfred which is why it is symlinked to 99-sysctl.conf
22:52 nawwmz oh interesting.... so im doing a sysctl --system to reload
22:52 nawwmz could that be why?
22:52 gtmanfred that could be why um...
22:53 gtmanfred check systemctl cat systemd-sysctl.service
22:53 gtmanfred and run that command
22:53 gtmanfred or just systemctl restart systemd-sysctl.service
22:54 haam3r2 joined #salt
22:55 jas02 joined #salt
22:56 nawwmz still same thing, i just spun up a base centos 7 image on digital ocean and same thing
23:02 pipps joined #salt
23:04 pipps joined #salt
23:11 fracklen joined #salt
23:15 whytewolf so, why not change the setting in sysctl.conf?
23:15 whytewolf [by default in centos 7, sysctl.conf is blank]
23:16 abonilla joined #salt
23:17 whytewolf to keep this kinda relavent to salt https://docs.saltstack.com/en/latest/ref/states/all/salt.states.sysctl.html
23:18 whytewolf but /etc/sysctl.conf currently is still relavent and top tier presadent. only thing higher is tuned profiles
23:23 nawwmz whytewolf: just in case any apps add a value in there, we'd like to overwrite them
23:24 whytewolf again. /etc/sysctl.conf is the top tier. within sysctl it does not get higher
23:25 nawwmz ahh kk
23:25 nawwmz thx whytewolf
23:26 whytewolf the change for /etc/sysctl.conf going away compleatly is coming down the pipe line. but so far is only in fedora
23:27 akhter joined #salt
23:28 subsignal joined #salt
23:28 jas02_ joined #salt
23:30 pipps joined #salt
23:31 pipps99 joined #salt
23:31 ninjada_ joined #salt
23:38 mapu joined #salt
23:40 abednarik joined #salt
23:41 theproxy joined #salt

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