Tuesday, 2018-10-02

*** pvc has joined #ara05:10
pvchi05:10
pvcdmsimard05:10
pvcanyone05:11
*** gvincent has joined #ara06:13
apollo13dmsimard: oh it is back; hard to fix those though06:48
pvchi apollo1307:00
apollo13hi pvc07:00
pvchi07:01
pvcmay i know if it possible07:01
pvcthat i have one ara server for all of my ansible host07:01
*** apollo13 has quit IRC07:52
*** apollo13 has joined #ara07:54
*** pvc has quit IRC08:29
*** sshnaidm|off is now known as sshnaidm08:30
*** pvc has joined #ara10:41
pvchi10:41
pvccan i host an stand alone ara webserver10:41
pvcand add a node for that?10:42
apollo13I am not sure what you are asking10:58
pvci have a node for ara web server11:06
pvcthen i want a case that i can add another node to it11:06
pvcso one ara server then 5 ansible hosts11:06
*** pvc_ has joined #ara11:08
*** pvc has quit IRC11:11
*** pvc_ has quit IRC12:58
*** tbielawa has joined #ara13:09
dmsimardapollo13: he asked the same question last week... http://eavesdrop.openstack.org/irclogs/%23ara/%23ara.2018-09-27.log.html14:03
*** themurph has joined #ara14:07
*** Glandos has joined #ara14:16
apollo13dmsimard: ah well; btw I am considering to use ara (0.16) at work. Is there any way to abort the run if the callback plugin fails?14:19
apollo13ie we do not want to apply anything without logging it14:19
dmsimardapollo13: I don't think so but I invited a core dev to ask him about it :D14:28
*** bcoca has joined #ara14:29
dmsimardbcoca: apollo13 was asking if there would be a way for callbacks to actually kill the ansible run (for example if the callback fails or detects a failure that should result in the execution being killed)14:30
bcocacurrently only the stdout callback triggers that, all other callbacks are considered 'optional', but we can add a feature that you can toggle this from configuration (all callback failures are fatal)14:31
openstackgerritMerged openstack/ara-server master: Fixed tox warning.  https://review.openstack.org/60544314:31
openstackgerritMerged openstack/ara-server master: Run black & isort over the codebase.  https://review.openstack.org/60661514:32
bcocaand there are 2 diff ones, a) loading a plugin and b) executing a plugin method, in this case a 'event'14:32
dmsimardbcoca: sort of related, that reminds me .. does the callback type (other than stdout) actually do something ? cause I have this and it just works I guess https://github.com/openstack/ara-plugins/blob/master/ara/plugins/callback/ara_default.py#L4214:33
dmsimard¯\_(ツ)_/¯14:33
bcocanot currently, its mostly an indicator, i thought of restricting by type on what you could do but it seemed overkill14:34
dmsimardah, okay .. so what you suggested (all callback failures are fatal) could be an option I guess14:35
dmsimardI can file an issue about it if you want ? or something else14:36
bcocaissue is fine14:36
dmsimardapollo13, bcoca: https://github.com/ansible/ansible/issues/4639714:45
bcocanot sure i agree with that premiss, callbacks should not affect playbook execution, one thing is having callback errors cascade, another is them deciding play flow logic, that is what strategy plugins are for14:46
bcocaor just even tasks14:47
dmsimardbcoca: oh, feel free to correct me if I'm wrong -- I'm not really familiar with strategy plugins14:47
dmsimard(yet)14:47
bcocathey control play execution flow14:47
bcocadeafult is 'linear' but we have 'free' and 'host_pinned'14:48
bcocaopenstack has a 'aspect oriented strategy' that inserts tasks before/after each task14:48
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Added CI for black/isort.  https://review.openstack.org/60543914:51
dmsimard^ just rebased, there was a merge conflict because of the tox py3 fix14:51
*** tbielawa is now known as tbielawa|stand14:58
openstackgerritDavid Moreau Simard proposed openstack/ara-plugins master: Implement self-configuration of the callback through Ansible  https://review.openstack.org/60728014:59
openstackgerritDavid Moreau Simard proposed openstack/ara-plugins master: Update README.rst to be more accurate  https://review.openstack.org/60728114:59
dmsimardbcoca: for the docstring module config, I see https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/files/template.py and https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/action/template.py but there doesn't seem to be something like the set_options/get_option funcs ?15:04
dmsimardonly task.args which already existed15:05
bcocamodules use arg_spec which is totally diff15:06
bcocaaction plugins 'use nothing' as they mostly rely on modules .. template has had some code added but its not a 'framwork'15:06
bcocafor dealing with args, validation and conditions15:07
dmsimardoh but I asked yesterday about being able to pass in some parameters like the callback docstrings and you pointed me to template :p15:07
bcocano, you asked about documentation15:07
dmsimardhrm, must have not gotten across properly, sorry :/15:07
bcocai didnt realize the context was 'documentation also as config'15:07
bcocafor most plugins docs == config, modules and action plugins are the big exceptions15:08
bcocafilters/tests dont really have config15:08
dmsimardbcoca: context is some ara modules and the callback would share config (like api server url, etc.)15:08
dmsimardI can add a module arg for api server or source it from env15:08
bcocathis is why i wanted 'auth plugins'15:08
dmsimardthat would be kind of nice, auth is a bit all over the place right now15:09
bcocaagreed15:09
apollo13bcoca: my main reasoning is that part of our "audit" work is the requirement to log ansible executions, so even if the plugin fails to import I'd need to import15:09
bcocahence my proposal, but seems like there are diff workarounds for cloud and nework, so dont know if it will go anywhere15:10
dmsimardbcoca: I'll just use get_config from the modules (LOL)15:10
bcocamodules are not guaranteed to run on controller15:10
apollo13this will obviously not protect against a malicious user removing the callback in the first place, but at least relieves us from documenting all actions15:10
bcocaaction plugins are15:10
dmsimardbcoca: all ara has are action modules yeah15:10
dmsimardwhat's the spiritual successor to get_config ?15:11
bcocaget_config_value in lib/ansible/config/manager.py15:12
bcocaself.get_config_value_and_origin <= if you want to know 'where it came from'15:12
apollo13bcoca: the main issue with strategies is that I can override the default from a play itself15:13
apollo13aside from that, strategies do indeed look like a viable option for me15:13
bcocaapollo13: you can override most anything from the pllay itself15:13
bcocaplay15:13
apollo13bcoca: callbacks too?15:13
*** tbielawa|stand is now known as tbielawa15:13
bcocakindof, you can introduce new ones adjacent to play or by role, but they are not available for 'stdout'15:14
apollo13yeah, but that is harder than accidentally overriding a strategy :D15:14
bcocaso you cannot override stdout one, but you can the rest15:14
apollo13either way I get your point and will investigate if I can write my strategy that plays nicely with the ara callbacks15:15
bcocawhat conditions are you looking for to change play flow?15:15
apollo13ara callback failed to log -> abort15:16
bcocai would just end the callback in an exception and have the toggle i talked about15:16
apollo13yeah, that would work for me too15:16
bcocaCALLBACK_ERRORS_ARE_FATAL=false|true15:16
bcocathe way the ticket was phrased implied a more complex reasoning15:17
bcocai.e if host1/task3 is success but host2/task1 fails, end play15:17
apollo13sorry, I was away from the PC, didn't really notice that dmsimard filed a ticket at all15:17
bcocathat is why im not allowed out of the basement and i'm chained to my chair15:18
apollo13hehe, gotta run, cy tomorrow15:19
*** tbielawa is now known as tbielawa|mtgLife16:03
dmsimardARA got a mention on the AnsibleFest keynote this morning https://twitter.com/rcarrillocruz/status/1047147496638681089 :D16:13
dmsimardbcoca: the "more complex reasoning" just meant that instead of the callback exception'ing out, a callback go like sys.exit(1) and the end result would be the same16:26
dmsimardif it needs to be an exception, the calback could raise a custom one, etc.16:34
*** themurph has quit IRC17:08
*** mmercer has joined #ara17:14
mmercerhey guys, has anyone come up with a way of setting a config flag for 'USE_ARA' and 'NO_ARA' or similar ?17:15
mmercerthe one problem using ARA causes is that doing development then requires you to have an additional ansible.cfg based on your environment... in dev you dont necessarily have the same ara access that you do in prod... so you either have to do something wonky, or find a nice way of disabling it that doesnt cause failure to begin with17:15
mmercerI suppose by using ENV vars in prod, you can set prod so that it uses it, but dev does not...17:17
mmercersince you dont have to explicitly define the env vars anywhere else17:17
*** spiette has quit IRC17:26
bcocadmsimard: what reason to call 'sys.exit'? one thing is callback encountering fatal error another it is finding 'an exit condition'17:26
mmercerwow, im surprised to see bcoca in here, lol... xD17:28
*** spiette has joined #ara17:29
*** spiette has quit IRC17:29
bcocalike root, im everywhere, not always visible, but managing things in the background17:30
*** spiette has joined #ara17:38
*** themurph has joined #ara17:49
*** openstackgerrit has quit IRC17:51
mmercerdarn... my idea wont work the way i wanted because env variables override ansible.cfg18:12
*** openstackgerrit has joined #ara18:44
openstackgerritMerged openstack/ara-plugins master: Implement self-configuration of the callback through Ansible  https://review.openstack.org/60728018:44
openstackgerritMerged openstack/ara-server master: Added CI for black/isort.  https://review.openstack.org/60543918:52
*** bcoca has quit IRC18:58
*** bcoca has joined #ara18:58
dmsimardmmercer: interestingly enough you're not the first person to ask this kind of question19:04
dmsimardThere's no toggle in ARA to disable itself because if you don't want to enable ara, you actually don't specify it as a callback19:04
dmsimardmmercer: you could effectively do something like "export ANSIBLE_CALLBACK_PLUGINS=" to not make ansible load ara19:06
dmsimardbcoca: I dunno, exiting cleanly instead of raising an exception ?19:07
openstackgerritDavid Moreau Simard proposed openstack/ara-plugins master: Update README.rst to be more accurate  https://review.openstack.org/60728119:12
*** spiette has quit IRC19:18
*** spiette has joined #ara19:21
*** tbielawa|mtgLife is now known as tbielawa|lunch19:23
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Implement API for ARA records  https://review.openstack.org/60735419:44
mmercermeh, i settled for creating a separated version of ansible.cfg for prod/dev, and then linked it for prod.  added it to gitignore, and now in dev, you can just relink it against local20:09
*** Serienmorder has joined #ara20:09
dmsimard¯\_(ツ)_/¯20:11
SerienmorderHow's it going dmsimard20:11
dmsimardbcoca: trying to port a feature from 0.x to 1.0 and it's not straightforward, was wondering if you would come up with an idea... tl;dr, the ara action modules need to be aware of the playbook id that is known by the callback20:12
dmsimardSerienmorder: tired but doing alright, ansiblefest is fun :)20:13
dmsimardbcoca: so it goes like "callback creates playbook id 1" -> "i use an ara action module that should run against playbook id 1"20:13
dmsimardback in 0.x, I did this by caching the playbook id in a flask context but now that the backend and the callback are really decoupled, I don't really have this kind of capability20:14
Serienmorderdmsimard: I wish my job would send me to stuff like that20:15
SerienmorderWhat is ara written in?20:16
SerienmorderI assume Python. I guess I could look at the repo lol20:16
dmsimardpython yeah20:16
dmsimardfrontend uses patternfly which is a css/js framework a bit like bootstrap20:16
dmsimardhttps://github.com/openstack/?q=ara20:17
dmsimardara = v0.x20:18
dmsimardara-(server,plugins,clients,web) is 1.020:18
SerienmorderGotchya. So mostly 1.0 development.20:20
dmsimardyes, maybe we will release it someday20:21
*** tbielawa|lunch is now known as tbielawa20:21
dmsimardThis is the current state of the todo list: https://etherpad.openstack.org/p/ara-todo-1.020:22
*** tbielawa is now known as tbielawa|g0n320:24
SerienmorderThat's a lot to do20:27
dmsimardthat's actually a pretty short list20:29
dmsimardI've been talking about 1.0 for over a year, that list is just what's left20:29
SerienmorderHow much time do you spend on it in a week?20:32
dmsimardnot enough20:33
dmsimardbut I also trashed about 6 months worth of work to head in a completely different direction20:33
dmsimardit wasn't an easy decision but in hindsight, it'll pay off20:33
dmsimardit was the one opportunity to turn around, otherwise considering this kind of rewrite for even a 2.0 would've been much more work20:34
*** ChanServ sets mode: +o dmsimard20:35
SerienmorderThe hardest part for most people is looking forward and realizing when something needs to be ditched20:35
dmsimardyup, it's called sunk costs :)20:36
dmsimardit's a huge thing in economy20:36
Serienmorderlol I slept through that class20:40
SerienmorderI need to get into a web project. But first starting I get pretty intimidated20:41
dmsimardSerienmorder: the new web frontend is being implemented with react, are you familiar with it at all ?20:46
Serienmorder@dmsimard: I am not. I have 0 front end experience. Like 200 hours of C# Backend experience20:48
*** themurph has quit IRC20:52
openstackgerritDavid Moreau Simard proposed openstack/ara-plugins master: Run black/isort on ara-plugins  https://review.openstack.org/60736120:55
openstackgerritDavid Moreau Simard proposed openstack/ara-plugins master: Add zuul job to run tox-format environment for executing black and isort  https://review.openstack.org/60736220:55
mmercerhmmm...21:17
mmercerhas anyone ever seen sqlalechmy error as soon as you try to start ara-manager runserver ?21:17
*** Serienmorder has quit IRC21:18
mmercersqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1071, u'Specified key was too long; max key length is 767 bytes') [SQL: u'\nCREATE TABLE data (\n\tid VARCHAR(36) NOT NULL, \n\tplaybook_id VARCHAR(36), \n\t`key` VARCHAR(255), \n\tvalue BLOB(4294967295), \n\tPRIMARY KEY (id), \n\tFOREIGN KEY(playbook_id) REFERENCES playbooks (id) ON DELETE RESTRICT, \n\tUNIQUE (playbook_id, `key`)\n)\n\n'] (Background21:20
mmerceron this error at: http://sqlalche.me/e/2j85)21:20
mmercerlooking through the bugs, googling... not seeing any references to see whats going on21:20
dmsimardmmercer: that doesn't ring me a bell21:32
dmsimardif you do find out what the problem is, please let me know21:33
mmercerdmsimard: what is the default encoding you guys use on the database ?  latin-1 or utf-8 ?21:34
mmercertrying to find the create database statement right now,  it seems to be non compliant with mysql 5.6 xD21:36
dmsimardmmercer: it's abstracted by sqlalchemy21:36
mmercerthats what i figured...  seems that somehow, its not compatible with mysql 5.6 currently....   which i dont remember being a problem in the past21:36
dmsimardara doesn't actually create the database in the case of mysql, it's expected that you create it first21:36
dmsimardhttps://ara.readthedocs.io/en/stable/configuration.html#ara-database21:37
mmercerdmsimard: let me rephrase --- create the table21:37
dmsimardI don't think we specify an encoding so it's probably using default ?21:37
dmsimardEverything that's database related is either here: https://github.com/openstack/ara/blob/master/ara/models.py or here: https://github.com/openstack/ara/tree/master/ara/db/versions21:38
mmercerhmmm.  seems to be incompatible with mariadb 10.0-not sure, as well as mysql-aurora v5.6,  that seems surprising21:45
mmercerwhat version of mysql has been tested lately ?21:45
openstackgerritDavid Moreau Simard proposed openstack/ara-clients master: Run black/isort on ara-clients  https://review.openstack.org/60737321:46
openstackgerritDavid Moreau Simard proposed openstack/ara-clients master: Add zuul job to run tox-format environment for executing black and isort  https://review.openstack.org/60737421:46
dmsimardmmercer: that seems surprising to me as well21:46
dmsimardmmercer: mysql integration tests are not a thing right now :(21:46
mmercernot sure, ill spin up another box just to be sure, but for a complete scratch test on an ubuntu 16.04 instance with mariadb-server,  it fails to create the table for ara because the key constraints exceed the limits allowed by versions of mysql prior to 5.721:47
mmercernow granted, 10.0 is a VERY old release of mariadb-server,  im checking to see if there is a newer 10.x release right now21:47
dmsimardIt sounds like it should just work21:48
dmsimardwhat version of sqlalchemy and pymysql are you running ?21:48
mmercerPyMySQL (0.9.2) SQLAlchemy (1.2.12)21:49
dmsimardlooks like that's the latest21:49
mmerceryeap21:49
dmsimard¯\_(ツ)_/¯21:49
mmercerit appears to be an actual issue with compatibility with 'older' mysql releases21:50
mmercerolder being subjective of course21:50
dmsimardI hope we can test sqlalchemy, mysql and postgresql in a more official capacity sometime in the future21:50
dmsimarderrr s/sqlalchemy/sqlite/21:51
* mmercer nods21:51
mmercerim checking to see if it really did somehow manage to break and go unnoticed, if so thats not good xD21:51
dmsimardI'll give it a quick try here out of curiosity21:52
mmercernp21:52
mmercerfastest starting point is a bento/ubuntu16 image in vagrant if you have access to virtualbox/vagrant :)21:53
dmsimardI have an openstack cloud in my basement21:54
dmsimardI'm good :P21:54
mmercergood point, lol21:55
mmerceri plan on having mine up and running... eventually21:55
mmerceri still really really want to get myself a full dell m3000 blade cluster to run it on, lol21:55
dmsimardmmercer: works on centos with mariadb-5.522:01
dmsimardwhat I used to test: https://gist.github.com/dmsimard/cb28393b10c75a018d42bc30b1f199ab22:01
*** bcoca has quit IRC22:18
mmercerhrum... interesting23:09
mmercerdmsimard: can you check the default character set for me on your database schema23:09

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!