*** gtema has joined #openstack-ansible-sig | 00:34 | |
*** gtema has quit IRC | 00:39 | |
*** gtema has joined #openstack-ansible-sig | 02:35 | |
*** gtema has quit IRC | 02:39 | |
*** priteau has joined #openstack-ansible-sig | 03:39 | |
*** priteau has quit IRC | 03:46 | |
*** evrardjp has quit IRC | 04:33 | |
*** evrardjp has joined #openstack-ansible-sig | 04:33 | |
*** gtema has joined #openstack-ansible-sig | 04:36 | |
*** gtema has quit IRC | 04:40 | |
*** gtema has joined #openstack-ansible-sig | 05:45 | |
*** gtema has quit IRC | 06:49 | |
*** gtema has joined #openstack-ansible-sig | 06:50 | |
*** rpittau|afk is now known as rpittau | 07:04 | |
*** gtema has quit IRC | 07:05 | |
*** priteau has joined #openstack-ansible-sig | 07:10 | |
*** priteau has quit IRC | 07:35 | |
*** priteau has joined #openstack-ansible-sig | 08:02 | |
*** priteau has quit IRC | 08:22 | |
*** priteau has joined #openstack-ansible-sig | 08:24 | |
*** dtantsur|afk is now known as dtantsur | 08:34 | |
*** gtema has joined #openstack-ansible-sig | 09:33 | |
*** rpittau is now known as rpittau|bbl | 10:08 | |
dtantsur | Does anyone happen to know if I can install a collection via ansible and then immediately use it? | 11:12 |
---|---|---|
dtantsur | Or does it have to be present when ansible starts? | 11:12 |
dtantsur | sshnaidm|afk or mordred ^^ | 11:12 |
gtema | hmm, interesting question | 11:12 |
gtema | I would assume it should be possible | 11:13 |
sshnaidm|afk | I don't think but worth checking | 11:13 |
sshnaidm|afk | most likely it will fail because parses playbook before run and hit unknown module | 11:14 |
gtema | in this case it might be possible with the dynamic playbook inclusion | 11:14 |
sshnaidm|afk | yeah, that may work | 11:15 |
dtantsur | mmm, not our case. | 11:23 |
dtantsur | okay, then it will be a pre-requisite of bifrost rather than something it installs | 11:24 |
*** gtema has quit IRC | 11:32 | |
*** rpittau|bbl is now known as rpittau | 11:59 | |
*** gtema has joined #openstack-ansible-sig | 12:13 | |
*** gtema has quit IRC | 12:14 | |
*** gtema has joined #openstack-ansible-sig | 12:27 | |
*** gtema has quit IRC | 12:45 | |
dtantsur | iurygregory: FYI ^^^ it seems that the collection installation has to go to scripts/env-setup.sh | 12:53 |
iurygregory | dtantsur, ack | 12:54 |
mordred | dtantsur: can it go into a role, and then have the role that installs the collection be in a different play? | 12:54 |
dtantsur | mordred: sure, but that won't win us much | 12:54 |
dtantsur | although... | 12:54 |
dtantsur | iurygregory: mordred has a point since we'll need to support both galaxy and source installation | 12:54 |
dtantsur | (the latter to be able to run our jobs in the CI) | 12:54 |
iurygregory | wow | 12:54 |
iurygregory | gotcha | 12:54 |
mordred | dtantsur: we use include_role in opendev to do something similar | 12:55 |
iurygregory | will need to figure out things since I never used collections =) | 12:55 |
mordred | dtantsur, iurygregory https://opendev.org/opendev/system-config/src/branch/master/playbooks/roles/run-puppet/tasks/main.yaml | 12:55 |
mordred | we're not using collections yet - but we have a thing install roles from galaxy | 12:56 |
iurygregory | mind blow "run-puppet" | 12:56 |
mordred | (yeah :) ) | 12:56 |
mordred | and one of the roles "install-ansible-roles" is installing in the playbook is the puppet role | 12:56 |
mordred | so I don't know if the pattern will hold for collectrions, but it's working for us for roles at least | 12:57 |
dtantsur | mm, yeah | 12:57 |
mordred | iurygregory: we've been slowly moving from puppet to ansible - it's hard when you have a large production already in puppet - so step one was "have ansible run puppet" | 12:57 |
dtantsur | just let's be careful and not use system-config roles in the code that is run outside of the CI :) | 12:58 |
iurygregory | mordred, yeah totally true | 12:58 |
dtantsur | mordred: do I recall it right that it's possible to pip-install a collection? | 12:58 |
mordred | dtantsur: WELL | 12:58 |
dtantsur | bad start | 12:58 |
mordred | dtantsur: not generally, at least yet | 12:58 |
iurygregory | yup | 12:59 |
mordred | there are some ways - sshnaidm|afk has a patch to add a pip installation of this one | 12:59 |
dtantsur | mordred: let's rephrase it: is anything able to install a collection from a git checkout to a venv? | 12:59 |
iurygregory | rpittau, would probably say no for pip-install | 12:59 |
mordred | from git checkout - yet | 12:59 |
mordred | yes | 12:59 |
mordred | to a venv - not as much | 12:59 |
dtantsur | sigh | 12:59 |
dtantsur | bifrost defaults to using a venv (for good reasons) | 13:00 |
rpittau | iurygregory: if it's in venv or per-user it's ok, let's just try to avoid a 'sudo pip install' | 13:00 |
mordred | yeah- collections just go into a path though | 13:00 |
dtantsur | and the path is not relative to sys.prefix? | 13:00 |
mordred | dtantsur: you can just copy the collection dirs into the right place - it's a defined directory structure | 13:00 |
mordred | dtantsur: no - it has nothing to do with python installation context, at least I don't believe | 13:01 |
dtantsur | can it be something like $ /opt/stack/bifrost/share/blah/blah? | 13:01 |
dtantsur | ugh | 13:01 |
mordred | it can go into ~stack | 13:01 |
dtantsur | ansible has been consistently bad at venving | 13:01 |
mordred | yeah | 13:01 |
dtantsur | mordred: I'd really, really like to avoid installing anything outside of the venv (enough that we put stuff in /etc and create systemd services) | 13:02 |
rpittau | what about per-user ? | 13:02 |
dtantsur | rpittau: not terrible, but inconsistent and has a chance of overwriting user's stuff | 13:03 |
mordred | so - default is ~/.ansible/collections | 13:03 |
rpittau | mmm yeah it can get complicated | 13:03 |
mordred | you can also put them adjacent to playbook | 13:03 |
dtantsur | mmm, we can do ^^ and add it to .gitignore | 13:03 |
dtantsur | iurygregory: wdyt ^^ | 13:03 |
iurygregory | dtantsur, makes sense to me will need to do some tests to see how it goes =) | 13:04 |
mordred | you can also set the env var ANSIBLE_COLLECTIONS_PATHS | 13:04 |
mordred | it defaults to ~/.ansible/collections:/usr/share/ansible/collections | 13:04 |
dtantsur | oh, now we're talking! | 13:04 |
iurygregory | oh that sounds better =) | 13:05 |
mordred | and ansible-galaxy collections install has a "-p" option which is the destination | 13:05 |
mordred | https://docs.ansible.com/ansible/latest/user_guide/collections_using.html#installing-collections-with-ansible-galaxy | 13:05 |
dtantsur | neat | 13:05 |
mordred | note the directory structure in there - under "collections" there's an additional "ansible_collections" dir | 13:05 |
mordred | and then the collections | 13:05 |
mordred | so really - if you're grabbing from git, you can just copy things | 13:06 |
dtantsur | we'll just have to use the variable everywhere and document it for end users | 13:06 |
dtantsur | iurygregory: we need to check how ansible-galaxy behaves in a venv at all | 13:06 |
iurygregory | dtantsur, yeah | 13:06 |
* dtantsur hopes it doesn't blow up miserably | 13:06 | |
iurygregory | we all hope | 13:07 |
* dtantsur leaves it in iurygregory's capable hands ;) | 13:07 | |
iurygregory | tks will do my best | 13:08 |
mordred | dtantsur: it should behave well - we use it in tox in ansible-collections-openstack | 13:09 |
mordred | iurygregory: let me know if you run in to issues - happy to at least complain with you :) | 13:10 |
iurygregory | mordred, sure =) | 13:10 |
iurygregory | will probably give a try on monday | 13:10 |
iurygregory | playing with ironic-lib atm | 13:10 |
*** gshippey has joined #openstack-ansible-sig | 14:20 | |
*** gtema has joined #openstack-ansible-sig | 14:36 | |
*** dtantsur is now known as dtantsur|afk | 16:10 | |
*** rpittau is now known as rpittau|afk | 16:10 | |
*** gtema has quit IRC | 17:10 | |
*** priteau has quit IRC | 17:21 | |
*** gshippey has quit IRC | 21:31 |
Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!