Testing the changes

After your test node is properly attached to the environment group, you can log in to the node and trigger an agent run with puppet agent -t. Alternatively, you can run the Puppet agent through the PE console and read the log there. If you don't see any changes, there are a few possible reasons, as follows:

  • The agent has already run, between when you classified the node in the console and ran the Puppet agent.
  • A step was missed and the code was not properly deployed.
  • Your code does not trigger any new changes on the system, and you should modify the system to see if Puppet corrects the change.

Ensure that you check the resources targeted by your change to see whether the agent has already deployed the new changes. You might also want to verify that the code deployment was done properly, and that you pushed your code back to the Git repository. If your code does not trigger any changes on the system, or if it triggers undesired changes, you can perform the following shorter workflow until the code is resolved properly:

  1. Edit the code in the target repository: the control repository or the module repository (with the IDE of choice)
  2. Make a snapshot of the code (git add and commit)
  3. Push the code back to the remote repository (git push)
  4. Redeploy the environment (puppet-access login and puppet-code deploy)
  5. Trigger an agent run on the test machine (puppet agent or PE console)
  6. Check for changes on the target system
  7. Repeat until the desired state is achieved:
# Start in the repository with the change. This could be a component module
# or the control repository. We're assuming each repository is still on the
# branch from the last step, and no pulls or branch changes are necessary.

# Edit the file with the targeted changes
vim manifests/manifest.pp

# Add the file to the git staging area
git add manifests/manifest.pp

# Commit the file to the repository
git commit -m 'Fixing specific bug'

# Push the repository back to upstream origin
git push origin new_feature

# From the Puppet Master, or a workstation with PE Client Tools

# Log in with RBAC
puppet-access login

# Deploy the environment
puppet-code deploy new_feature -w

# On the test node

# Run the agent, observe the results
puppet agent -t

# Repeat as necessary until issues are solved

Once our code is in the desired state, we will be ready to begin placing it back into a long-lived environment on the Puppet Master. Modules should have their code merged back to the master, and changes to the control repository will need to be merged with a longer lived branch.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.151.141