Ask Your Question
0

application orchestration: consuming services

asked 2017-11-29 06:24:41 -0600

rssh22 gravatar image

Hi,

I've declared a very simple application and I'm trying to consume/export services in order to share configuration parameters. Unfortunately I'm geting an error that says a parameter hadn't been set.

/opt/puppetlabs/client-tools/bin/puppet-app show --environment production
Failed to retrieve application instances: puppetlabs.orchestrator/unknown-error: java.io.IOException: HTTP GET to https://vm-lab-linux-1.msc.es:8140/puppet/v3/environment/production:500: Server Error: Arqjeer02::Pe::Mdw::Cmpt2[cmptapp1]: expects a value for parameter 'port' in environment production

Can anybody help me with this error?

The application is the next:

site {
  create_component_app('arqjeer02::pe::cmptapp', 'cmptapp1', {
    'components' => {
      'Arqjeer02::Pe::Mdw::Cmpt1' => ['wl02-pub-t01-p0.msc.com'],
      'Arqjeer02::Pe::Mdw::Cmpt2' => ['wl02-pub-t01-p0.msc.com'],
    }
  })

arqjeer02/manifests/pe/cmptapp.pp:

application arqjeer02::pe::cmptapp (

) {
  arqjeer02::pe::mdw::cmpt1 {$name:
    port => 22,
    export => Arqjeer02::Pe::Mdw::Cmpt1[$name],
  }

  arqjeer02::pe::mdw::cmpt2 {$name:
    export => Arqjeer02::Pe::Mdw::Cmpt2[$name],
    consume => Arqjeer02::Pe::Mdw::Cmpt1[$name],
  }

}

arqjeer02/manifests/pe/mdw/cmpt1.pp:

 define arqjeer02::pe::mdw::cmpt1 (  
    $port,   ) {   notify {"${name} -
    port: ${port}":} }

    Arqjeer02::Pe::Mdw::Cmpt1 produces
    Cmpt1 {   cmpt1_port => "81", }

arqjeer02/manifests/pe/mdw/cmpt2.pp:

define arqjeer02::pe::mdw::cmpt2 (
  $port,
  ) {
  notify {"${name} - port: ${port}":}
}

Arqjeer02::Pe::Mdw::Cmpt2 produces Dependency{}
Arqjeer02::Pe::Mdw::Cmpt2 consumes Cmpt1 {
  port => $cmpt1_port,
}

arqjeer02/lib/puppet/type/cmpt1.rb:

Puppet::Type.newtype :cmpt1, :is_capability => true do

  newparam :cmpt1_port
end
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-30 04:25:15 -0600

rssh22 gravatar image

Well, there were several errors in the original code. But the main error was the name of the service.

application arqjeer02::pe::cmptapp (

) {
  arqjeer02::pe::mdw::cmpt1 {$name:
    port => 22,
    export => Cmpt1[$name],
  }

  arqjeer02::pe::mdw::cmpt2 {$name:
    export => Dependency[$name],
    consume => Cmpt1[$name],
  }

}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-11-29 06:24:41 -0600

Seen: 13 times

Last updated: Nov 30