saltstack-formulas / libvirt-formula Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
License: Other
Home Page: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
License: Other
journalctl -u libvirtd.service -f
[...]
Jul 23 03:40:23 localhost.local libvirtd[23914]: 2018-07-23 03:40:23.824+0000: 23914: error : main:1195 : Can't load config file: internal error: /etc/libvirt/libvirtd.conf: expected a string for 'tcp_port' parameter: /etc/libvirt/libvirtd.conf
[...]
The solution seems easy enough: I replaced 16514
with '16514'
and 16509
with '16509'
in the pilar file. I'd also be happy to make a pull request to add this fix to the repo.
However, I'm wondering, is there some reason this was int before? Perhaps other versions of libvirt expect int?
System info:
[zauberfisch@localhost ~]$ libvirtd --version
libvirtd (libvirt) 3.9.0
[zauberfisch@localhost ~]$ salt-minion --versions-report
Salt Version:
Salt: 2018.3.2
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.5 (default, Jul 13 2018, 13:06:57)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: centos 7.5.1804 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-862.3.3.el7.x86_64
system: Linux
version: CentOS Linux 7.5.1804 Core
[zauberfisch@localhost ~]$ cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
libvirt-formula master branch
Salt Version:
Salt: 3002.2
Dependency Versions:
cffi: 1.14.4
cherrypy: unknown
dateutil: 2.8.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.11.2
libgit2: 1.1.0
M2Crypto: 0.37.1
Mako: 1.1.3
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: 1.4.6
pycparser: 2.20
pycrypto: 3.9.9
pycryptodome: 3.9.9
pygit2: 1.3.0
Python: 3.8.6 (default, Nov 09 2020, 12:09:06) [GCC]
python-gnupg: 0.4.6
PyYAML: 5.3.1
PyZMQ: 20.0.0
smmap: 3.0.4
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.3
System Versions:
dist: opensuse-tumbleweed 20210118 n/a
locale: utf-8
machine: x86_64
release: 5.10.7-1-default
system: Linux
version: openSUSE Tumbleweed 20210118 n/a
*redacted*:
----------
libvirt:
----------
daemon_opts:
----------
LIBVIRTD_ARGS:
--timeout 120
LIBVIRTD_CONFIG:
/etc/libvirt/libvirtd.conf
LIBVIRTD_NOFILES_LIMIT:
2048
libvirtd:
----------
auth_unix_rw:
none
unix_sock_group:
libvirt
unix_sock_rw_perms:
0770
lookup:
----------
libvirt_service:
libvirtd-admin.socket
python3_pkg:
python38-libvirt-python
opensuse tumbleweed just renamed all of its python3 packages:
correct python3 package: python38-libvirt-python
add a parameter yaml file for tumbleweed with the correct default package:
os_family: Suse
oscodename: openSUSE Tumbleweed
osfinger: openSUSE Tumbleweed-20210118
osfullname: openSUSE Tumbleweed
added the correct package lookup in pillar
lookup:
----------
python3_pkg:
python38-libvirt-python
v3.7.5
Master:
Salt Version:
Salt: 3000.2
Dependency Versions:
cffi: 1.14.0
cherrypy: unknown
dateutil: 2.6.1
docker-py: 1.10.6
gitdb: 4.0.4
gitpython: 3.1.1
Jinja2: 2.11.2
libgit2: 1.0.0
M2Crypto: 0.35.2
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.6.2
mysql-python: 1.4.6
pycparser: 2.20
pycrypto: 3.9.7
pycryptodome: Not Installed
pygit2: 1.2.0
Python: 3.7.5 (default, Nov 7 2019, 10:50:52)
python-gnupg: 0.4.6
PyYAML: 3.12
PyZMQ: 19.0.0
smmap: 3.0.2
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.2
System Versions:
dist: Ubuntu 18.04 bionic
locale: UTF-8
machine: x86_64
release: 4.15.0-99-generic
system: Linux
version: Ubuntu 18.04 bionic
Minion:
Salt Version:
Salt: 3000.2
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.11.2
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.6.2
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.7.7 (default, May 4 2020, 05:28:05)
python-gnupg: Not Installed
PyYAML: 5.3.1
PyZMQ: 19.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.2
System Versions:
dist: debian bullseye/sid
locale: UTF-8
machine: x86_64
release: 4.15.0-96-generic
system: Linux
version: debian bullseye/sid
/etc/salt/master:
file_roots:
base:
- /srv/salt
- /srv/formulas/libvirt-formula
/srv/salt/top.sls:
base:
'*':
- libvirt
ID: libvirt-server-tls-certs-virt-keys
Function: virt.keys
Name: libvirt_keys
Result: False
Comment: State 'virt.keys' was not found in SLS 'libvirt.server.tls.certs'
Reason: 'virt' __virtual__ returned False
Changes:
This error does not show up
master / e7f31e1
3004.1 from Kitchen setup
Those from kitchen
packages qemu-kvm
and virt-top
are not installable.
./bin/kitchen converge default-debian-11-3004-1-py3
[...]
ID: libvirt-qemu-install-pkg-installed
Function: pkg.installed
Name: qemu-kvm
Result: False
Comment: The following packages failed to install/update: qemu-kvm
Started: 16:00:27.469081
Duration: 1887.718 ms
Changes:
[...]
ID: libvirt-extra-install-pkg-installed
Function: pkg.installed
Result: False
Comment: Problem encountered installing package(s). Additional info follows:
errors:
- Running scope as unit: run-ra546c40648ec45c3b3ae236b7924c792.scope
E: Unable to locate package virt-top
Started: 16:00:29.357027
Duration: 617.833 ms
Changes:
Summary for local
------------
Succeeded: 7
Failed: 2
No errors
none for now
master / e7f31e1
3006 from Kitchen setup
Those from kitchen
qemu
package is not installable/etc/conf.d
does not exist whenbin/kitchen test default-arch-base-latest-master-py3
[...]
----------
ID: libvirt-server-config-files-daemonconfig-file-managed
Function: file.managed
Name: /etc/conf.d/libvirtd
Result: False
Comment: Parent directory not present
Started: 20:44:01.639995
Duration: 6.314 ms
Changes:
----------
ID: libvirt-server-service-running-service-running
Function: service.running
Name: libvirtd
Result: False
Comment: One or more requisite failed: libvirt.server.config.files.libvirt-server-config-files-daemonconfig-file-managed
Started: 20:44:01.646576
Duration: 0.002 ms
Changes:
----------
ID: libvirt-python-install-pkg-installed
Function: pkg.installed
Name: libvirt-python3
Result: False
Comment: Problem encountered installing package(s). Additional info follows:
errors:
- Running scope as unit: run-r5bc3788d02884e3682a33b96176372b4.scope
error: target not found: libvirt-python3
Started: 20:44:01.656874
Duration: 17646.426 ms
Changes:
----------
ID: libvirt-server-tls-certs-virt-keys
Function: virt.keys
Name: libvirt_keys
Result: False
Comment: One or more requisite failed: libvirt.python.install.libvirt-python-install-pkg-installed
Started: 20:44:20.206369
Duration: 0.005 ms
Changes:
----------
ID: libvirt-qemu-install-pkg-installed
Function: pkg.installed
Name: qemu
Result: False
Comment: The following packages failed to install/update: qemu
Started: 20:44:20.206440
Duration: 76274.811 ms
Changes:
[...]
No errors
PR incoming ๐
libvirt/map.jinja has it that
'libvirt_service': 'libvirtd' if grains.get('osmajorrelease', 0)|float >= 8 else 'libvirt-bin',
However, checking the grains:
sudo salt [minionid] grains.items | less
โฆ
os:
Ubuntu
os_family:
Debian
osarch:
amd64
oscodename:
yakkety
osfinger:
Ubuntu-16.10
osfullname:
Ubuntu
osrelease:
16.10
osrelease_info:
- 16
- 10
so the unit name used is libvirt-bin, where the correct name is libvirtd
This produces the error
ID: libvirt.service Function: service.running Name: libvirt-bin Result: False Comment: Failed to get information on unit 'libvirt-bin'
Verifying on the minion:
systemctl status libvirtd.service
โ libvirtd.service - Virtualization daemon
get-around
edit map.jinja and make the line 11:
'libvirt_service': 'libvirtd',
@baby-gnu A quick note for you, while I've been testing the new pre-salted images across all of our formulas:
You can use the links at the top of that page (i.e. the commit) to get details about the new fedora-31
image, should you desire to get to the bottom of this. Let me know how you'd like to proceed.
ID: libvirt.keys
Function: libvirt.keys
Name: libvirt_keys
Result: False
Comment: State 'libvirt.keys' was not found in SLS 'libvirt.keys'
Reason: 'libvirt.keys' is not available.
because in keys.sls line 6 a comparison is made as text, where it needs to be numeric:
{% if salt['grains.get']('saltversion', '') < '2016.3.0' %}
Here is my grains data:
sudo salt c89 grains.items | grep --after-context=1 saltversion:
saltversion:
2016.11.0
See also:
saltstack/salt#5999
this is the fix:
Travix-International@149dd9d
----------
ID: libvirt.keys
Function: virt.keys
Name: libvirt_keys
Result: False
Comment: State 'virt.keys' was not found in SLS 'libvirt.keys'
Reason: 'virt' __virtual__ returned False
Changes:
My minion is running Ubuntu 17.10, and this is failing because the python-libvirt
package has not been installed.
My top file simply includes libvirt
, and extra_pkgs
returns correctly.
----------
ID: extra_pkgs
Function: pkg.installed
Result: True
Comment: All specified packages are already installed
Started: 22:51:39.869064
Duration: 5.806 ms
Changes:
Hello.
I started to make this formula compliant with what is done in template-formula
.
Here is the list of planned tasks:
libvirt-python
I need only libvirt lib and virsh binary, with current formula i can't do that by providing
qemu_pkg: ~
extra_pkgs: ~
It would be nice if the libvirt-formula also manages libvirtd.conf
something like: https://github.com/webscale-formulas/libvirt-formula
The error message is:
Rendering SLS 'base:libvirt' failed: Jinja variable 'dict object' has no attribute 'osmajorrelease
This is on Ubuntu 14.04 with salt version 2015.8.1. The offending line is here. I think the check it's performing was just added recently.
Looking at the grains I do have, my first impulse is to change it to check grains.osrelease_info[0] instead. But I'm not that familiar with what grains exist where. If my configuration is missing osmajorrelease, it's possible others are missing osrelease_info. I'm not sure if there's an os version grain that's guaranteed to always exist.
(also, the service name detection that line is intended to perform gets the wrong result on my ubuntu, but that's easily fixable by populating pillar:libvirt:lookup:service, wheras the failed key lookup makes the state not work at all.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.