Tuesday, 2016-12-06

*** devlaps has joined #ara04:58
openstackgerritChristian Berendt proposed openstack/ara: Add bandit to pep8 as generic linting target  https://review.openstack.org/40744310:23
*** Harosgr has joined #ara10:23
openstackgerritChristian Berendt proposed openstack/ara: Improve the readability of the RST files  https://review.openstack.org/40744710:35
HarosgrHey guys. What's up? :)12:46
dmsimardo/12:47
Harosgrso, I was wondering... is there any way to find the ara playbook id at the end of a playbook execution? A way to "predict" it or soemthing... even though I've seen the code and it it random12:48
Harosgri am using ansible together with rundeck as a UI12:49
Harosgrand I was thinking of generating a link at the end of each rundeck / ansible execution that will point to the ARA analysis12:49
dmsimardHarosgr: so do you need the playbook id during the run or after it's completed ?12:49
Harosgrafter should be fine12:50
Harosgris it also possible to get it during?12:50
dmsimardYup.12:50
dmsimardThere's two ways, both during and after12:51
Harosgrcool.. maybe I can test them both then :P12:51
dmsimardOkay. During: The playbook id is exposed through using the ara_record and ara_read modules: http://ara.readthedocs.io/en/latest/usage.html#using-the-ara-record-module12:52
dmsimardplaybook_id is one of the variables available from the output of ara_read12:53
dmsimardhttps://github.com/openstack/ara/blob/master/ara/plugins/actions/ara_read.py#L5712:54
dmsimardThe other way is through the mechanism by which the playbook id is persisted for the purpose of making ara_record and ara_read work in the first place12:55
dmsimardWe create a ara.json file in the Ansible tmp directory (~/. ansible/ara.json) by default where you'll find playbook['id']12:56
dmsimardhttps://github.com/openstack/ara/blob/master/ara/plugins/callbacks/log_ara.py#L26612:57
dmsimardAfter the playbook finished, you could probably use the command line client to get the list of playbooks that ran and get the one you're interested in12:59
Harosgrthe temp file is deleted after the playbook run right?12:59
dmsimardThere's a few examples in tests here: https://github.com/openstack/ara/blob/master/run_tests.sh#L39 but otherwise there's also the docs: https://github.com/openstack/ara/blob/master/run_tests.sh#L3913:00
dmsimardEr, wrong clipboard. http://ara.readthedocs.io/en/latest/usage.html#querying-the-database-with-the-cli13:00
Harosgryes I've thought of doing something like "ara playbook list" and grepping the execution time to get the proper id13:00
dmsimardara doesn't delete that file, Ansible might. It's a directory controlled by Ansible.13:01
dmsimardBut it will definitely overwrite the file at the start of the next playbook13:01
Harosgryes if parallel playbooks are in run you cannot find the poper id easily13:02
dmsimardparallel playbooks ? Ouch13:02
dmsimardI've never tested that use case before13:03
dmsimardBut it's true that ansible let's you do that. Hmm. You've just exposed a bug :)13:03
Harosgrthere shouldn't be any problem with the playbook_id from ara_read or with grepping the cli output even with parallel runs... I guess...13:04
* dmsimard takes note13:04
dmsimardWell, see that bug I told you about, ara_record and ara_read will not work properly if playbook runs are parallelized13:05
dmsimardSo I have to fix that. It's not complicated but needs to be done nonetheless.13:06
dmsimardThe two runs (or N runs) will compete with each other for that ara.json.13:07
Harosgroh, I got it now, because they will both write in ara.json the playbook id right?13:07
* dmsimard nods13:07
Harosgryes got it13:07
dmsimardUse the CLI for now :)13:07
dmsimardI'll file a bug after I've got some amount of caffeine13:07
HarosgrI will give a try with the cli then.. Thanks for the info :D13:08
Harosgrbtw...  I have added in ARA a small piece of code because I want some kind of athentication for the web page. If you find it an interesting feature I can commit the code13:10
Harosgrit's basic auth for flask13:10
Harosgrand it uses the ara variables in ansible conf file to set a username and a password13:10
dmsimardHmmm. Maybe :)13:12
dmsimardGive it a shot, I'll help you merge it!13:13
Harosgrjsut take a look at it and see if it makes sense as a feature :)13:13
Harosgrso, thanks for the help. And good job with ARA. It's a really nice tool :)13:14
dmsimardHarosgr: thanks !13:16
dmsimardHarosgr: hm, on second thought - maybe this kind of thing would belong more in a web server configuration ? like htaccess/htpasswd kind of thing.13:16
dmsimardbut I realize that might not help if you're running the standalone web server13:17
dmsimardthe thing is I'm not sure how well this would translate to the statically generated version of the web application.13:17
dmsimardI have to afk for a bit, brb.13:17
Harosgrhmm I haven't tested it with static. What I do now is call a configure_auth, where the basic auth configuration is done, in webapp.py13:21
HarosgrI will give a try and see how that behaves with static generation13:23
dmsimardberendt: o/13:49
dmsimardberendt: re: host facts13:49
dmsimardWe didn't come to the current 1:1 mapping of hosts vs playbooks by accident :)13:49
dmsimardThat's actually how it was before -- we ran with the assumption that hosts were unique across all playbook runs, however, in reality this isn't the case. In the context of Ansible, a host is only really unique for the duration of that run.13:50
dmsimardAn easy example, let's pretend you alias your host "webserver". This server "webserver" could in reality be any server behind, with any ip address.. or if it did happen to be unique, perhaps sometime it could be re-installed.13:51
dmsimardThe issue was discussed to some extent here: https://github.com/dmsimard/ara/issues/10313:52
dmsimardre: improve generation time: yes :) Definitely open to suggestions here. I'm blindly throwing everything at Flask-Frozen which crawls the web application and does it's thing right now.13:53
dmsimardrecording extra-vars, tags, limits and such was already logged here: https://storyboard.openstack.org/#!/story/200074713:54
dmsimardso definitely on the to-do list13:54
dmsimardthe diff idea too, except I have no clue how to approach that just yet: https://storyboard.openstack.org/#!/story/200075213:55
openstackgerritMerged openstack/ara: Improve the readability of the RST files  https://review.openstack.org/40744714:05
openstackgerritMerged openstack/ara: Add bandit to pep8 as generic linting target  https://review.openstack.org/40744314:06
*** devlaps has quit IRC14:21
berendtdmsimard: for diff, check the molecule code, they are doing it right now in a very nice way, i can provide you a sample output14:32
dmsimardberendt: yeah a sample output would be nice14:33
berendtthe discussion around the host facts makes sense to me and it is not that hard to write a wrapper for it14:34
dmsimardberendt: yeah, well.. maybe there could be some level of facilitation done through the CLI14:35
dmsimardlike, instead of having a custom bash profile function on your laptop, we'd embed it in the CLI properly :)14:35
berendtit is annoying when a public cloud provider returns "Error in creating the server: No valid host was found." when trying to run a CI job :(14:35
dmsimardberendt: you might enjoy https://twitter.com/dmsimard/status/675830775384809472 :P14:36
berendtlol14:37
berendtdmsimard: http://paste.openstack.org/show/591545/14:44
berendtdmsimard: two sample outputs from molecule14:44
dmsimardberendt: that output looks very puppet-ish heh14:46
dmsimardberendt: so are you interested in that diff right there ? in the task output from ansible-playbook ? or do you want some sort of integration in the UI/CLI ?14:53
berendtit would be nice to have this output when clicking on the details of a task in the ui14:54
*** devlaps has joined #ara16:08
*** Harosgr has quit IRC16:52
openstackgerritChristian Berendt proposed openstack/ara: Enable PEP8 E221 test and solve identified issues  https://review.openstack.org/40761517:19
openstackgerritMerged openstack/ara: Enable PEP8 E221 test and solve identified issues  https://review.openstack.org/40761517:33
openstackgerritNaga Ravi Chaitanya Elluri proposed openstack/ara: update usage.rst  https://review.openstack.org/40762317:53
openstackgerritNaga Ravi Chaitanya Elluri proposed openstack/ara: update usage.rst  https://review.openstack.org/40762318:12
openstackgerritNaga Ravi Chaitanya Elluri proposed openstack/ara: Fix ara command syntax to generate a static web app  https://review.openstack.org/40762318:39
openstackgerritDavid Moreau Simard proposed openstack/ara: Fix ara command syntax to generate a static web app  https://review.openstack.org/40762319:14
openstackgerritDavid Moreau Simard proposed openstack/ara: Fix ara command syntax to generate a static web app  https://review.openstack.org/40762319:15
*** devlaps has quit IRC19:16
*** devlaps has joined #ara19:17
openstackgerritMerged openstack/ara: Fix ara command syntax to generate a static web app  https://review.openstack.org/40762319:28
*** devlaps has quit IRC20:10
*** devlaps has joined #ara21:07
*** myoung is now known as myoung|afk22:25
*** myoung|afk is now known as myoung|bbl22:25

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