Search code examples
chef-infrayumaws-opsworks

Opsworks chef 11.10 and yum 5.0 conflict


Today after deploying our stack, we got this error. Is there a way to make opsworks use a lower version of yum?

Right now, we're using chef 11.10 and it's taking yum 5.0.0 by default, I tried to constrain metadata.rb to use yum 4.1.0, but I get this error too Could not satisfy version constraints for: yum

Below the stack trace ================================================================================ Recipe Compile Error in /var/lib/aws/opsworks/cache.stage2/cookbooks/yum/resources/globalconfig.rb ================================================================================

  NoMethodError
  -------------
  undefined method `property' for #<Class:0x007eff00deaf20>


  Cookbook Trace:
  ---------------
  /var/lib/aws/opsworks/cache.stage2/cookbooks/yum/resources/globalconfig.rb:22:in 
  `class_from_file'


  Relevant File Content:
  ----------------------
  /var/lib/aws/opsworks/cache.stage2/cookbooks/yum/resources/globalconfig.rb:

  15:  # distributed under the License is distributed on an "AS IS" BASIS,
  16:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17:  # See the License for the specific language governing permissions and
  18:  # limitations under the License.
  19:  #
  20:  
  21:  # http://linux.die.net/man/5/yum.conf
  22>> property :alwaysprompt, [TrueClass, FalseClass]
  23:  property :assumeyes, [TrueClass, FalseClass]
  24:  property :bandwidth, String, regex: /^\d+/
  25:  property :bugtracker_url, String, regex: /.*/
  26:  property :clean_requirements_on_remove, [TrueClass, FalseClass]
  27:  property :cachedir, String, regex: /.*/, default: 
  '/var/cache/yum/$basearch/$releasever'
  28:  property :color, String, equal_to: %w(always never)
  29:  property :color_list_available_downgrade, String, regex: /.*/
  30:  property :color_list_available_install, String, regex: /.*/
  31:  property :color_list_available_reinstall, String, regex: /.*/



[2017-02-14T00:12:24+00:00] ERROR: Running exception handlers
[2017-02-14T00:12:24+00:00] ERROR: Exception handlers complete
[2017-02-14T00:12:24+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out
[2017-02-14T00:12:24+00:00] ERROR: undefined method `property' for #<Class:0x007eff00deaf20>
[2017-02-14T00:12:24+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Solution

  • Support for chef 11 was removed with 4.0. Latest version which should work on chef 11 is 3.13.0.