How Do You Troubleshoot the Error “Failed to restart puppetserver.service: Unit puppetserver.service not found.”?

Problem scenario
You try this command from the Puppet Master server:

service puppetserver restart

But you get this error:

“Failed to restart puppetserver.service: Unit puppetserver.service not found.”

What should you do?

Solution
Do not use “puppetserver” in the command.  The correct command is:

service puppetmaster restart

[Sassy_Social_Share]

How Do You Deploy Puppet Agent to an Ubuntu 16 Linux Server in AWS?

Updated on 4/15/18

Problem scenario
You installed Puppet Master on an AWS instance of Linux.  (See this link if you want to install Puppet Master on Ubuntu.  If you want to install Puppet Master on a Red Hat Enterprise Linux server, see this link). You now want an AWS instance of Ubuntu to be configured as a Puppet Agent node with open source Puppet version 5.

How Do You Install Puppet Master on an AWS Instance of Ubuntu 16?

Updated 12/1/17

Problem scenario
You need to install open source Puppet version 5 on a server to become a Puppet Master.  You have an AWS Ubuntu Linux server.  You only have five minutes to do it.  How do you install Puppet Master immediately?

Solution
1.  Create puppetinstaller.sh in the /tmp directory.  It should have the following lines (stop before you get to step #2):

#!/bin/bash
# Written by continualintegration.com

apt-get update
apt-get -y install ntp
echo ‘
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
server 3.us.pool.ntp.org’ >>

How Do You Fix the Ansible Problem “Failed to connect to the host via ssh: percent_expand: unknown key %C\r\n”, “unreachable”: true”?

Problem scenario 
When you run an Ansible playbook on the control node that is not running on a Mac (e.g., you are running Ansible on RedHat, Ubuntu or SUSE), you get this error: “Failed to connect to the host via ssh: percent_expand: unknown key %C\r\n”, “unreachable”: true”.   How do you debug your playbook to get it to run?

Root cause
​The problem may not be in the playbook.  

How Do You Install Puppet Master on a Linux SUSE Server (an AWS Instance)?

Problem scenario
You want to install Puppet Master on SUSE 12.x running in AWS.  You only have five minutes to complete this task.  How do you install Puppet Master immediately?

Solution
1.  Create this file: /etc/zypp/repos.d/puppet.repo

2.  The content of the above file should be the following:

[systemsmanagement_puppet]
name=A network tool for managing many disparate systems (SLE_12)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/systemsmanagement:/puppet/SLE_12/
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/systemsmanagement:/puppet/SLE_12/repodata/rep0md.xml.key
enabled=1

3.

How Do You Use JEA (Just Enough Administration) to Give Users the Rights to Perform Select PowerShell Tasks?

Problem scenario
You want to empower non-administrator users to perform a subset of Windows administrator-level functions.  Specifically you want to give a user with limited privileges the ability to check the local software firewall rules.  This user needs to validate if they are configured appropriately.  This user account will otherwise have limited privileges.  You want to adhere to the recommended practice of least privileges.  You want to use JEA (Just Enough Administration) to enhance the user’s privileges. 

How Do You Troubleshoot the Error “VpcLimitExceeded” When Running an Ansible Playbook in AWS?

Problem scenario
You are running an Ansible playbook in AWS, and you get this message:

TASK [metron-test:  Create virtual private cloud] ******************************
fatal: [localhost]: FAILED! => {“changed”: false, “failed”: true, “msg”: “VpcLimitExceeded: The maximum number of VPCs has been reached.”}
        to retry, use: –limit @/usr/bin/metron/metron-deployment/amazon-ec2/playbook.retry

Solution
You must have an AWS account with a special maximum of VPCs.

How Do You Fix The Ansible Error “Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013”?

Problem scenario
You are using Ansible, and you receive an error like this:

coolserver.com | UNREACHABLE! => {
    “changed”: false,
    “msg”: “Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\r\npercent_expand: unknown key %C\r\n”,
    “unreachable”: true

How do you fix this?

How Do You Get an Ansible Playbook to Change a Variable Based on a Conditional?

Problem scenario
You do not want to manipulate a variable using a shell: or command: key word. You want a variable to be changed based on conditional logic. What do you do?

Solution
Use “set_fact:” and “when:”

Here is an example:

set_fact:
vara: False
when: “{{ foobar }}” == 35 …