Sha256: 4fdf72e8277804709943e5e1f2c00eb2d7d1cf9164083a2f5b794656b796c514

Contents?: true

Size: 1.31 KB

Versions: 17

Compression:

Stored size: 1.31 KB

Contents

module Lono::Configset::Strategy::Helpers::Dsl
  module Package
    # In recent versions of the AmazonLinux2 cfnbootstrap, , the package command doesnt work with updated versions of rubygems.
    # Get this error
    #
    #    invalid option: --no-ri
    #
    # More details: https://gist.github.com/tongueroo/569878afdc7eb904490b9ee8b03f304f
    #
    # Found the cfnbootstrap version by looking at the source on 2020-03-21 in
    #
    #     $ cat /usr/lib/python2.7/site-packages/cfnbootstrap/public_constants.py
    #     _release = '31'
    #     _version = '1.4-' + _release
    #
    # There is no way to get the version from the /opt/aws/bin/cfn-init command.
    #
    # We work around this be using the command instruction and use the gem install and list commands.
    #
    #    $ gem list tilt -e -i -v 1.4.0
    #    false # also $? is 1
    #    $ gem list tilt -e -i -v 1.4.1
    #    true # also $? is 0
    #    $
    #
    def gem_package(name, version=nil)
      unless_clause = "gem list #{name} -e -i "
      unless_clause += "-v #{version}" if version
      command("#{name}-gem-install",
        command: "gem install #{name} #{version}",
        unless: unless_clause
      )
    end

    def yum_package(name, version=nil)
      versions = [version].compact
      package("yum", name => versions)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
lono-8.0.0.pre.rc2 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-8.0.0.pre.rc1 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.5.2 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.5.1 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.5.0 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.11 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.10 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.9 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.8 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.7 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.6 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.5 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.4 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.3 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.2 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.1 lib/lono/configset/strategy/helpers/dsl/package.rb
lono-7.4.0 lib/lono/configset/strategy/helpers/dsl/package.rb