Skip to content

Instantly share code, notes, and snippets.

@filler
Created October 2, 2012 15:30
Show Gist options
  • Select an option

  • Save filler/3820168 to your computer and use it in GitHub Desktop.

Select an option

Save filler/3820168 to your computer and use it in GitHub Desktop.
cfengine package comparisons fail, pass
################################################################################
#
# Package management bodies
#
################################################################################
## You *must* specify "package_version" in any promises where this body is used!
## Otherwise, the version gets set to "*", which causes Cfengine to refer to
## the package in terms of package-* (see package_name_convention) - which
## could install or delete all kinds of packages unintentionally.
body package_method yum_rpm_exact
{
package_changes => "individual";
package_list_command => "/bin/rpm -qa --qf '%{name} %{version}-%{release} %{arch}\n'";
package_list_name_regex => "^(\S+?)\s\S+?\s\S+$";
package_list_version_regex => "^\S+?\s(\S+?)\s\S+$";
package_list_arch_regex => "^\S+?\s\S+?\s(\S+)$";
# Force list of installed packages to update on every agent run
package_list_update_ifelapsed => "0";
package_installed_regex => ".*";
package_name_convention => "$(name)-$(version).$(arch)";
package_add_command => "/usr/bin/yum -y install";
package_update_command => "/usr/bin/yum -y update";
package_delete_command => "/usr/bin/yum -y erase";
package_verify_command => "/bin/rpm -V";
}
vars:
# Packages to install
redhat_s_6_1::
"php_pkg_x86_64_ver[php]" string => "5.3.3-3.el6";
"php_pkg_x86_64_ver[php-cli]" string => "5.3.3-3.el6";
"php_pkg_x86_64_ver[php-common]" string => "5.3.3-3.el6";
"php_pkg_x86_64_ver[php-gd]" string => "5.3.3-3.el6";
"php_pkg_x86_64_ver[php-ldap]" string => "5.3.3-3.el6";
"php_pkg_x86_64_ver[php-mbstring]" string => "5.3.3-3.el6";
"php_pkg_x86_64_ver[php-mysql]" string => "5.3.3-3.el6";
"php_pkg_x86_64_ver[php-pdo]" string => "5.3.3-3.el6";
"php_pkg_x86_64_ver[php-pecl-apc]" string => "3.1.9-2.el6";
"php_pkg_x86_64_ver[php-pecl-memcache]" string => "3.0.5-3.el6";
"php_pkg_x86_64_ver[php-xml]" string => "5.3.3-3.el6";
packages:
"$(php_pkgs_x86_64)"
package_policy => "add",
package_method => yum_rpm_exact,
package_version => "$(php_pkg_x86_64_ver[$(php_pkgs_x86_64)])",
package_architectures => { "x86_64" },
action => actionsettings_fix_inform(inform);
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: php-pecl-apc
cf3 .........................................................
cf3
cf3 ?? Already have a package list for this manager
cf3 -> Package version specified explicitly in promise body
cf3 ... trying listed arch x86_64
cf3 -> Looking for (php-pecl-apc,*,*)
cf3 -> Matched name php-pecl-apc
cf3 -> Matched version *
cf3 -> Looking for (php-pecl-apc,3.1.9-2.el6,x86_64)
cf3 -> Matched name php-pecl-apc
cf3 -> Matched arch x86_64
cf3 -> Check for compatible versioning model in (3.1.9-2.el6,3.1.3p1-1.2.el6.1)
cf3 -> Verified that versioning models are compatible
cf3 -> Verified version constraint promise kept
cf3 -> 1 package(s) matching the name "php-pecl-apc" already installed
cf3 -> 1 package(s) match the promise body's criteria fully
cf3 -> Package promises to refer to itself as "php-pecl-apc-3.1.9-2.el6.x86_64" to the manager
cf3 -> Package version seems to match criteria
cf3 -> Package "php-pecl-apc" already installed, so we never add it again
cf3
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: php-mbstring
cf3 .........................................................
cf3
cf3 ?? Already have a package list for this manager
cf3 -> Package version specified explicitly in promise body
cf3 ... trying listed arch x86_64
cf3 -> Looking for (php-mbstring,*,*)
cf3 -> Matched name php-mbstring
cf3 -> Matched version *
cf3 -> Looking for (php-mbstring,5.3.3-3.el6,x86_64)
cf3 -> Matched name php-mbstring
cf3 -> Matched arch x86_64
cf3 -> Check for compatible versioning model in (5.3.3-3.el6,5.3.3-3.el6)
cf3 -> Verified that versioning models are compatible
cf3 -> Verified version constraint promise kept
cf3 -> 1 package(s) matching the name "php-mbstring" already installed
cf3 -> 1 package(s) match the promise body's criteria fully
cf3 -> Package promises to refer to itself as "php-mbstring-5.3.3-3.el6.x86_64" to the manager
cf3 -> Package version seems to match criteria
cf3 -> Package "php-mbstring" already installed, so we never add it again
cf3
[root@vm-d7devapp-01 ~]# yum list all php-pecl-apc
Loaded plugins: downloadonly, product-id, subscription-manager
Updating Red Hat repositories.
Installed Packages
php-pecl-apc.x86_64 3.1.3p1-1.2.el6.1 @redhat
Available Packages
php-pecl-apc.i386 3.1.9-2.el5 yale
php-pecl-apc.x86_64 3.1.9-2.el6 yale
@filler
Copy link
Copy Markdown
Author

filler commented Oct 2, 2012

php-pecl-apc-3.1.3p1-1.2.el6.1 is somehow installed but cannot upgrade to 3.1.9-2.el6 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment