flexera-public / rightscale_cookbooks

Other
76 stars 102 forks source link

Always send valid node name to the chef server #158

Closed kliuchnikau closed 4 years ago

kliuchnikau commented 10 years ago

Without node name validation it is possible to enter incorrect node_name input and get boot script failure. In this PR I validate name against official Chef regex for node names. I also remove invalid characters - this feature helped me to create Server Array in the RS with the name like 'web.node.auto' and when I set node_name input to Env: RS_SERVER_NAME I get correctly formatted node names on Chef Server with auto-increment like 'web.node.auto1', 'web.node.auto2' - names like these are way better than FQDN. Without this fix I was receiving names 'web.node.auto #1' which are incorrect node names.