If there is a configuration error in the Test Kitchen system, there are commands that can help you to get more information.
Run the instance creation in debug mode
kitchen create -l debug SUITE_NAME
Knowledge Base for IT Professionals, Teachers and Astronauts
If there is a configuration error in the Test Kitchen system, there are commands that can help you to get more information.
Run the instance creation in debug mode
kitchen create -l debug SUITE_NAME
Ruby gems are Ruby programs and libraries with a name, version and the platform that can execute them.
List the installed gems on your system
gem list
Detailed list that includes the author, homepage, license, install location and a short description
gem list -d
Install the latest version of the gem
gem install GEM_NAME
Install a specific version of the Gem
gem install GEM_NAME -v GEM_VERSION
Uninstall the gem from your system
gem uninstall GEM_NAME
Uninstall a gem from a specific location
gem uninstall GEM_NAME -i LOCATION_FROM_GEM_LIST_-D
Update the Gem list in your system after Gem uninstallation
gem update --system
A Chef node is a physical or virtual machine with an operating system that is connected to the Chef server. Once the node has made the connection to the Chef server, the installed Chef Client can execute Chef cookbooks to configure the machine.
Bootstrapping is the process to connect the node the first time to the Chef server, or to attach it again if the node lost the connectivity to the Chef server. To be able to bootstrap a node, your workstation needs to have the Chef Development Kit installed. The kit includes the ‘knife’ command that communicates with the Chef server. Your workstation also has to be able to connect to the Chef server with the YOUR_USERNAME.pem file you store in the .chef directory just above your cookbooks.
Bootstrap a Linux node
To bootstrap a Linux node, open a terminal window on your workstation and execute the command:
With password authentication ----------------------------- knife bootstrap MY_NODE_IP -x SERVER_ADMIN_USERNAME -P SERVER_ADMIN_PASSWORD --sudo --node-name THE_NODE_NAME --environment THE_ENVIRONMENT --run-list 'recipe[MY_COOKBOOK1::default],recipe[MY_COOKBOOK2::default]' --json-attributes '{"MY_ATTRIB1":"MY_VALUE1","MY_ATTRIB2":"MY_VALUE2"}' With key authentication ----------------------- knife bootstrap MY_NODE_IP -x SERVER_ADMIN_USERNAME -i PATH_TO_KEY_FILE --sudo --node-name THE_NODE_NAME --environment THE_ENVIRONMENT --run-list 'recipe[MY_COOKBOOK1::default],recipe[MY_COOKBOOK2::default]' --json-attributes '{"MY_ATTRIB1":"MY_VALUE1","MY_ATTRIB2":"MY_VALUE2"}'
Bootstrap a Windows node
knife bootstrap windows winrm MY_NODE_IP -x SERVER_ADMIN_USERNAME -P SERVER_ADMIN_PASSWORD --node-name THE_NODE_NAME --environment THE_ENVIRONMENT --run-list 'recipe[MY_COOKBOOK1::default],recipe[MY_COOKBOOK2::default]' --json-attributes '{"MY_ATTRIB1":"MY_VALUE1","MY_ATTRIB2":"MY_VALUE2"}' -V
where
If the known_hosts file already contains an entry for a different server with the same IP address, we get the error message
ERROR: Net::SSH::HostKeyMismatch: fingerprint … does not match for “…”
Open the ~/.ssh/known_hosts file and delete the line that contains the IP address of the server.
When you need to set a Chef resource attribute based on the current state of the environment, there is a way to dynamically provide the value.
# Set a boolean variable with a test def MY_BOOLEAN_VARIABLE? "#{node['domain']}" != "" end # Execute a resource and get a reference to it into a variable t = MY_RESOURCE 'MY_RESOURCE_NAME' do ... end # Set the attribute value based on the boolean variable t.MY_RESOURCE_ATTRIBUTE MY_ATTRIBUTE_VALUE if MY_BOOLEAN_VARIABLE?
If the computer you want to install Microsoft WIndows on, does not have a DVD drive, you can install Windows from a USB drive. To start the computer from the USB drive, you need to prepare the drive to make it bootable.
Microsoft has a free tool that can download the edition of the Windows operating system you need, format the USB drive, make it bootable, and place the installer file on it.
When you try to execute a Terraform configuration in Terraform Enterprise (Atlas) you may get the error message:
Setup failed: Failed to copy slug dir: lstat /Users: no such file or directory
Cause:
The Git repository contains the .terraform/modules directory, and the Terraform Enterprise server cannot get the latest modules from GitHub.
Solution:
*/.terraform/modules/ # Ignore DS_Store if working on a mac .DS_Store
To install a Python package on Macintosh
sudo -i
pip install PACKAGE_NAME
If you don’t install the package in sudo mode, you will get “Permission denied” errors during the package installation.
When you encounter the warning message
WARNING: The directory ‘/Users/…/Library/Caches/pip’ or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo’s -H flag.
To make yourself the owner of the /Users/…/Library/Caches/pip directory execute
sudo chown -R $(whoami) ~/Library/Caches/pip
When you install PyCharm, the default Python interpreter is may not the version you want to use for your new projects. When you create a new project, and the project interpreter is not set, you may get the following error message:
Executed command:
/var/folders/_x/_f0zzs1s4sx6bk4s8n78l2jsbn9r3z/T/tmpBoQLx_pycharm-management/pip-9.0.1/setup.py installError occurred:
40:357: execution error: /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: ‘python_requires’Command output:
40:357: execution error: /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: ‘python_requires’
warnings.warn(msg)
warning: build_py: byte-compiling is disabled, skipping.
warning: install_lib: byte-compiling is disabled, skipping.
error: byte-compiling is disabled.
(1)
Solution:
Set the default Python interpreter to the latest installed version before you create your project:
IronPython can expose Python types to C# libraries, and expose C# libraries to Python code.
Symptom:
from MY_FOLDER.MY_FILE import MY_CLASS causes an error:
ImportError: No module named MY_FOLDER.MY_FILE
Debugging:
Possible cause:
The __init__.py file is missing in the directory of the referenced class.
Solution:
Create an empty __init__.py file in the directory where the class is referenced from.