Updated to use dashes between the namespace and collection name.
On Sat, Feb 15, 2020 at 11:32 AM James Cassell
<fedoraproject(a)cyberpear.com> wrote:
>
> On Sat, Feb 15, 2020, at 1:25 PM, Toshio Kuratomi wrote:
> > I've come up with a sample spec file that builds and installs a
> > collection if people would like to take a look. I used comment
> > leaders of "###" for meta-notes about why I chose to write the spec
> > file that way, things that might change in the future, open questions,
> > information that might not be obvious purely from the spec file,
> > etc... Comments welcome.
> >
> >
https://gist.github.com/abadger/0b5b8a2b82049bc56cf753b1ccb4f2fc
> >
>
> Since dashes are prohibited in collection and namespace names, maybe name them
ansible-collection-$namespace-$collection
>
> Maybe it would be good to add more guidelines on the ansible side to make packaging
more consistent.
>
> V/r,
> James Cassell
>
>
> > -Toshio
> >
> > On Mon, Feb 10, 2020 at 8:45 AM Toshio Kuratomi <a.badger(a)gmail.com>
wrote:
> > >
> > >
> > >
> > > On Sun, Feb 9, 2020, 4:23 PM Orion Poplawski <orion(a)nwra.com> wrote:
> > >>
> > >> On 2/9/20 2:58 AM, Igor Gnatenko wrote:
> > >> > Hello,
> > >> >
> > >> > Did anybody had an experience of packaging Ansible collections
into an RPM?
> > >> >
> > >> > I guess if would be enough to put the files somewhere under
> > >> > /usr/share/ansible, but not sure. Also I'm not sure what
download URL
> > >> > could be used.
> > >>
> > >> It seems to me that "ansible-galaxy collection install"
simply unpacks
> > >> the tarball. So, this seems reasonable to me:
> > >>
> > >> Name: ansible-collection-%{namespace}-%{pkgname}
> > >> Source0:
> > >>
https://galaxy.ansible.com/download/%{namespace}-%{pkgname}-%{version}.ta...
> > >>
> > >> %install
> > >> mkdir -p
> > >>
%{buildroot}%{_datadir}/ansible/collections/ansible_collections/%{namespace}/%{name}
> > >> tar xf %SOURCE0 -C
> > >>
%{buildroot}%{_datadir}/ansible/collections/ansible_collections/%{namespace}/%{pkgname}
> > >
> > >
> > > i had a preliminary look at this a few months ago (because ansible 2.10
will ship most of the modules and plugins inside of collections instead of the ansible
tarball) and there are some issues...
> > >
> > > * Collections aren't necessarily noarch. Ansible modules can be
written in any language so a collection can theoretically contain a precompiled binary
module
> > >
> > > * Collections aren't actually source code. Shipping something based on
the collection as source0 could run into gpl or practical concerns due to this. If you
take the theoretical compiled collection case again, the collection would contain the
compiled module but might not contain the source code or any build scripts to build that
module.
> > >
> > > Because of those, i recommend downloading the true source of the collection
(i believe the openstack collection use the git repo as it's source?)
> > >
> > > Another note: I've been talking with the ansible core team and they are
going to add the ability to install ansible collections in a place that pip could install
them to. That means with ansible 2.10 you should be able to install into site-packages
somewhere. This may be something you want to take advantage of so noarch collections can
be packaged under /usr/lib and archful packages go under /usr/lib64 (if appropriate on
that platform)
> > >
> > > Last note: I think i had been using the ansible-galaxy tool with
appropriate command line args to control the directory unpacked collections ended up in.
At the moment it doesn't do anything different than the tar commands orion posted
above but i don't know whether that will hold true into the future.
> > >
> > > -Toshio
> > >
> > >>
> > >> --
> > >> Orion Poplawski
> > >> Manager of NWRA Technical Systems 720-772-5637
> > >> NWRA, Boulder/CoRA Office FAX: 303-415-9702
> > >> 3380 Mitchell Lane orion(a)nwra.com
> > >> Boulder, CO 80301
https://www.nwra.com/
> > >>
> _______________________________________________
> packaging mailing list -- packaging(a)lists.fedoraproject.org
> To unsubscribe send an email to packaging-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproje...