[libvirt] [jenkins-ci PATCH 2/3] guests: Don't expose 'jenkins' pseudo-package

Andrea Bolognani posted 3 patches 7 years, 3 months ago
[libvirt] [jenkins-ci PATCH 2/3] guests: Don't expose 'jenkins' pseudo-package
Posted by Andrea Bolognani 7 years, 3 months ago
The 'jenkins' pseudo-package is an implementation detail, and
as such is better not exposed.

Moreover, with this change the JDK will only be installed when
the 'jenkins' flavor is used, which means developers will have
slightly smaller guests.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 guests/host_vars/libvirt-centos-6/main.yml       | 1 -
 guests/host_vars/libvirt-centos-7/main.yml       | 1 -
 guests/host_vars/libvirt-debian-8/main.yml       | 1 -
 guests/host_vars/libvirt-debian-9/main.yml       | 1 -
 guests/host_vars/libvirt-fedora-26/main.yml      | 1 -
 guests/host_vars/libvirt-fedora-27/main.yml      | 1 -
 guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 -
 guests/host_vars/libvirt-freebsd-10/main.yml     | 1 -
 guests/host_vars/libvirt-freebsd-11/main.yml     | 1 -
 guests/site.yml                                  | 7 +++++++
 10 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/guests/host_vars/libvirt-centos-6/main.yml b/guests/host_vars/libvirt-centos-6/main.yml
index d717ae7..e959ecc 100644
--- a/guests/host_vars/libvirt-centos-6/main.yml
+++ b/guests/host_vars/libvirt-centos-6/main.yml
@@ -1,7 +1,6 @@
 ---
 projects:
   - base
-  - jenkins
   - libvirt
   - libvirt-cim
   - libvirt-perl
diff --git a/guests/host_vars/libvirt-centos-7/main.yml b/guests/host_vars/libvirt-centos-7/main.yml
index 8338f99..54a9e63 100644
--- a/guests/host_vars/libvirt-centos-7/main.yml
+++ b/guests/host_vars/libvirt-centos-7/main.yml
@@ -1,7 +1,6 @@
 ---
 projects:
   - base
-  - jenkins
   - libosinfo
   - libvirt
   - libvirt-cim
diff --git a/guests/host_vars/libvirt-debian-8/main.yml b/guests/host_vars/libvirt-debian-8/main.yml
index ecf9cd3..6d2d24b 100644
--- a/guests/host_vars/libvirt-debian-8/main.yml
+++ b/guests/host_vars/libvirt-debian-8/main.yml
@@ -1,7 +1,6 @@
 ---
 projects:
   - base
-  - jenkins
   - libosinfo
   - libvirt
   - libvirt-glib
diff --git a/guests/host_vars/libvirt-debian-9/main.yml b/guests/host_vars/libvirt-debian-9/main.yml
index cc7cfa6..ff28698 100644
--- a/guests/host_vars/libvirt-debian-9/main.yml
+++ b/guests/host_vars/libvirt-debian-9/main.yml
@@ -1,7 +1,6 @@
 ---
 projects:
   - base
-  - jenkins
   - libosinfo
   - libvirt
   - libvirt-glib
diff --git a/guests/host_vars/libvirt-fedora-26/main.yml b/guests/host_vars/libvirt-fedora-26/main.yml
index 539c111..8d3b26f 100644
--- a/guests/host_vars/libvirt-fedora-26/main.yml
+++ b/guests/host_vars/libvirt-fedora-26/main.yml
@@ -1,7 +1,6 @@
 ---
 projects:
   - base
-  - jenkins
   - libosinfo
   - libvirt
   - libvirt-cim
diff --git a/guests/host_vars/libvirt-fedora-27/main.yml b/guests/host_vars/libvirt-fedora-27/main.yml
index 539c111..8d3b26f 100644
--- a/guests/host_vars/libvirt-fedora-27/main.yml
+++ b/guests/host_vars/libvirt-fedora-27/main.yml
@@ -1,7 +1,6 @@
 ---
 projects:
   - base
-  - jenkins
   - libosinfo
   - libvirt
   - libvirt-cim
diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml b/guests/host_vars/libvirt-fedora-rawhide/main.yml
index 539c111..8d3b26f 100644
--- a/guests/host_vars/libvirt-fedora-rawhide/main.yml
+++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml
@@ -1,7 +1,6 @@
 ---
 projects:
   - base
-  - jenkins
   - libosinfo
   - libvirt
   - libvirt-cim
diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml b/guests/host_vars/libvirt-freebsd-10/main.yml
index a83eed1..3848c3d 100644
--- a/guests/host_vars/libvirt-freebsd-10/main.yml
+++ b/guests/host_vars/libvirt-freebsd-10/main.yml
@@ -9,7 +9,6 @@ sudoers: /usr/local/etc/sudoers
 
 projects:
   - base
-  - jenkins
   - libosinfo
   - libvirt
   - libvirt-glib
diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_vars/libvirt-freebsd-11/main.yml
index a83eed1..3848c3d 100644
--- a/guests/host_vars/libvirt-freebsd-11/main.yml
+++ b/guests/host_vars/libvirt-freebsd-11/main.yml
@@ -9,7 +9,6 @@ sudoers: /usr/local/etc/sudoers
 
 projects:
   - base
-  - jenkins
   - libosinfo
   - libvirt
   - libvirt-glib
diff --git a/guests/site.yml b/guests/site.yml
index 8d32561..509d31a 100644
--- a/guests/site.yml
+++ b/guests/site.yml
@@ -28,6 +28,13 @@
       when:
         - projects is defined
 
+    # Install packages needed for the Jenkins agent
+    - include: tasks/packages.yml
+      vars:
+        project: jenkins
+      when:
+        - flavor == "jenkins"
+
     # Configure the Jenkins agent
     - include: tasks/jenkins.yml
       when:
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH 2/3] guests: Don't expose 'jenkins' pseudo-package
Posted by Pavel Hrdina 7 years, 3 months ago
On Tue, Mar 20, 2018 at 05:23:59PM +0100, Andrea Bolognani wrote:
> The 'jenkins' pseudo-package is an implementation detail, and
> as such is better not exposed.
> 
> Moreover, with this change the JDK will only be installed when
> the 'jenkins' flavor is used, which means developers will have
> slightly smaller guests.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  guests/host_vars/libvirt-centos-6/main.yml       | 1 -
>  guests/host_vars/libvirt-centos-7/main.yml       | 1 -
>  guests/host_vars/libvirt-debian-8/main.yml       | 1 -
>  guests/host_vars/libvirt-debian-9/main.yml       | 1 -
>  guests/host_vars/libvirt-fedora-26/main.yml      | 1 -
>  guests/host_vars/libvirt-fedora-27/main.yml      | 1 -
>  guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 -
>  guests/host_vars/libvirt-freebsd-10/main.yml     | 1 -
>  guests/host_vars/libvirt-freebsd-11/main.yml     | 1 -
>  guests/site.yml                                  | 7 +++++++
>  10 files changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/guests/site.yml b/guests/site.yml
> index 8d32561..509d31a 100644
> --- a/guests/site.yml
> +++ b/guests/site.yml
> @@ -28,6 +28,13 @@
>        when:
>          - projects is defined
>  
> +    # Install packages needed for the Jenkins agent
> +    - include: tasks/packages.yml
> +      vars:
> +        project: jenkins
> +      when:
> +        - flavor == "jenkins"
> +
>      # Configure the Jenkins agent
>      - include: tasks/jenkins.yml
>        when:

Would it make sense to move the installation of packages needed
for Jenkins agent into the jenkins task to create a single unit
out of it?

Otherwise looks good.

Pavel
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH 2/3] guests: Don't expose 'jenkins' pseudo-package
Posted by Andrea Bolognani 7 years, 3 months ago
On Wed, 2018-03-21 at 15:56 +0100, Pavel Hrdina wrote:
> > +    # Install packages needed for the Jenkins agent
> > +    - include: tasks/packages.yml
> > +      vars:
> > +        project: jenkins
> > +      when:
> > +        - flavor == "jenkins"
> > +
> >      # Configure the Jenkins agent
> >      - include: tasks/jenkins.yml
> >        when:
> 
> Would it make sense to move the installation of packages needed
> for Jenkins agent into the jenkins task to create a single unit
> out of it?

Maybe. However, I really like the current flat structure, where
there is no task that includes another task, and site.yml is the
one including everything as needed. I think it makes it easier to
understand what's going on, so I'd prefer keeping it this way.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH 2/3] guests: Don't expose 'jenkins' pseudo-package
Posted by Pavel Hrdina 7 years, 3 months ago
On Wed, Mar 21, 2018 at 04:12:09PM +0100, Andrea Bolognani wrote:
> On Wed, 2018-03-21 at 15:56 +0100, Pavel Hrdina wrote:
> > > +    # Install packages needed for the Jenkins agent
> > > +    - include: tasks/packages.yml
> > > +      vars:
> > > +        project: jenkins
> > > +      when:
> > > +        - flavor == "jenkins"
> > > +
> > >      # Configure the Jenkins agent
> > >      - include: tasks/jenkins.yml
> > >        when:
> > 
> > Would it make sense to move the installation of packages needed
> > for Jenkins agent into the jenkins task to create a single unit
> > out of it?
> 
> Maybe. However, I really like the current flat structure, where
> there is no task that includes another task, and site.yml is the
> one including everything as needed. I think it makes it easier to
> understand what's going on, so I'd prefer keeping it this way.

OK, I was just wondering.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list