Re: [jenkins-ci PATCH 2/4] guests: Use package_manager everywhere

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 07, 2019 at 03:17:40PM +0200, Andrea Bolognani wrote:
> Instead of hardcoding the name of the package manager in
> commands, use the value obtained from the inventory.
> 
> In some cases this is necessary, eg. when RPM-based
> distributions are involved; for most other cases we could
> get away with keepking the hardcoded names, but it's better
> to be completely consistent to hopefully avoid usage of the
> wrong package manager slipping with further changes.
> 
> Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
> ---
>  guests/lcitool                              | 40 +++++++++++----------
>  guests/playbooks/update/tasks/base.yml      | 12 +++----
>  guests/playbooks/update/tasks/bootstrap.yml | 16 ++-------
>  3 files changed, 29 insertions(+), 39 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>


>  - name: Bootstrap Ansible
> -  raw: 'yum install -y {{ python }}'
> -  when:
> -    - package_format == 'rpm'
> -
> -- name: Bootstrap Ansible
> -  raw: 'apt-get install -y {{ python }}'
> -  when:
> -    - package_format == 'deb'
> -
> -- name: Bootstrap Ansible
> -  raw: 'pkg install -y {{ python }}'
> -  when:
> -    - package_format == 'pkg'
> +  raw: '{{ package_manager }} install -y {{ python }}'

Heh, rather amuzing that all three package managers happen to support
the same "install -y" command syntax.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux