Sha256: 0c693a615c3bad0be0281eff2977cf6e8de2845546bd8c5239fe829ef72b0f19
Contents?: true
Size: 955 Bytes
Versions: 4
Compression:
Stored size: 955 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 define_attribute :options, type: String def pre_action case @current_action when :install @attributes[:installed?] = true end end 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 end def install_action(action_options) unless run_specinfra(:check_package_is_installed, name, version) run_specinfra(:install_package, name, version, options) updated! end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems