While a Chef recipe is executing, I want to determine if there is sufficient free disk space available to perform an operation.
How best to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ohai detects certain properties of a a node each time it is run. These properties are captured as automatic attributes and are available to you as node attributes.
The attribute node[‘filesystem’] contains information about each of the devices on your system. To get the space available in kb, for a specific device:
The following is an example of the filesystem attribute JSON from Ohai: