Skip to content

Running on ubuntu there is a logic bug,  #9

Description

@sqorbrody

centos7 is not declared in the global scope and there for when the below code executes

 Recipe: opsmatic::agent
     * apt_package[opsmatic-agent] action install
       * No candidate version available for opsmatic-agent
       ================================================================================
       Error executing action `install` on resource 'apt_package[opsmatic-agent]'
       ================================================================================

       Chef::Exceptions::Package
       -------------------------
       No candidate version available for opsmatic-agent

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/opsmatic/recipes/agent.rb

        32: package opsmatic_package do
        33:   action node['opsmatic']['agent_action']
        34:   version node['opsmatic']['agent_version']
        35: end
    36: 

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/opsmatic/recipes/agent.rb:32:in `from_file'

       apt_package("opsmatic-agent") do
         action [:install]
         retries 0
         retry_delay 2
         default_guard_interpreter :default
         package_name "opsmatic-agent"
         timeout 900
         declared_type :package
         cookbook_name "opsmatic"
         recipe_name "agent"
       end

   Recipe: nginx::default
     * service[nginx] action reload
       - reload service service[nginx]
   Recipe: opsmatic::agent
     * service[opsmatic-agent] action restart

       ================================================================================
       Error executing action `restart` on resource 'service[opsmatic-agent]'
       ================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '1'
       ---- Begin output of /sbin/start opsmatic-agent ----
       STDOUT: 
       STDERR: start: Unknown job: opsmatic-agent
       ---- End output of /sbin/start opsmatic-agent ----
       Ran /sbin/start opsmatic-agent returned 1

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/opsmatic/recipes/agent.rb

        57: service 'opsmatic-agent' do
    58:   if centos7
        59:     provider Chef::Provider::Service::Systemd
        60:   else
        61:     provider Chef::Provider::Service::Upstart
        62:   end
        63:   action [:enable, :start]

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/opsmatic/recipes/agent.rb:57:in `from_file'

       service("opsmatic-agent") do
         provider Chef::Provider::Service::Upstart
         action [:enable, :start]
         supports {:restart=>false, :reload=>false, :status=>false}
         retries 0
         retry_delay 2
         default_guard_interpreter :default
         service_name "opsmatic-agent"
         pattern "opsmatic-agent"
         declared_type :service
         cookbook_name "opsmatic"
         recipe_name "agent"
       end


   Running handlers:
   [2015-03-23T22:56:21+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2015-03-23T22:56:21+00:00] ERROR: Exception handlers complete
   [2015-03-23T22:56:21+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   Chef Client failed. 20 resources updated in 41.053728096 seconds
   [2015-03-23T22:56:21+00:00] ERROR: Chef::Exceptions::MultipleFailures
   [2015-03-23T22:56:22+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions