Import modules in new environment


I have a question about environmental management.

I am following the official puppet procedure to create an environment within :

mkdir -p preproduction/{manifest,modules,data}

I create a preproduction directory. I import it from foreman.

When I install a module, for example apt, I specify :

/opt/puppetlabs/puppet/bin/puppet module install --environment preproduction puppetlabs-apt --version 7.7.1

The installation is OK but impossible to import the module into the puppet classes. I can see module directories in modules dir path but not in foreman…

What is the simple procedure for creating a new environment with the installation and import modules?

thank you

Expected outcome:

Foreman and Proxy versions:

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

If i don’t specify –environment preproduction

The installed default path is : /etc/puppetlabs/code/environments/production/modules

Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
Notice: Downloading from ...
Notice: Installing -- do not interrupt ...
└─┬ puppetlabs-apt (v7.7.1)
  ├── puppetlabs-stdlib (v6.6.0)
  └── puppetlabs-translate (v2.2.0)

I can import puppet classes but only in production environment but not in preproduction env

It is incomprehensible

Here is my architecture:

Personalized organization
Personalized locations
Customized environment

I don’t have Puppet Classes tabs in my hosts

In Configure > Puppet > Classes > I can see my apt module but if I filter on the preproduction environment I have nothing. While the module is well installed in puppet

It’s a real hell the management organization, location, environment in Foreman…

I forced in : /etc/puppetlabs/puppet/puppet.conf

basemodulepath = /etc/puppetlabs/code/environments/preproduction/modules:/usr/share/puppet/modules`

environment = preproduction

Then restart puppetserver and it works…