Skip to content

Instantly share code, notes, and snippets.

@doesitblend
Last active September 5, 2017 20:56
Show Gist options
  • Save doesitblend/40eb0d24201b45dfcd810144633343c7 to your computer and use it in GitHub Desktop.
Save doesitblend/40eb0d24201b45dfcd810144633343c7 to your computer and use it in GitHub Desktop.
pkg.installed shows success and failure?
1. Verify that glob matching should work when specifying package version
- Need to verify that the packages are actually installed with globbing
- Need to verify that the packages are actually installed without globbing
2. Update the ticket
3.
TESTING WITH GLOBBING:
=====================
[root@saltmaster salt]# cat /srv/salt/default.sls
httpd_installed:
pkg.installed:
- pkgs:
- httpd: '2.4.6*'
- httpd-tools: '2.4.
[root@saltmaster salt]# salt '*' state.highstate
testminion:
----------
ID: httpd_installed
Function: pkg.installed
Result: True
Comment: 2 targeted packages were installed/updated.
Started: 19:15:34.312173
Duration: 14932.508 ms
Changes:
----------
httpd:
----------
new:
2.4.6-45.el7.centos.4
old:
httpd-tools:
----------
new:
2.4.6-45.el7.centos.4
old:
Summary for testminion
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 14.933 s
[root@saltmaster salt]# yum list installed httpd\*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.keystealth.org
* epel: mirror.chpc.utah.edu
* extras: denver.gaminghost.co
* updates: mirrors.advancedhosters.com
Installed Packages
httpd.x86_64 2.4.6-45.el7.centos.4 @updates
httpd-tools.x86_64 2.4.6-45.el7.centos.4 @updates
TESTING WITHOUT GLOBBING:
========================
[root@saltmaster salt]# cat default.sls
httpd_installed:
pkg.installed:
- pkgs:
- httpd: '2.4.6'
- httpd-tools: '2.4.6'
[root@saltmaster salt]# salt '*' state.highstate
testminion:
----------
ID: httpd_installed
Function: pkg.installed
Result: False
Comment: The following packages failed to install/update: httpd=2.4.6, httpd-tools=2.4.6
Started: 19:27:00.880381
Duration: 24803.488 ms
Changes:
----------
httpd:
----------
new:
2.4.6-45.el7.centos.4
old:
httpd-tools:
----------
new:
2.4.6-45.el7.centos.4
old:
Summary for testminion
------------
Succeeded: 0 (changed=1)
Failed: 1
------------
Total states run: 1
Total run time: 24.803 s
ERROR: Minions returned with non-zero exit code
[root@saltmaster salt]# yum list install httpd\*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.keystealth.org
* epel: mirror.chpc.utah.edu
* extras: denver.gaminghost.co
* updates: mirrors.advancedhosters.com
Installed Packages
httpd.x86_64 2.4.6-45.el7.centos.4 @updates
httpd-tools.x86_64 2.4.6-45.el7.centos.4 @updates
Available Packages
httpd-devel.x86_64 2.4.6-45.el7.centos.4 updates
httpd-itk.x86_64 2.4.7.04-2.el7 epel
httpd-manual.noarch 2.4.6-45.el7.centos.4 updates
[root@saltmaster salt]# salt --versions-report
Salt Version:
Salt: 2017.7.1
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.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.5 (default, Nov 6 2016, 00:28:07)
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.3.1611 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-514.26.2.el7.x86_64
system: Linux
version: CentOS Linux 7.3.1611 Core
VERIFY ISSUE IS RESOLVED IN 2017.7.2
====================================
[root@de36ed134950 salt]# salt-call --local state.apply tests
[ERROR ] Template was specified incorrectly: False
local:
Data failed to compile:
----------
No matching sls found for 'tests' in env 'base'
[root@de36ed134950 salt]# salt-call --local state.apply test
[WARNING ] org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
local:
----------
ID: httpd_installed
Function: pkg.installed
Result: True
Comment: 2 targeted packages were installed/updated.
Started: 20:25:28.187941
Duration: 52276.392 ms
Changes:
----------
apr:
----------
new:
1.4.8-3.el7
old:
apr-util:
----------
new:
1.5.2-6.el7
old:
centos-logos:
----------
new:
70.0.6-3.el7.centos
old:
httpd:
----------
new:
2.4.6-45.el7.centos.4
old:
httpd-tools:
----------
new:
2.4.6-45.el7.centos.4
old:
mailcap:
----------
new:
2.1.41-2.el7
old:
Summary for local
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 52.276 s
[root@de36ed134950 salt]# salt --version
salt 2017.7.1-813-g85dba1e (Nitrogen)
[root@5bc2d2272f38 /]# salt --versions-report
Salt Version:
Salt: 2017.7.1-813-g85dba1e
Dependency Versions:
cffi: Not Installed
cherrypy: unknown
dateutil: 2.6.1
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.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.5 (default, Nov 6 2016, 00:28:07)
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.3.1611 Core
locale: ANSI_X3.4-1968
machine: x86_64
release: 4.9.41-moby
system: Linux
version: CentOS Linux 7.3.1611 Core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment