Sha256: b3d42f950c47bbee4db03cf33cf774a30072ba692fcc4f210048f39b5e85f1ee
Contents?: true
Size: 832 Bytes
Versions: 16
Compression:
Stored size: 832 Bytes
Contents
require 'itamae' module Itamae module Resource class Package < Base define_attribute :action, default: :install define_attribute :name, type: String, default_name: true define_attribute :version, type: String def set_current_attributes installed = run_specinfra(:check_package_is_installed, name) @current_attributes[:installed?] = installed if installed @current_attributes[:version] = run_specinfra(:get_package_version, name).stdout.strip end if action == :install @attributes[:installed?] = true end end def install_action unless run_specinfra(:check_package_is_installed, name, version) run_specinfra(:install_package, name, version) updated! end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems