Friday, 2020-06-05

*** gtema has joined #openstack-ansible-sig00:34
*** gtema has quit IRC00:39
*** gtema has joined #openstack-ansible-sig02:35
*** gtema has quit IRC02:39
*** priteau has joined #openstack-ansible-sig03:39
*** priteau has quit IRC03:46
*** evrardjp has quit IRC04:33
*** evrardjp has joined #openstack-ansible-sig04:33
*** gtema has joined #openstack-ansible-sig04:36
*** gtema has quit IRC04:40
*** gtema has joined #openstack-ansible-sig05:45
*** gtema has quit IRC06:49
*** gtema has joined #openstack-ansible-sig06:50
*** rpittau|afk is now known as rpittau07:04
*** gtema has quit IRC07:05
*** priteau has joined #openstack-ansible-sig07:10
*** priteau has quit IRC07:35
*** priteau has joined #openstack-ansible-sig08:02
*** priteau has quit IRC08:22
*** priteau has joined #openstack-ansible-sig08:24
*** dtantsur|afk is now known as dtantsur08:34
*** gtema has joined #openstack-ansible-sig09:33
*** rpittau is now known as rpittau|bbl10:08
dtantsurDoes anyone happen to know if I can install a collection via ansible and then immediately use it?11:12
dtantsurOr does it have to be present when ansible starts?11:12
dtantsursshnaidm|afk or mordred ^^11:12
gtemahmm, interesting question11:12
gtemaI would assume it should be possible11:13
sshnaidm|afkI don't think but worth checking11:13
sshnaidm|afkmost likely it will fail because parses playbook before run and hit unknown module11:14
gtemain this case it might be possible with the dynamic playbook inclusion11:14
sshnaidm|afkyeah, that may work11:15
dtantsurmmm, not our case.11:23
dtantsurokay, then it will be a pre-requisite of bifrost rather than something it installs11:24
*** gtema has quit IRC11:32
*** rpittau|bbl is now known as rpittau11:59
*** gtema has joined #openstack-ansible-sig12:13
*** gtema has quit IRC12:14
*** gtema has joined #openstack-ansible-sig12:27
*** gtema has quit IRC12:45
dtantsuriurygregory: FYI ^^^ it seems that the collection installation has to go to scripts/env-setup.sh12:53
iurygregorydtantsur, ack12:54
mordreddtantsur: can it go into a role, and then have the role that installs the collection be in a different play?12:54
dtantsurmordred: sure, but that won't win us much12:54
dtantsuralthough...12:54
dtantsuriurygregory: mordred has a point since we'll need to support both galaxy and source installation12:54
dtantsur(the latter to be able to run our jobs in the CI)12:54
iurygregorywow12:54
iurygregorygotcha12:54
mordreddtantsur: we use include_role in opendev to do something similar12:55
iurygregorywill need to figure out things since I never used collections =)12:55
mordreddtantsur, iurygregory https://opendev.org/opendev/system-config/src/branch/master/playbooks/roles/run-puppet/tasks/main.yaml12:55
mordredwe're not using collections yet - but we have a thing install roles from galaxy12:56
iurygregorymind blow "run-puppet"12:56
mordred(yeah :) )12:56
mordredand one of the roles "install-ansible-roles" is installing in the playbook is the puppet role12:56
mordredso I don't know if the pattern will hold for collectrions, but it's working for us for roles at least12:57
dtantsurmm, yeah12:57
mordrediurygregory: 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
dtantsurjust let's be careful and not use system-config roles in the code that is run outside of the CI :)12:58
iurygregorymordred, yeah totally true12:58
dtantsurmordred: do I recall it right that it's possible to pip-install a collection?12:58
mordreddtantsur: WELL12:58
dtantsurbad start12:58
mordreddtantsur: not generally, at least yet12:58
iurygregoryyup12:59
mordredthere are some ways - sshnaidm|afk has a patch to add a pip installation of this one12:59
dtantsurmordred: let's rephrase it: is anything able to install a collection from a git checkout to a venv?12:59
iurygregoryrpittau, would probably say no for pip-install12:59
mordredfrom git checkout - yet12:59
mordredyes12:59
mordredto a venv - not as much12:59
dtantsursigh12:59
dtantsurbifrost defaults to using a venv (for good reasons)13:00
rpittauiurygregory: if it's in venv or per-user it's ok, let's just try to avoid a 'sudo pip install'13:00
mordredyeah- collections just go into a path though13:00
dtantsurand the path is not relative to sys.prefix?13:00
mordreddtantsur: you can just copy the collection dirs into the right place - it's a defined directory structure13:00
mordreddtantsur: no - it has nothing to do with python installation context, at least I don't believe13:01
dtantsurcan it be something like $ /opt/stack/bifrost/share/blah/blah?13:01
dtantsurugh13:01
mordredit can go into ~stack13:01
dtantsuransible has been consistently bad at venving13:01
mordredyeah13:01
dtantsurmordred: 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
rpittauwhat about per-user ?13:02
dtantsurrpittau: not terrible, but inconsistent and has a chance of overwriting user's stuff13:03
mordredso - default is ~/.ansible/collections13:03
rpittaummm yeah it can get complicated13:03
mordredyou can also put them adjacent to playbook13:03
dtantsurmmm, we can do ^^ and add it to .gitignore13:03
dtantsuriurygregory: wdyt ^^13:03
iurygregorydtantsur, makes sense to me will need to do some tests to see how it goes =)13:04
mordredyou can also set the env var ANSIBLE_COLLECTIONS_PATHS13:04
mordredit defaults to ~/.ansible/collections:/usr/share/ansible/collections13:04
dtantsuroh, now we're talking!13:04
iurygregoryoh that sounds better =)13:05
mordredand ansible-galaxy collections install has a "-p" option which is the destination13:05
mordredhttps://docs.ansible.com/ansible/latest/user_guide/collections_using.html#installing-collections-with-ansible-galaxy13:05
dtantsurneat13:05
mordrednote the directory structure in there - under "collections" there's an additional "ansible_collections" dir13:05
mordredand then the collections13:05
mordredso really - if you're grabbing from git, you can just copy things13:06
dtantsurwe'll just have to use the variable everywhere and document it for end users13:06
dtantsuriurygregory: we need to check how ansible-galaxy behaves in a venv at all13:06
iurygregorydtantsur, yeah13:06
* dtantsur hopes it doesn't blow up miserably13:06
iurygregorywe all hope13:07
* dtantsur leaves it in iurygregory's capable hands ;)13:07
iurygregorytks will do my best13:08
mordreddtantsur: it should behave well - we use it in tox in ansible-collections-openstack13:09
mordrediurygregory: let me know if you run in to issues - happy to at least complain with you :)13:10
iurygregorymordred, sure =)13:10
iurygregorywill probably give a try on monday13:10
iurygregoryplaying with ironic-lib atm13:10
*** gshippey has joined #openstack-ansible-sig14:20
*** gtema has joined #openstack-ansible-sig14:36
*** dtantsur is now known as dtantsur|afk16:10
*** rpittau is now known as rpittau|afk16:10
*** gtema has quit IRC17:10
*** priteau has quit IRC17:21
*** gshippey has quit IRC21:31

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!