*** cliles has quit IRC | 00:37 | |
*** cliles has joined #ara | 00:43 | |
*** IRCFrEAK has joined #ara | 02:04 | |
*** IRCFrEAK has left #ara | 02:04 | |
openstackgerrit | Naga Ravi Chaitanya Elluri proposed openstack/ansible-role-ara master: add apache+mod_wsgi support to ara https://review.openstack.org/435576 | 02:58 |
---|---|---|
*** madgoat has joined #ara | 05:11 | |
*** madgoat has left #ara | 05:11 | |
*** themurph_ has quit IRC | 05:21 | |
*** themurph has joined #ara | 05:25 | |
*** permalac has quit IRC | 09:21 | |
*** permalac has joined #ara | 09:25 | |
*** jclaret has joined #ara | 09:34 | |
*** karimb has joined #ara | 09:40 | |
*** jclaret has quit IRC | 10:54 | |
*** jclaret has joined #ara | 11:08 | |
dmsimard | andymccr: there was no unit tests in constants.py until I asked them about it this weekend :/ | 13:41 |
dmsimard | https://github.com/ansible/ansible/pull/21647 | 13:41 |
dmsimard | That's arguably how Ansible ends up being configured and it wasn't tested at all | 13:41 |
*** themurph has quit IRC | 13:59 | |
*** themurph has joined #ara | 14:01 | |
andymccr | dmsimard: i want to be surprised but im really not very surprised :/ | 14:02 |
larsks | dmsimard: wait, what? You ran into problems caused by lack of testing in ansible? Say it ain't so! :) | 14:02 |
dmsimard | larsks: :( | 14:03 |
dmsimard | I saw a wild larsks commit while sifting through stuff this weekend, grats on the merge :) | 14:03 |
larsks | That 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 |
dmsimard | larsks: 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 | |
larsks | Is 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 |
dmsimard | Asserts are picking up default vars instead of the ones from env | 14:14 |
dmsimard | Sec | 14:14 |
dmsimard | ex: http://paste.openstack.org/raw/599684/ | 14:15 |
dmsimard | but yeah, setting env variables in ARA works in general | 14:15 |
dmsimard | just not working when trying to set them up inside the test | 14:15 |
dmsimard | basically 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 |
dmsimard | apparently 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 either | 14:18 |
dmsimard | I might be missing something obvious as is usual | 14:18 |
larsks | dmsimard: I think you are. When I try to run that test, the error I see is: | 14:19 |
larsks | TypeError: putenv() argument 2 must be string, not bool | 14:19 |
larsks | Are you seeing something different? Because that error seems pretty clear. | 14:20 |
dmsimard | hrm, yeah, I modified it a couple times and ended up giving up (and skipping it and submitting WIP) | 14:20 |
dmsimard | instead of = value, put = str(value) | 14:20 |
larsks | Or just set the contents of params to strings to start with. | 14:20 |
dmsimard | yeah | 14:21 |
larsks | Huh, 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 |
larsks | A unit test should probably not cause filesystem modifications. | 14:26 |
dmsimard | larsks: hm, that probably comes from Ansible's get_config | 14:27 |
dmsimard | which is used in config.py | 14:28 |
dmsimard | so I should mock that ? | 14:28 |
larsks | No, that comes from configure_dirs in ara/webapp.py. | 14:28 |
larsks | Well, 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 |
dmsimard | hm, so there's two of them then -- ansible will also try to create a dir for it's tmp stuff | 14:29 |
dmsimard | good idea for the tmpdir | 14:29 |
larsks | dmsimard: 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 #ara | 14:38 | |
dmsimard | larsks: yup, pm me a link ? | 14:39 |
*** tbielawa is now known as tbielawa|mtg | 14:56 | |
*** tbielawa|mtg is now known as tbielawa | 15:15 | |
openstackgerrit | David Moreau Simard proposed openstack/ara master: Add basic config.py unit tests https://review.openstack.org/435804 | 15:28 |
dmsimard | hughsaunders: did you see my comment on https://review.openstack.org/#/c/435719/ ? Would love your blessing since it touches the junit portion. | 15:43 |
hughsaunders | dmsimard: ah yes, I did see that, sorry ahdn't got around to reviewing | 15:43 |
hughsaunders | will have a look now | 15:43 |
dmsimard | hughsaunders: 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 :p | 15:43 |
dmsimard | also, I gotta link an obligatory link about single quotes vs double quotes: https://www.youtube.com/watch?v=wf-BqAjZb8M&t=1098 :) | 15:45 |
dmsimard | hughsaunders: thanks | 16:01 |
openstackgerrit | Merged openstack/ara master: Support generating html or junit for one or many specific playbooks https://review.openstack.org/435719 | 16:07 |
openstackgerrit | David Moreau Simard proposed openstack/ara master: Drop tree from development dependencies https://review.openstack.org/435783 | 16:08 |
hughsaunders | dmsimard: "4lyfe | 16:09 |
openstackgerrit | Merged openstack/ara master: Add basic config.py unit tests https://review.openstack.org/435804 | 16:09 |
dmsimard | hughsaunders: do you watch sillicon valley by chance ? | 16:10 |
hughsaunders | dmsimard: No, I haven't seen that | 16:10 |
dmsimard | ah, 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 :p | 16:11 |
hughsaunders | dmsimard: 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 imho | 16:12 |
dmsimard | that sounds like google-level of micro optimization :P | 16:13 |
openstackgerrit | Merged openstack/ara master: Drop tree from development dependencies https://review.openstack.org/435783 | 16:16 |
openstackgerrit | David Moreau Simard proposed openstack/ara master: Do not merge: Test openstack-ansible gate job https://review.openstack.org/436098 | 16:28 |
*** karimb has quit IRC | 17:34 | |
*** tbielawa is now known as tbielawa|lunch | 18:05 | |
*** karimb has joined #ara | 18:38 | |
*** tbielawa|lunch is now known as tbielawa | 19:05 | |
*** karimb has quit IRC | 19:07 | |
*** tbielawa is now known as tbielawa|mtg | 19:23 | |
*** tbielawa|mtg is now known as tbielawa | 19:51 | |
*** jclaret has quit IRC | 19:55 | |
*** tbielawa has quit IRC | 20:10 | |
*** tbielawa has joined #ara | 20:12 | |
*** tbielawa_ has joined #ara | 20:50 | |
*** tbielawa has quit IRC | 20:51 | |
*** mkakularam has joined #ara | 21:06 | |
mkakularam | Hello David | 21:06 |
dmsimard | mkakularam: hi, did you end up figuring it out ? | 21:21 |
mkakularam | David: no sir | 21:21 |
dmsimard | What's the problem ? | 21:24 |
*** tbielawa_ has quit IRC | 21:25 | |
*** tbielawa has joined #ara | 21:32 | |
mkakularam | Sorry I got distracted | 21:38 |
mkakularam | I ran simple uname.yml plabook and it ran with no error | 21:38 |
mkakularam | I check the web gui ..I don't see the playbook or the host | 21:39 |
mkakularam | hello david r u there | 21:48 |
*** tbielawa_ has joined #ara | 21:49 | |
*** tbielawa has quit IRC | 21:51 | |
mkakularam | any suggestion David | 21:55 |
dmsimard | mkakularam: do you have an ansible.sqlite file in ~/.ara ? | 21:56 |
mkakularam | yes sir | 21:58 |
mkakularam | root@host1:/etc/ansible# cd ~/.ara/ | 21:58 |
mkakularam | root@host1:~/.ara# ls -al | 21:58 |
mkakularam | total 52 | 21:58 |
mkakularam | drwx------ 2 root root 4096 Feb 20 01:41 . | 21:58 |
mkakularam | drwx------ 6 root root 4096 Feb 20 18:23 .. | 21:58 |
mkakularam | -rw-r--r-- 1 root root 33792 Feb 20 01:41 ansible.sqlite | 21:58 |
mkakularam | -rw-r--r-- 1 root root 144 Feb 20 01:42 ara.log | 21:58 |
mkakularam | 21:58 | |
dmsimard | mkakularam: okay, can you do an "ara playbook list" and tell me if you see anything &? | 21:59 |
mkakularam | nothing comes up | 22:00 |
mkakularam | root@host1:~/.ara# ara playbook list | 22:00 |
mkakularam | root@host1:~/.ara# | 22:00 |
dmsimard | did you configure the database location somewhere ? | 22:02 |
dmsimard | mkakularam: ^ | 22:04 |
mkakularam | as far as i know i strictly followed the online documentation | 22:04 |
mkakularam | at one point in the doc..there is a step to run this *export ARA_DATABASE="sqlite:////tmp/ara.sqlite"* | 22:05 |
dmsimard | that 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-server | 22:06 |
dmsimard | mkakularam: can you use pastebin to paste your environment variables ? | 22:07 |
mkakularam | you mean do yiu want me to paste my environment variable | 22:09 |
dmsimard | ok, let's just restart from the beginning | 22:10 |
dmsimard | make sure you don't have any ARA_DATABASE variable set, run: unset ARA_DATABASE | 22:10 |
mkakularam | Ok.. I ran " unset ARA_DATABASE" | 22:11 |
dmsimard | don't use any ansible.cfg file, remove it if you've created one | 22:11 |
mkakularam | you want me to remove the one which I have under /etc/ansible/ansible.conf | 22:12 |
dmsimard | mkakularam: I just want to get you started, then we can work out the other details | 22:13 |
dmsimard | either remove ansible.cfg or any parameters related to ara from ansible.cfg | 22:13 |
mkakularam | I moved ansible.conf from /etc/ansible to /var/tmp/ | 22:13 |
dmsimard | ok 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 |
mkakularam | done I moved the entire file | 22:14 |
mkakularam | done done | 22:16 |
dmsimard | ok, run your playbook | 22:16 |
*** themurph has quit IRC | 22:20 | |
mkakularam | Ok .. I ran th playbook which is under /etc/ansible/playbooks .. it threw an error | 22:21 |
mkakularam | root@host1:/etc/ansible# ansible-playbook -i hosts playbooks/uname.yml -u mkakula -k -K | 22:21 |
mkakularam | SSH password: | 22:21 |
mkakularam | SUDO password[defaults to SSH password]: | 22:21 |
mkakularam | PLAY [test playbook] *********************************************************** | 22:21 |
mkakularam | TASK [setup] ******************************************************************* | 22:21 |
mkakularam | fatal: [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 |
mkakularam | echo ~/.ansible/tmp/ansible-tmp-1487629037.37-206055880461447 `\" ), exited with result 1", "unreachable": true} | 22:21 |
mkakularam | fatal: [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=\"` echo | 22:21 |
mkakularam | ~/.ansible/tmp/ansible-tmp-1487629037.37-88010734486688 `\" ), exited with result 1", "unreachable": true} | 22:21 |
dmsimard | Looks like you're not able to authenticate to the servers | 22:22 |
mkakularam | if I move my ansible.conf which I moved to /var/tmp/ back to /etc/ansible/ | 22:22 |
mkakularam | it works | 22:22 |
dmsimard | okay, do you have anything that is related to ara in that ansible.cfg ? | 22:23 |
mkakularam | root@host1:/etc/ansible# ansible-playbook -i hosts playbooks/uname.yml -u mkakula -k -K | 22:24 |
mkakularam | SSH password: | 22:24 |
mkakularam | SUDO password[defaults to SSH password]: | 22:24 |
mkakularam | PLAY [test playbook] *********************************************************** | 22:24 |
mkakularam | TASK [setup] ******************************************************************* | 22:24 |
mkakularam | ok: [localhost] | 22:24 |
mkakularam | ok: [host2] | 22:24 |
mkakularam | ok: [host3] | 22:24 |
mkakularam | ok: [host4] | 22:24 |
mkakularam | ok: [host5] | 22:25 |
mkakularam | TASK [command] ***************************************************************** | 22:25 |
mkakularam | changed: [host2] | 22:25 |
mkakularam | changed: [host3] | 22:25 |
mkakularam | If you want I can share my ansible.cfg | 22:25 |
mkakularam | one more thing I found in the documentation.. | 22:25 |
mkakularam | sqlite3 ~/.ara/ansible.sqlite | 22:26 |
dmsimard | mkakularam: don't randomly just type commands you find in the documentation, you have to read and understand why they are given | 22:26 |
mkakularam | root@host1:/etc/ansible# sqlite3 ~/.ara/ansible.sqlite | 22:26 |
mkakularam | SQLite version 3.11.0 2016-02-15 17:29:24 | 22:26 |
mkakularam | Enter ".help" for usage hints. | 22:26 |
mkakularam | sqlite> .quit | 22:26 |
mkakularam | root@host1:/etc/ansible# sqlite ~/.ara/ansible.sqlite | 22:26 |
mkakularam | The program 'sqlite' is currently not installed. You can install it by typing: | 22:26 |
mkakularam | apt install sqlite | 22:27 |
mkakularam | root@dal-appblx001-21:/etc/ansible# | 22:27 |
dmsimard | ok, anyway, now -- if you run "ara-manage runserver" and head to the web interface, do you see something ? | 22:27 |
mkakularam | root@host1:/etc/ansible# ara-manage runserver | 22:29 |
mkakularam | * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) | 22:29 |
mkakularam | but I have configured "ara-manage runserver -h 10.65.200.33 -p 8080" | 22:30 |
mkakularam | I don't see anythong on 127* ..but I see 19.65* | 22:30 |
mkakularam | 10.65* | 22:30 |
*** themurph has joined #ara | 22:31 | |
dmsimard | Do you get the ARA interface but there's no playbook in it ? | 22:32 |
mkakularam | Yes.. I can see ara web interface | 22:32 |
dmsimard | Ok, paste your ansible.cfg please | 22:33 |
dmsimard | In pastebin, not in this chat | 22:33 |
dmsimard | Please don't paste multiline content in the channel | 22:33 |
mkakularam | got sir.. | 22:33 |
mkakularam | where can i find the pastebin | 22:35 |
dmsimard | You can use pastebin.com or paste.openstack.org | 22:38 |
*** themurph has quit IRC | 22:41 | |
mkakularam | how do I share the pastebin info | 22:45 |
dmsimard | It gives you a link | 22:46 |
mkakularam | http://pastebin.com/8WvgE6qN | 22:47 |
mkakularam | hello David did you had a chance to lookin to ansible.cfg file | 22:53 |
dmsimard | mkakularam: I told you to remove anything ARA related in your ansible.cfg file | 23:01 |
dmsimard | From line 268 onwards needs to be deleted | 23:01 |
mkakularam | ok ..I removed the lines | 23:08 |
*** themurph has joined #ara | 23:11 | |
dmsimard | re-run your playbook and then run "ara-manage runserver" again. | 23:12 |
mkakularam | after i ran ara-manage server which is showing | 23:15 |
mkakularam | Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) | 23:15 |
dmsimard | Run it with whatever parameters you need | 23:16 |
mkakularam | ara-manage runserver -h 10.65.200.33 -p 8080 | 23:20 |
mkakularam | ok now I can see the playbook populated on ara web | 23:25 |
mkakularam | but 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 web | 23:26 |
mkakularam | r u there david | 23:27 |
dmsimard | mkakularam: the configuration you put at the end of the file doesn't make sense | 23:28 |
dmsimard | mkakularam: you re-declared the [defaults] block that is already specified at the top of the file two additional times | 23:28 |
dmsimard | There'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 |
mkakularam | can you please point me where at the top | 23:29 |
dmsimard | I 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 |
mkakularam | and can you please help using the ara_record module and also data types | 23:32 |
mkakularam | anyway 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 IRC | 23:51 | |
*** tbielawa_ has quit IRC | 23:58 | |
*** mkakularam has joined #ara | 23:59 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!