Search code examples
gitgithubpuppetgit-branchpuppet-enterprise

Unable to get git branch from puppet agent


I've the following command to execute puppet agent in a server. Its puppet master contains a puppetfile which contains several modules stored in different git repositories.

Well, I need to execute puppet agent pointing to the correct git branch to get the modules.

This environment is PROD an it is properly configured as there are a lot of people working on it but I'm new using it and I need help!

I've executed the following command but it doesn't work:

sudo puppet agent -t --environment my_branch

And I get:

Warning: Unable to fetch my node definition, but the agent run will continue: Warning: Find my_branch/node/hostname_agent_server?transaction_uuid=fb7c33d0-dab2-4c36-be0a-94870f6fbfcc&fail_on_404=true resulted in 404 with the message: Not Found: Could not find environment 'develop'

My branch is "develop/xxxx/xxxx" for this reason the code above mentions "Could not find environment 'develop'

Could you please help me with the correct one?


Solution

  • It looks like it is getting confused because of the slashes in your branch name. Here is an excerpt from the Puppet docs:

    Allowed Environment Names

    Environment names can contain lowercase letters, numbers, and underscores. That is, they must match the following regular expression:

    \A[a-z0-9_]+\Z