Monday, 2017-02-20

*** cliles has quit IRC00:37
*** cliles has joined #ara00:43
*** IRCFrEAK has joined #ara02:04
*** IRCFrEAK has left #ara02:04
openstackgerritNaga Ravi Chaitanya Elluri proposed openstack/ansible-role-ara master: add apache+mod_wsgi support to ara  https://review.openstack.org/43557602:58
*** madgoat has joined #ara05:11
*** madgoat has left #ara05:11
*** themurph_ has quit IRC05:21
*** themurph has joined #ara05:25
*** permalac has quit IRC09:21
*** permalac has joined #ara09:25
*** jclaret has joined #ara09:34
*** karimb has joined #ara09:40
*** jclaret has quit IRC10:54
*** jclaret has joined #ara11:08
dmsimardandymccr: there was no unit tests in constants.py until I asked them about it this weekend :/13:41
dmsimardhttps://github.com/ansible/ansible/pull/2164713:41
dmsimardThat's arguably how Ansible ends up being configured and it wasn't tested at all13:41
*** themurph has quit IRC13:59
*** themurph has joined #ara14:01
andymccrdmsimard: i want to be surprised but im really not very surprised :/14:02
larsksdmsimard: wait, what? You ran into problems caused by lack of testing in ansible? Say it ain't so! :)14:02
dmsimardlarsks: :(14:03
dmsimardI saw a wild larsks commit while sifting through stuff this weekend, grats on the merge :)14:03
larsksThat  was an ooooold one that implements a systemd-nspawn connection driver for ansible. I had actually given up on it because I got frustrated trying to convince bcoca that it might be useful, but someone else finally picked it up and polished it off :)14:04
dmsimardlarsks: this is driving me nuts, maybe you know ? I'm trying to test our config.py but it doesn't look like I'm able to get it to pick up env variables. I tried this approach: https://review.openstack.org/#/c/435804/4/ara/tests/unit/test_config.py (see second test) .. tried with pytest's monkeypatch, tried with test.EnvironmentVarGuard and I just can't seem to make it work ? Pulling my hair out ..14:11
* larsks looks...14:11
larsksIs it not picking up environment variables *at all*? Or is it just not working when you try to set them in the test?  E.g., if you set them in the environment before running the test (or just when using ara in general), does it work?14:13
dmsimardAsserts are picking up default vars instead of the ones from env14:14
dmsimardSec14:14
dmsimardex: http://paste.openstack.org/raw/599684/14:15
dmsimardbut yeah, setting env variables in ARA works in general14:15
dmsimardjust not working when trying to set them up inside the test14:15
dmsimardbasically just want to test that 1) default values are set as expected, 2) configuring through env works 3) configuring through file works (todo)14:17
dmsimardapparently the proper way would be to use pytest.monkeypatch (i.e, http://doc.pytest.org/en/doc-warnings/monkeypatch.html ) but that didn't work for me either14:18
dmsimardI might be missing something obvious as is usual14:18
larsksdmsimard: I think you are. When I try to run that test, the error I see is:14:19
larsksTypeError: putenv() argument 2 must be string, not bool14:19
larsksAre you seeing something different?  Because that error seems pretty clear.14:20
dmsimardhrm, yeah, I modified it a couple times and ended up giving up (and skipping it and submitting WIP)14:20
dmsimardinstead of = value, put = str(value)14:20
larsksOr just set the contents of params to strings to start with.14:20
dmsimardyeah14:21
larsksHuh, there's a different problem.  Just for kicks I ran ARA_DIR=/home/ara py.test -v ara/tests/unit/test_config.py, but that fails because it tries to actually create the directory.14:26
larsksA unit test should probably not cause filesystem modifications.14:26
dmsimardlarsks: hm, that probably comes from Ansible's get_config14:27
dmsimardwhich is used in config.py14:28
dmsimardso I should mock that ?14:28
larsksNo, that comes from configure_dirs in ara/webapp.py.14:28
larsksWell, you could mock it, or you create a temporary directory as part of the test setup and remove it on teardown.  And locate any paths inside that temporary dir.14:29
dmsimardhm, so there's two of them then -- ansible will also try to create a dir for it's tmp stuff14:29
dmsimardgood idea for the tmpdir14:29
larsksdmsimard: I have a stupid question about this test, but it might be better for a bluejeans. Do you have a minute?14:35
*** tbielawa has joined #ara14:38
dmsimardlarsks: yup, pm me a link ?14:39
*** tbielawa is now known as tbielawa|mtg14:56
*** tbielawa|mtg is now known as tbielawa15:15
openstackgerritDavid Moreau Simard proposed openstack/ara master: Add basic config.py unit tests  https://review.openstack.org/43580415:28
dmsimardhughsaunders: did you see my comment on https://review.openstack.org/#/c/435719/ ? Would love your blessing since it touches the junit portion.15:43
hughsaundersdmsimard: ah yes, I did see that, sorry ahdn't got around to reviewing15:43
hughsaunderswill have a look now15:43
dmsimardhughsaunders: np, I'm planning on cutting a dot release this week to ship that and the wsgi stuff so as long as you eventually get to it it's okay :p15:43
dmsimardalso, I gotta link an obligatory link about single quotes vs double quotes: https://www.youtube.com/watch?v=wf-BqAjZb8M&t=1098 :)15:45
dmsimardhughsaunders: thanks16:01
openstackgerritMerged openstack/ara master: Support generating html or junit for one or many specific playbooks  https://review.openstack.org/43571916:07
openstackgerritDavid Moreau Simard proposed openstack/ara master: Drop tree from development dependencies  https://review.openstack.org/43578316:08
hughsaundersdmsimard: "4lyfe16:09
openstackgerritMerged openstack/ara master: Add basic config.py unit tests  https://review.openstack.org/43580416:09
dmsimardhughsaunders: do you watch sillicon valley by chance ?16:10
hughsaundersdmsimard: No, I haven't seen that16:10
dmsimardah, it's a pretty funny show. Anyway, at one point there's this huge debate about space vs tabs -- I was thinking there could be one about single/double quotes :p16:11
hughsaundersdmsimard: I think in some situations there are measurable performance differences - if double quotes support extended interpolations for example. But python isn't really about those micro differences imho16:12
dmsimardthat sounds like google-level of micro optimization :P16:13
openstackgerritMerged openstack/ara master: Drop tree from development dependencies  https://review.openstack.org/43578316:16
openstackgerritDavid Moreau Simard proposed openstack/ara master: Do not merge: Test openstack-ansible gate job  https://review.openstack.org/43609816:28
*** karimb has quit IRC17:34
*** tbielawa is now known as tbielawa|lunch18:05
*** karimb has joined #ara18:38
*** tbielawa|lunch is now known as tbielawa19:05
*** karimb has quit IRC19:07
*** tbielawa is now known as tbielawa|mtg19:23
*** tbielawa|mtg is now known as tbielawa19:51
*** jclaret has quit IRC19:55
*** tbielawa has quit IRC20:10
*** tbielawa has joined #ara20:12
*** tbielawa_ has joined #ara20:50
*** tbielawa has quit IRC20:51
*** mkakularam has joined #ara21:06
mkakularamHello David21:06
dmsimardmkakularam: hi, did you end up figuring it out ?21:21
mkakularamDavid: no sir21:21
dmsimardWhat's the problem ?21:24
*** tbielawa_ has quit IRC21:25
*** tbielawa has joined #ara21:32
mkakularamSorry I got distracted21:38
mkakularamI ran simple uname.yml plabook and it ran with no error21:38
mkakularamI check the web gui ..I don't see the playbook or the host21:39
mkakularamhello david r u there21:48
*** tbielawa_ has joined #ara21:49
*** tbielawa has quit IRC21:51
mkakularamany suggestion David21:55
dmsimardmkakularam: do you have an ansible.sqlite file in ~/.ara ?21:56
mkakularamyes sir21:58
mkakularamroot@host1:/etc/ansible# cd ~/.ara/21:58
mkakularamroot@host1:~/.ara# ls -al21:58
mkakularamtotal 5221:58
mkakularamdrwx------ 2 root root  4096 Feb 20 01:41 .21:58
mkakularamdrwx------ 6 root root  4096 Feb 20 18:23 ..21:58
mkakularam-rw-r--r-- 1 root root 33792 Feb 20 01:41 ansible.sqlite21:58
mkakularam-rw-r--r-- 1 root root   144 Feb 20 01:42 ara.log21:58
mkakularam21:58
dmsimardmkakularam: okay, can you do an "ara playbook list" and tell me if you see anything &?21:59
mkakularamnothing comes up22:00
mkakularamroot@host1:~/.ara# ara playbook list22:00
mkakularamroot@host1:~/.ara#22:00
dmsimarddid you configure the database location somewhere ?22:02
dmsimardmkakularam: ^22:04
mkakularamas far as i know i  strictly followed the online documentation22:04
mkakularamat one point in the doc..there is a step to run this *export ARA_DATABASE="sqlite:////tmp/ara.sqlite"*22:05
dmsimardthat would be here and that's just an example to explain how to change the database location if you've changed it: http://ara.readthedocs.io/en/latest/webserver.html#embedded-server22:06
dmsimardmkakularam: can you use pastebin to paste your environment variables ?22:07
mkakularamyou mean do yiu want me to paste my environment variable22:09
dmsimardok, let's just restart from the beginning22:10
dmsimardmake sure you don't have any ARA_DATABASE variable set, run:       unset ARA_DATABASE22:10
mkakularamOk.. I ran "  unset ARA_DATABASE"22:11
dmsimarddon't use any ansible.cfg file, remove it if you've created one22:11
mkakularamyou want me to remove the one which I have under /etc/ansible/ansible.conf22:12
dmsimardmkakularam: I just want to get you started, then we can work out the other details22:13
dmsimardeither remove ansible.cfg or any parameters related to ara from ansible.cfg22:13
mkakularamI moved ansible.conf from /etc/ansible to /var/tmp/22:13
dmsimardok now, configure ansible to use the ara callback, run:     export ANSIBLE_CALLBACK_PLUGINS="$(python -c 'import os,ara; print(os.path.dirname(ara.__file__))')/plugins/callbacks"22:14
mkakularamdone I moved the entire file22:14
mkakularamdone done22:16
dmsimardok, run your playbook22:16
*** themurph has quit IRC22:20
mkakularamOk .. I ran th playbook which is under /etc/ansible/playbooks .. it threw an error22:21
mkakularamroot@host1:/etc/ansible# ansible-playbook -i hosts playbooks/uname.yml -u mkakula -k -K22:21
mkakularamSSH password:22:21
mkakularamSUDO password[defaults to SSH password]:22:21
mkakularamPLAY [test playbook] ***********************************************************22:21
mkakularamTASK [setup] *******************************************************************22:21
mkakularamfatal: [host2]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo ~/.ansible/tmp/ansible-tmp-1487629037.37-206055880461447 `\" && echo ansible-tmp-1487629037.37-206055880461447=\"`22:21
mkakularamecho ~/.ansible/tmp/ansible-tmp-1487629037.37-206055880461447 `\" ), exited with result 1", "unreachable": true}22:21
mkakularamfatal: [host3]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo ~/.ansible/tmp/ansible-tmp-1487629037.37-88010734486688 `\" && echo ansible-tmp-1487629037.37-88010734486688=\"` echo22:21
mkakularam~/.ansible/tmp/ansible-tmp-1487629037.37-88010734486688 `\" ), exited with result 1", "unreachable": true}22:21
dmsimardLooks like you're not able to authenticate to the servers22:22
mkakularamif I move my ansible.conf which I moved to /var/tmp/ back to /etc/ansible/22:22
mkakularamit works22:22
dmsimardokay, do you have anything that is related to ara in that ansible.cfg ?22:23
mkakularamroot@host1:/etc/ansible# ansible-playbook -i hosts playbooks/uname.yml -u mkakula -k -K22:24
mkakularamSSH password:22:24
mkakularamSUDO password[defaults to SSH password]:22:24
mkakularamPLAY [test playbook] ***********************************************************22:24
mkakularamTASK [setup] *******************************************************************22:24
mkakularamok: [localhost]22:24
mkakularamok: [host2]22:24
mkakularamok: [host3]22:24
mkakularamok: [host4]22:24
mkakularamok: [host5]22:25
mkakularamTASK [command] *****************************************************************22:25
mkakularamchanged: [host2]22:25
mkakularamchanged: [host3]22:25
mkakularamIf you want I can share my ansible.cfg22:25
mkakularamone more thing I found in the documentation..22:25
mkakularamsqlite3 ~/.ara/ansible.sqlite22:26
dmsimardmkakularam: don't randomly just type commands you find in the documentation, you have to read and understand why they are given22:26
mkakularamroot@host1:/etc/ansible# sqlite3 ~/.ara/ansible.sqlite22:26
mkakularamSQLite version 3.11.0 2016-02-15 17:29:2422:26
mkakularamEnter ".help" for usage hints.22:26
mkakularamsqlite> .quit22:26
mkakularamroot@host1:/etc/ansible# sqlite ~/.ara/ansible.sqlite22:26
mkakularamThe program 'sqlite' is currently not installed. You can install it by typing:22:26
mkakularamapt install sqlite22:27
mkakularamroot@dal-appblx001-21:/etc/ansible#22:27
dmsimardok, anyway, now -- if you run "ara-manage runserver" and head to the web interface, do you see something ?22:27
mkakularamroot@host1:/etc/ansible# ara-manage runserver22:29
mkakularam * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)22:29
mkakularambut I have configured "ara-manage runserver -h 10.65.200.33 -p 8080"22:30
mkakularamI don't see anythong on 127* ..but I see 19.65*22:30
mkakularam10.65*22:30
*** themurph has joined #ara22:31
dmsimardDo you get the ARA interface but there's no playbook in it ?22:32
mkakularamYes.. I can see ara web interface22:32
dmsimardOk, paste your ansible.cfg please22:33
dmsimardIn pastebin, not in this chat22:33
dmsimardPlease don't paste multiline content in the channel22:33
mkakularamgot sir..22:33
mkakularamwhere can i find the pastebin22:35
dmsimardYou can use pastebin.com or paste.openstack.org22:38
*** themurph has quit IRC22:41
mkakularamhow do I share the pastebin info22:45
dmsimardIt gives you a link22:46
mkakularamhttp://pastebin.com/8WvgE6qN22:47
mkakularamhello David did you had a chance to lookin to ansible.cfg file22:53
dmsimardmkakularam: I told you to remove anything ARA related in your ansible.cfg file23:01
dmsimardFrom line 268 onwards needs to be deleted23:01
mkakularamok ..I removed the lines23:08
*** themurph has joined #ara23:11
dmsimardre-run your playbook and then run "ara-manage runserver" again.23:12
mkakularamafter i ran ara-manage server which is  showing23:15
mkakularamRunning on http://127.0.0.1:5000/ (Press CTRL+C to quit)23:15
dmsimardRun it with whatever parameters you need23:16
mkakularamara-manage runserver -h 10.65.200.33 -p 808023:20
mkakularamok now I can see the playbook populated on ara web23:25
mkakularambut it didn't work after y u advised me to delete the lines from 268... so I copied back with the lines and reran the playbook couple of time I can see the playbooks on web23:26
mkakularamr u there david23:27
dmsimardmkakularam: the configuration you put at the end of the file doesn't make sense23:28
dmsimardmkakularam: you re-declared the [defaults] block that is already specified at the top of the file two additional times23:28
dmsimardThere's configuration pointing to /var/www/ara, and this kind of syntax does not work in a cfg/ini file: ara_location=$(python -c "import os,ara; print(os.path.dirname(ara.__file__))")23:29
mkakularamcan you please point me where at the top23:29
dmsimardI have to go for now, ARA isn't meant to help you get started with Ansible -- it's something that is added on top of Ansible. Learning how to use and configure Ansible properly first will save you a lot of time and frustration -- perhaps you can start there and once you're comfortable with that, you can start using ARA.23:31
mkakularamand can you please help using the ara_record module and also data types23:32
mkakularamanyway thanks for your help...and I use ansible for day to day tasks and 90% of our work is handled by Ansible Playbooks..Thanks for your inputs...but still documentation needs to be updated...and my 1 cent advise please don't publish videos with voice muted..if the product is not matured please don't publish to the world..23:46
*** mkakularam has quit IRC23:51
*** tbielawa_ has quit IRC23:58
*** mkakularam has joined #ara23:59

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