Search code examples
gitpuppetpuppet-enterprise

Puppet: Unable to find role from puppet console


Puppetfile of Control repo

forge "http://forge.puppetlabs.com"

# Modules from the Puppet Forge
# Versions should be updated to be the latest at the time you start
mod "puppetlabs/inifile",    '1.5.0'
mod "puppetlabs/stdlib",     '4.11.0'
mod "puppetlabs/concat",     '2.1.0'
mod "puppetlabs/java",       '1.6.0'
mod "puppet-selinux",        '0.8.0'
mod "garethr-docker",        '5.3.0'

# Modules from Git
# Examples: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#examples
#mod 'apache',
#  :git    => 'https://github.com/puppetlabs/puppetlabs-apache',
#  :commit => '83401079053dca11d61945bd9beef9ecf7576cbf'

#mod 'apache',
#  :git    => 'https://github.com/puppetlabs/puppetlabs-apache',
#  :branch => 'docs_experiment'

mod 'ssh',
  :git => 'https://github.com/rajagennu/puppet-ssh.git',
  :ref => 'master'

mod 'ntp',
  :git => 'https://github.com/rajagennu/puppet-ntp_1.git',
  :ref => 'master'

mod 'role',
  :git => 'https://github.com/rajagennu/puppet-role.git',
  :ref => 'development'

mod 'profile',
  :git => 'https://github.com/rajagennu/puppet-profile.git',
  :ref => 'development'

Profile is here https://github.com/rajagennu/puppet-profile/tree/development

and docker profile code is as below

class profile::docker {
include ::docker
      }

and role is here https://github.com/rajagennu/puppet-role/tree/development

and docker role code is as below

class role::docker {
  include profile::docker 
}

After everything been committed , I ran

puppet-code deploy --all --wait 

In the Puppet console I have created development environment and added Production as parent environment but I am unable to find role::docker or profile::docker in the class list. I have tried refresh as well but its not helping.

Please find below screenshot as reference

enter image description here

And in Puppet server -> Development environment I can see docker.pp in role and profiles, for reference

[root@rgenupula1 puppetserver]# cd /etc/puppetlabs/code/environments/development/
[root@rgenupula1 development]# ls
environment.conf  hieradata  LICENSE  manifests  modules  Puppetfile  README.md  scripts  site
[root@rgenupula1 development]# cd modules/
[root@rgenupula1 modules]# ls
concat  docker  inifile  java  ntp  profile  role  selinux  ssh  stdlib
[root@rgenupula1 modules]# cat profile/manifests/docker.pp
class profile::docker {
    include ::docker
}
[root@rgenupula1 modules]# cat role/manifests/docker.pp
class role::docker {
  include profile::docker
}
[root@rgenupula1 modules]#

I am not sure what is my mistake here ? Requesting your help. And how can I troubleshoot situations like these ?

Thank you.


Solution

  • modify environment.conf in your development environment and update modulepath as below

    modulepath   = /etc/puppetlabs/code/environments/development/modules:$basemodulepath
    

    and then restart puppetserver.

    And my issue got resolved.