1

I have a simple Puppet environment, just started with one master and one agent.

I am getting following error when I do puppet module list from my agent. I run puppet agent -t it is not even going to my site.pp and test.pp.

I am not sure if I am missing anything in the Puppet configurations.

 puppet module list
/usr/lib/ruby/site_ruby/1.8/puppet/environments.rb:38:in `get!': Could not find a directory environment named 'test' anywhere in the path: /etc/puppet/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound)
        from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:365:in `run'
        from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:146:in `run'
        from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:92:in `execute'
        from /usr/bin/puppet:8

Here is my Puppet master puppet.conf

    [main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl
    dns_alt_names = cssdb-poc-01.cisco.com cssdb-poc-01

[master]
    server = cssdb-poc-01.cisco.com
    certname = cssdb-poc-01.cisco.com
    dns_alt_names = cssdb-poc-01.cisco.com cssdb-poc-01
    environmentpath = /etc/puppet/environments
    environment = test

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig
~

Here is the directory structure on puppet master.

    [root@cssdb-poc-01 test]# tree /etc/puppet/environments/
/etc/puppet/environments/
├── example_env
│   ├── manifests
│   ├── modules
│   └── README.environment
├── production
└── test
    ├── environment.conf
    ├── manifests
    │   └── site.pp
    └── modules
        └── cassandra
            ├── manifests
            └── test.pp

Here is the my puppet agent puppet.conf

cat /etc/puppet/puppet.conf
[main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

[main]
    server=cssdb-poc-01.cisco.com
    environmentpath = /etc/puppet/environments
    environment = test

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig
Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225
user3330284
  • 373
  • 2
  • 6
  • 14
  • Modules are usually only installed on the master. Listing them is not suposed to work on the agent side. – Felix Frank Aug 12 '15 at 20:33
  • I am not able to see even on the master puppet module list /etc/puppet/modules (no modules installed) /usr/share/puppet/modules (no modules installed) – user3330284 Aug 13 '15 at 02:58

2 Answers2

1

The issue was with my environment.conf file.

[root@cssdb-poc-01 templates]# cat /tmp/environment.conf
modulepath = /etc/puppet/environments/test/modules:$basemodulepath
manifest = manifests

I removed it from environment directory and it started working, not puppet modules list but puppet agent -t

@Frank you are right puppet modules list will not work on agent nodes.

Thanks for your help.

user3330284
  • 373
  • 2
  • 6
  • 14
0

Custom modules will not show up in puppet modules list output. It lists modules with metadata, typically installed from the Forge using puppet module install.

On the agent, it is normal to have no local environments to search for modules (or install them).

Felix Frank
  • 8,125
  • 1
  • 23
  • 30
  • Try debugging things with a standalone master. Stop the master service and run `puppet master --no-daemonize --verbose --debug`, see what is going on. – Felix Frank Aug 14 '15 at 13:01