Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-03 Thread Andrea Bolognani
On Mon, 2019-12-02 at 20:33 +0100, Andrea Bolognani wrote:
> > On Tue, Nov 26, 2019 at 1:52 AM Jim Fehlig  wrote:
> > > +++ b/guests/host_vars/libvirt-opensuse-15/main.yml
> > > @@ -0,0 +1,22 @@
> > > +---
> > > +projects:
> > > +  - libosinfo
> > > +  - libvirt
> > > +  - libvirt-cim
> > > +  - libvirt-dbus
> > > +  - libvirt-glib
> > > +  - libvirt-perl
> > > +  - libvirt-python
> > > +  - libvirt-sandbox
> > > +  - libvirt-tck
> > > +  - osinfo-db
> > > +  - osinfo-db-tools
> > > +  - virt-manager
> > > +  - virt-viewer
> 
> Since right now we're only aiming at building libvirt, we should only
> list that project: it's a good starting point, and we can add more as
> we make sure we can actually 'lcitool build' them successfully.

I didn't mention this explicitly, but part of "focusing on libvirt
only as a first stab" means only adding the mappings necessary to
resolve the abstract package names listed in

  guests/vars/projects/base.yml
  guests/vars/projects/blacklist.yml
  guests/vars/projects/libvirt.yml

All other mappings should go in at the same time as additional
projects are enabled.

I think that we're basically good: once Fabiano has posted his
patches addressing CentOS 7.3 compatibility, you can respin on top
of them while addressing review comments, and unless we happen to
notice something that was missed until now we should be able to
finally merge openSUSE support :)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-03 Thread Andrea Bolognani
On Tue, 2019-12-03 at 13:54 +0100, Fabiano Fidêncio wrote:
> > > > > 'lci update ... libvirt' fails in task "Configure hostname":
> > > > > 
> > > > > fatal: [libvirt-opensuse-tumbleweed]: FAILED! => {"changed": false, 
> > > > > "msg": "hostname module cannot be used on platform Linux 
> > > > > (Opensuse-tumbleweed)"}
> > > > 
> > > > It seems to be an Ansible bug: 
> > > > https://github.com/ansible/ansible/issues/42726
> 
> I've opened a PR for ansible with a fix for this issue:
> https://github.com/ansible/ansible/pull/65457
> 
> With this one fixed and backported to the host OS libvirt-jenkins-ci
> uses we will be able to also add tumbleweed.

Backporting the fix locally on the production host would be a bit
gross, but luckily we don't really need to worry about that since
we're not going to run openSUSE Tumbleweed there - just like we
don't have Debian sid or FreeBSD -CURRENT :)

Either way, great job!

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-03 Thread Fabiano Fidêncio
> > > > 'lci update ... libvirt' fails in task "Configure hostname":
> > > >
> > > > fatal: [libvirt-opensuse-tumbleweed]: FAILED! => {"changed": false, 
> > > > "msg": "hostname module cannot be used on platform Linux 
> > > > (Opensuse-tumbleweed)"}
> > >
> > > It seems to be an Ansible bug: 
> > > https://github.com/ansible/ansible/issues/42726
> >
> > Is it possible that this failed simply because the hostname command
> > is not available? You mention this below.
>
> No. When testing this patch I was already installing "hostname" in the box.
>

I've opened a PR for ansible with a fix for this issue:
https://github.com/ansible/ansible/pull/65457

With this one fixed and backported to the host OS libvirt-jenkins-ci
uses we will be able to also add tumbleweed.


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-03 Thread Andrea Bolognani
On Tue, 2019-12-03 at 11:50 +0100, Fabiano Fidêncio wrote:
> > It sounds like we can just provide install= unconditionally, same as
> > we currently do with ks=? We'd have to verify doing so doesn't cause
> > any unintended side-effects for existing guest types.
> 
> I'd rather have it done in a more explicit way, just for the sake of
> someone else trying to debug / understand the code later on.

A comment in the code will do just fine, in my opinion. And then,
when we can start relying on a new enough virt-install, we can drop
the workaround with minimal fuss.

Our unconditional use of ks= could also benefit from being explained
in a comment, by the way. I'll post a patch for that shortly.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-03 Thread Fabiano Fidêncio
Andrea,

> It sounds like we can just provide install= unconditionally, same as
> we currently do with ks=? We'd have to verify doing so doesn't cause
> any unintended side-effects for existing guest types.

I'd rather have it done in a more explicit way, just for the sake of
someone else trying to debug / understand the code later on.

>
> (Incidentally, didn't CentOS 8 also require passing the installation
> URL explicitly based on your tests, or something like that?

That's a different issue. :-)
CentOS 8 explicitly requires the URL to be set in the kickstart file.
That's another issue, to be solved another day ...

> We need
> to get around to adding that OS to CI too at some point O:-)

... most likely when we add CentOS 8 VMs. :-)

> >
> > An important question ... can't we have / use a CentOS 8 machine?
> > Would be lovely to not have to work those issues around on lcitool.
>
> I'd love that as well, but I'm afraid that's out of our hands since
> the CentOS CI machines are handled by the CentOS CI folks... We could
> try asking nicely and see what happens :) But in the short term
> having a workaround in lcitool is definitely the way to go.

I see.


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-03 Thread Andrea Bolognani
On Tue, 2019-12-03 at 11:05 +0100, Fabiano Fidêncio wrote:
> > Speaking of which: I've run into a fairly major problem with
> > the Leap 15.1 support enabled by this patch: while unattended
> > installation works as expected on my laptop (Fedora 31), when I try
> > the same steps on the CentOS CI production environment (CentOS 7.5)
> > it doesn't seem to find or recognize the autoinst.xml file: instead,
> > I get a "please make sure your installation medium is available"
> > message and the chance to input the information manually, which is
> > obviously not what we want :) I'll try to figure out what's going
> > wrong tomorrow.
> 
> So, the error you're facing is not because the autoinst.xml file is
> not recognised. It happens because the installation source is not
> passed.
> 
> virt-install 1.5.0, which is the version present on CentOS 7.5,
> doesn't seem to know the proper kernel URL argument to be passed to
> different distros. So far it worked because it uses "method=URL",
> which is what both CentOS 7 / Fedora (the ones we care about) use and
> Ubuntu / Debian are special with regard to this.
> 
> OpenSUSE, though, requires "install=URL" to be passed. As it doesn't
> happen, the installation asks for a specific installation source.

So that was the problem! Great detective work :)

> Okay, the way to go, IMHO, is patching lcitool to:
> - Have a kernel-url-argument as part of the distro definition;
> - Mount the extra-args based on that;
> 
> Mind that "method=" will always be appended but as long as we provide
> the "install=" to the kernel command line, we're fine.

It sounds like we can just provide install= unconditionally, same as
we currently do with ks=? We'd have to verify doing so doesn't cause
any unintended side-effects for existing guest types.

(Incidentally, didn't CentOS 8 also require passing the installation
URL explicitly based on your tests, or something like that? We need
to get around to adding that OS to CI too at some point O:-)

> I'll cook some patches in the afternoon and post them.
> 
> An important question ... can't we have / use a CentOS 8 machine?
> Would be lovely to not have to work those issues around on lcitool.

I'd love that as well, but I'm afraid that's out of our hands since
the CentOS CI machines are handled by the CentOS CI folks... We could
try asking nicely and see what happens :) But in the short term
having a workaround in lcitool is definitely the way to go.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-03 Thread Fabiano Fidêncio
Andrea,

>
> Speaking of which: I've run into a fairly major problem with
> the Leap 15.1 support enabled by this patch: while unattended
> installation works as expected on my laptop (Fedora 31), when I try
> the same steps on the CentOS CI production environment (CentOS 7.5)
> it doesn't seem to find or recognize the autoinst.xml file: instead,
> I get a "please make sure your installation medium is available"
> message and the chance to input the information manually, which is
> obviously not what we want :) I'll try to figure out what's going
> wrong tomorrow.

So, the error you're facing is not because the autoinst.xml file is
not recognised. It happens because the installation source is not
passed.

virt-install 1.5.0, which is the version present on CentOS 7.5,
doesn't seem to know the proper kernel URL argument to be passed to
different distros. So far it worked because it uses "method=URL",
which is what both CentOS 7 / Fedora (the ones we care about) use and
Ubuntu / Debian are special with regard to this.

OpenSUSE, though, requires "install=URL" to be passed. As it doesn't
happen, the installation asks for a specific installation source.

Okay, the way to go, IMHO, is patching lcitool to:
- Have a kernel-url-argument as part of the distro definition;
- Mount the extra-args based on that;

Mind that "method=" will always be appended but as long as we provide
the "install=" to the kernel command line, we're fine.

I'll cook some patches in the afternoon and post them.

An important question ... can't we have / use a CentOS 8 machine?
Would be lovely to not have to work those issues around on lcitool.

Best Regards,
-- 
Fabiano Fidêncio

>
>
> [1] guests/playbooks/update/tasks/packages.yml
> --
> Andrea Bolognani / Red Hat / Virtualization
>


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-02 Thread Fabiano Fidêncio
On Mon, Dec 2, 2019 at 8:33 PM Andrea Bolognani  wrote:
>
> On Mon, 2019-12-02 at 16:41 +0100, Fabiano Fidêncio wrote:
> > Jim,
> >
> > Firstly, sorry it took so long for me to give it a try in your patch.
> >
> > Now, comments inline ...
> >
> > On Tue, Nov 26, 2019 at 1:52 AM Jim Fehlig  wrote:
> > > This change adds support for the latest openSUSE Leap and
> > > openSUSE Tumbleweed guests.
> > >
> > > Signed-off-by: Jim Fehlig 
> > > ---
> > >
> > > This version of the patch overcomes the 'lci build' issues noted in V1
> > > and works well for openSUSE Leap 15.1 and Tumbleweed. I'm still of the
> > > opinion of only supporting the latest Leap since there is only a six
> > > month support overlap between versions. Version x-1 is only supported
> > > six months after x is released.
> >
> > I will leave this up to you and Andrea. I'd say, whatever floats your boat. 
> > :-)
>
> That won't work if, as you said earlier, you can't seamlessly move
> from eg. 15.1 to 15.2: either you can move from one minor version to
> the next with a simple upgrade, as is the case for CentOS and Debian,
> or you need to consider the two as separate entities, as is the case
> for Fedora, otherwise libvirt-opensuse-15 will mean vastly different
> things depending on whether you installed in the 15.1 timeframe or
> in the 15.2 timeframe...
>
> It's annoying, but I'm afraid we're going to have to include the
> minor version number in the name even though we're only likely to
> ever support one 42.x and one 15.x at any given time.
>
> One more note about naming: I just remembered why I decided for
> libvirt-ubuntu-18 instead of the more obvious libvirt-ubuntu-18.04
> back then: the guest name is also used as the hostname, and I wanted
> to avoid having extra dots in the latter. Perhaps that's overzealous
> of me, but assuming we want to stick with that principle then we
> should call this libvirt-opensuse-151, and later rename the
> aforementioned to libvirt-ubuntu-1804 to be consistent.
>
> > > 'lci update ... libvirt' fails in task "Configure hostname":
> > >
> > > fatal: [libvirt-opensuse-tumbleweed]: FAILED! => {"changed": false, 
> > > "msg": "hostname module cannot be used on platform Linux 
> > > (Opensuse-tumbleweed)"}
> >
> > It seems to be an Ansible bug: 
> > https://github.com/ansible/ansible/issues/42726
>
> Is it possible that this failed simply because the hostname command
> is not available? You mention this below.

No. When testing this patch I was already installing "hostname" in the box.

>
> > > Not sure why that is the case. But more importantly, even though it
> > > doesn't fail, the "Update installed packages" task doesn't install any
> > > of the packages required to build libvirt.
>
> That step merely updates the packages that are already installed.
>
> > > I suppose that agrees with
> > > guests/REAMDME, but how then are the packages required to build $project
> > > installed? How/when is the list of packages required to build $project
> > > conveyed to $package_manager?
>
> That happens later[1].
>
> > > 'lcitool build libvirt-opensuse-tumbleweed libvirt' fails in the
> > > "Gathering Facts" task:
> > >
> > > fatal: [libvirt-opensuse-tumbleweed]: UNREACHABLE! => {"changed": false, 
> > > "msg": "Invalid/incorrect password: ", "unreachable": true}
> >
> > I didn't get this far, I'd firstly try to get the first part fixed as
> > this whole thing is sequential ...
>
> We can add Leap 15.1 first, and worry about tumbleweed later. It's
> probably a good idea to add them in separate commits anyway.
>
> > > Passing --debug to the command didn't help with determining what needed
> > > the password. ssh? I can't find where the "Gathering Facts" task is
> > > defined.
>
> That's not a custom task, but rather something that Ansible does
> automatically when it connects to a host.
>
> > > The $root_password_file passed to /usr/bin/ansible-playbook
> > > contains the correct password for the root user. /me needs to figure
> > > out how to better debug this stuff :-).
>
> I'm pretty sure 'lcitool build' failed simply because 'lcitool
> update' failed before it, and more specifically didn't manage to get
> far enough to set up a regular user to use for builds.
>
> I agree debugging this kind of issue is not exactly trivial...
> Unfortunately there's no easy solution to the problem either :(
>
> > > +++ b/guests/configs/autoinst.xml
> > > @@ -0,0 +1,75 @@
> > > +
> > > +
> > > + > > +  xmlns="http://www.suse.com/1.0/yast2ns";
> > > +  xmlns:config="http://www.suse.com/1.0/configns";>
> > > +  
> > > +
> > > +  false
> >
> > Here, please, also add:
> > false
> >
> > It'll avoid an unnecessary reboot in the VM.
>
> I didn't test this, but it sounds reasonable. I'll give it an actual
> go tomorrow :)
>
> [...]
> > > +  
> > > + > > config:type="boolean">false
> > > +
> > > +  openSUSE
> > > +
> > > +
> > > +  base
> > > +  minimal_base
> > > +  yast2_basis
> > > +
> > > +
> >

Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-02 Thread Andrea Bolognani
On Mon, 2019-12-02 at 16:41 +0100, Fabiano Fidêncio wrote:
> Jim,
> 
> Firstly, sorry it took so long for me to give it a try in your patch.
> 
> Now, comments inline ...
> 
> On Tue, Nov 26, 2019 at 1:52 AM Jim Fehlig  wrote:
> > This change adds support for the latest openSUSE Leap and
> > openSUSE Tumbleweed guests.
> > 
> > Signed-off-by: Jim Fehlig 
> > ---
> > 
> > This version of the patch overcomes the 'lci build' issues noted in V1
> > and works well for openSUSE Leap 15.1 and Tumbleweed. I'm still of the
> > opinion of only supporting the latest Leap since there is only a six
> > month support overlap between versions. Version x-1 is only supported
> > six months after x is released.
> 
> I will leave this up to you and Andrea. I'd say, whatever floats your boat. 
> :-)

That won't work if, as you said earlier, you can't seamlessly move
from eg. 15.1 to 15.2: either you can move from one minor version to
the next with a simple upgrade, as is the case for CentOS and Debian,
or you need to consider the two as separate entities, as is the case
for Fedora, otherwise libvirt-opensuse-15 will mean vastly different
things depending on whether you installed in the 15.1 timeframe or
in the 15.2 timeframe...

It's annoying, but I'm afraid we're going to have to include the
minor version number in the name even though we're only likely to
ever support one 42.x and one 15.x at any given time.

One more note about naming: I just remembered why I decided for
libvirt-ubuntu-18 instead of the more obvious libvirt-ubuntu-18.04
back then: the guest name is also used as the hostname, and I wanted
to avoid having extra dots in the latter. Perhaps that's overzealous
of me, but assuming we want to stick with that principle then we
should call this libvirt-opensuse-151, and later rename the
aforementioned to libvirt-ubuntu-1804 to be consistent.

> > 'lci update ... libvirt' fails in task "Configure hostname":
> > 
> > fatal: [libvirt-opensuse-tumbleweed]: FAILED! => {"changed": false, "msg": 
> > "hostname module cannot be used on platform Linux (Opensuse-tumbleweed)"}
> 
> It seems to be an Ansible bug: https://github.com/ansible/ansible/issues/42726

Is it possible that this failed simply because the hostname command
is not available? You mention this below.

> > Not sure why that is the case. But more importantly, even though it
> > doesn't fail, the "Update installed packages" task doesn't install any
> > of the packages required to build libvirt.

That step merely updates the packages that are already installed.

> > I suppose that agrees with
> > guests/REAMDME, but how then are the packages required to build $project
> > installed? How/when is the list of packages required to build $project
> > conveyed to $package_manager?

That happens later[1].

> > 'lcitool build libvirt-opensuse-tumbleweed libvirt' fails in the
> > "Gathering Facts" task:
> > 
> > fatal: [libvirt-opensuse-tumbleweed]: UNREACHABLE! => {"changed": false, 
> > "msg": "Invalid/incorrect password: ", "unreachable": true}
> 
> I didn't get this far, I'd firstly try to get the first part fixed as
> this whole thing is sequential ...

We can add Leap 15.1 first, and worry about tumbleweed later. It's
probably a good idea to add them in separate commits anyway.

> > Passing --debug to the command didn't help with determining what needed
> > the password. ssh? I can't find where the "Gathering Facts" task is
> > defined.

That's not a custom task, but rather something that Ansible does
automatically when it connects to a host.

> > The $root_password_file passed to /usr/bin/ansible-playbook
> > contains the correct password for the root user. /me needs to figure
> > out how to better debug this stuff :-).

I'm pretty sure 'lcitool build' failed simply because 'lcitool
update' failed before it, and more specifically didn't manage to get
far enough to set up a regular user to use for builds.

I agree debugging this kind of issue is not exactly trivial...
Unfortunately there's no easy solution to the problem either :(

> > +++ b/guests/configs/autoinst.xml
> > @@ -0,0 +1,75 @@
> > +
> > +
> > + > +  xmlns="http://www.suse.com/1.0/yast2ns";
> > +  xmlns:config="http://www.suse.com/1.0/configns";>
> > +  
> > +
> > +  false
> 
> Here, please, also add:
> false
> 
> It'll avoid an unnecessary reboot in the VM.

I didn't test this, but it sounds reasonable. I'll give it an actual
go tomorrow :)

[...]
> > +  
> > +false
> > +
> > +  openSUSE
> > +
> > +
> > +  base
> > +  minimal_base
> > +  yast2_basis
> > +
> > +
> 
> Here, please, also add:
> hostname
> 
> Seems that lcitools rely on having hostname installed in the machine
> and "hostname" is used before actually installing the packages. Or,
> IOW, trying to install the package afterwards wouldn't work. (I gave
> it a try).

This also sounds good.

> > +++ b/guests/host_vars/libvirt-opensuse-15/docker.yml
> > @@ -0,0 +1,2 @@
> > +---
> > +docker_base: ope

Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-02 Thread Fabiano Fidêncio
On Mon, Dec 2, 2019 at 4:41 PM Fabiano Fidêncio  wrote:
>
> Jim,
>
> Firstly, sorry it took so long for me to give it a try in your patch.
>
> Now, comments inline ...
>
> On Tue, Nov 26, 2019 at 1:52 AM Jim Fehlig  wrote:
> >
> > This change adds support for the latest openSUSE Leap and
> > openSUSE Tumbleweed guests.
> >
> > Signed-off-by: Jim Fehlig 
> > ---
> >
> > This version of the patch overcomes the 'lci build' issues noted in V1
> > and works well for openSUSE Leap 15.1 and Tumbleweed. I'm still of the
> > opinion of only supporting the latest Leap since there is only a six
> > month support overlap between versions. Version x-1 is only supported
> > six months after x is released.
>
> I will leave this up to you and Andrea. I'd say, whatever floats your boat. 
> :-)
>
> >
> > 'lci update ... libvirt' fails in task "Configure hostname":
> >
> > fatal: [libvirt-opensuse-tumbleweed]: FAILED! => {"changed": false, "msg": 
> > "hostname module cannot be used on platform Linux (Opensuse-tumbleweed)"}
>
> It seems to be an Ansible bug: https://github.com/ansible/ansible/issues/42726
>
> >
> > Not sure why that is the case. But more importantly, even though it
> > doesn't fail, the "Update installed packages" task doesn't install any
> > of the packages required to build libvirt. I suppose that agrees with
> > guests/REAMDME, but how then are the packages required to build $project
> > installed? How/when is the list of packages required to build $project
> > conveyed to $package_manager?
> >
> > 'lcitool build libvirt-opensuse-tumbleweed libvirt' fails in the
> > "Gathering Facts" task:
> >
> > fatal: [libvirt-opensuse-tumbleweed]: UNREACHABLE! => {"changed": false, 
> > "msg": "Invalid/incorrect password: ", "unreachable": true}
>
> I didn't get this far, I'd firstly try to get the first part fixed as
> this whole thing is sequential ...
>
> >
> > Passing --debug to the command didn't help with determining what needed
> > the password. ssh? I can't find where the "Gathering Facts" task is
> > defined. The $root_password_file passed to /usr/bin/ansible-playbook
> > contains the correct password for the root user. /me needs to figure
> > out how to better debug this stuff :-).
> >
> >  guests/configs/autoinst.xml   | 75 +++
> >  .../host_vars/libvirt-opensuse-15/docker.yml  |  2 +
> >  .../host_vars/libvirt-opensuse-15/install.yml |  2 +
> >  guests/host_vars/libvirt-opensuse-15/main.yml | 22 ++
> >  .../libvirt-opensuse-tumbleweed/docker.yml|  2 +
> >  .../libvirt-opensuse-tumbleweed/install.yml   |  2 +
> >  .../libvirt-opensuse-tumbleweed/main.yml  | 22 ++
> >  guests/inventory  |  2 +
> >  guests/lcitool|  2 +
> >  guests/playbooks/update/tasks/base.yml| 15 
> >  guests/vars/mappings.yml  | 41 +-
> >  11 files changed, 185 insertions(+), 2 deletions(-)
> >
> > diff --git a/guests/configs/autoinst.xml b/guests/configs/autoinst.xml
> > new file mode 100644
> > index 000..42c42f8
> > --- /dev/null
> > +++ b/guests/configs/autoinst.xml
> > @@ -0,0 +1,75 @@
> > +
> > +
> > + > +  xmlns="http://www.suse.com/1.0/yast2ns";
> > +  xmlns:config="http://www.suse.com/1.0/configns";>
> > +  
> > +
> > +  false
>
> Here, please, also add:
> false
>
> It'll avoid an unnecessary reboot in the VM.
>
> > +
> > +  
> > +  
> > +
> > +  /dev/vda
> > +  all
> > +  
> > +
> > +  swap
> > +  256M
> > +  swap
> > +
> > +
> > +  ext4
> > +  /
> > +  max
> > +
> > +  
> > +
> > +  
> > +  
> > +
> > +  console serial
> > +
> > +  
> > +  
> > +UTC
> > +UTC
> > +  
> > +  
> > +false
> > +
> > +  openSUSE
> > +
> > +
> > +  base
> > +  minimal_base
> > +  yast2_basis
> > +
> > +
>
> Here, please, also add:
> hostname
>
> Seems that lcitools rely on having hostname installed in the machine
> and "hostname" is used before actually installing the packages. Or,
> IOW, trying to install the package afterwards wouldn't work. (I gave
> it a try).
>
> > +  openssh
> > +
> > +  
> > +  
> > +true
> > +  
> > +  
> > +
> > +  root
> > +  root
> > +  false
> > +  0
> > +  0
> > +  /root
> > +  /bin/bash
> > +
> > +  
> > +  
> > +multi-user
> > +
> > +  
> > +sshd
> > +enable
> > +  
> > +
> > +  
> > +
> > diff --git a/guests/host_vars/libvirt-opensuse-15/docker.yml 
> > b/guests/host_vars/libvirt-opensuse-15/docker.yml
> > new file mode 100644
> > index 000..8f32d06
> > --- /dev/null
> > +++ b/guests/host_vars/libvirt-opensuse-15/docker.yml
> > @@ -0,0 +1,2 @@
> > +---
> > +docker_base: opensuse/leap:15
> > diff --git a/guests/host_vars/libvirt-opensuse-15/install.yml 
> > b/guests/host_vars/libvirt-opensuse-15/install.yml
> >

Re: [libvirt] [PATCH RFC V2] guests: Add support for openSUSE

2019-12-02 Thread Fabiano Fidêncio
Jim,

Firstly, sorry it took so long for me to give it a try in your patch.

Now, comments inline ...

On Tue, Nov 26, 2019 at 1:52 AM Jim Fehlig  wrote:
>
> This change adds support for the latest openSUSE Leap and
> openSUSE Tumbleweed guests.
>
> Signed-off-by: Jim Fehlig 
> ---
>
> This version of the patch overcomes the 'lci build' issues noted in V1
> and works well for openSUSE Leap 15.1 and Tumbleweed. I'm still of the
> opinion of only supporting the latest Leap since there is only a six
> month support overlap between versions. Version x-1 is only supported
> six months after x is released.

I will leave this up to you and Andrea. I'd say, whatever floats your boat. :-)

>
> 'lci update ... libvirt' fails in task "Configure hostname":
>
> fatal: [libvirt-opensuse-tumbleweed]: FAILED! => {"changed": false, "msg": 
> "hostname module cannot be used on platform Linux (Opensuse-tumbleweed)"}

It seems to be an Ansible bug: https://github.com/ansible/ansible/issues/42726

>
> Not sure why that is the case. But more importantly, even though it
> doesn't fail, the "Update installed packages" task doesn't install any
> of the packages required to build libvirt. I suppose that agrees with
> guests/REAMDME, but how then are the packages required to build $project
> installed? How/when is the list of packages required to build $project
> conveyed to $package_manager?
>
> 'lcitool build libvirt-opensuse-tumbleweed libvirt' fails in the
> "Gathering Facts" task:
>
> fatal: [libvirt-opensuse-tumbleweed]: UNREACHABLE! => {"changed": false, 
> "msg": "Invalid/incorrect password: ", "unreachable": true}

I didn't get this far, I'd firstly try to get the first part fixed as
this whole thing is sequential ...

>
> Passing --debug to the command didn't help with determining what needed
> the password. ssh? I can't find where the "Gathering Facts" task is
> defined. The $root_password_file passed to /usr/bin/ansible-playbook
> contains the correct password for the root user. /me needs to figure
> out how to better debug this stuff :-).
>
>  guests/configs/autoinst.xml   | 75 +++
>  .../host_vars/libvirt-opensuse-15/docker.yml  |  2 +
>  .../host_vars/libvirt-opensuse-15/install.yml |  2 +
>  guests/host_vars/libvirt-opensuse-15/main.yml | 22 ++
>  .../libvirt-opensuse-tumbleweed/docker.yml|  2 +
>  .../libvirt-opensuse-tumbleweed/install.yml   |  2 +
>  .../libvirt-opensuse-tumbleweed/main.yml  | 22 ++
>  guests/inventory  |  2 +
>  guests/lcitool|  2 +
>  guests/playbooks/update/tasks/base.yml| 15 
>  guests/vars/mappings.yml  | 41 +-
>  11 files changed, 185 insertions(+), 2 deletions(-)
>
> diff --git a/guests/configs/autoinst.xml b/guests/configs/autoinst.xml
> new file mode 100644
> index 000..42c42f8
> --- /dev/null
> +++ b/guests/configs/autoinst.xml
> @@ -0,0 +1,75 @@
> +
> +
> + +  xmlns="http://www.suse.com/1.0/yast2ns";
> +  xmlns:config="http://www.suse.com/1.0/configns";>
> +  
> +
> +  false

Here, please, also add:
false

It'll avoid an unnecessary reboot in the VM.

> +
> +  
> +  
> +
> +  /dev/vda
> +  all
> +  
> +
> +  swap
> +  256M
> +  swap
> +
> +
> +  ext4
> +  /
> +  max
> +
> +  
> +
> +  
> +  
> +
> +  console serial
> +
> +  
> +  
> +UTC
> +UTC
> +  
> +  
> +false
> +
> +  openSUSE
> +
> +
> +  base
> +  minimal_base
> +  yast2_basis
> +
> +

Here, please, also add:
hostname

Seems that lcitools rely on having hostname installed in the machine
and "hostname" is used before actually installing the packages. Or,
IOW, trying to install the package afterwards wouldn't work. (I gave
it a try).

> +  openssh
> +
> +  
> +  
> +true
> +  
> +  
> +
> +  root
> +  root
> +  false
> +  0
> +  0
> +  /root
> +  /bin/bash
> +
> +  
> +  
> +multi-user
> +
> +  
> +sshd
> +enable
> +  
> +
> +  
> +
> diff --git a/guests/host_vars/libvirt-opensuse-15/docker.yml 
> b/guests/host_vars/libvirt-opensuse-15/docker.yml
> new file mode 100644
> index 000..8f32d06
> --- /dev/null
> +++ b/guests/host_vars/libvirt-opensuse-15/docker.yml
> @@ -0,0 +1,2 @@
> +---
> +docker_base: opensuse/leap:15
> diff --git a/guests/host_vars/libvirt-opensuse-15/install.yml 
> b/guests/host_vars/libvirt-opensuse-15/install.yml
> new file mode 100644
> index 000..d0fdbe5
> --- /dev/null
> +++ b/guests/host_vars/libvirt-opensuse-15/install.yml
> @@ -0,0 +1,2 @@
> +---
> +install_url: http://download.opensuse.org/distribution/leap/15.1/repo/oss/
> diff --git a/guests/host_vars/libvirt-opensuse-15/main.yml 
> b/guests/host_vars/libvirt-opensuse-15/main.yml
> new file mode 100644
> index 000..abd83c5
> --- /dev/nu