LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Ruby Code for Puppet (https://www.linuxquestions.org/questions/programming-9/ruby-code-for-puppet-4175443999/)

edwardcode 01-03-2013 12:19 PM

Ruby Code for Puppet
 
I would like to crate a new custom fact for puppet. I want the code to take an IP and add two to the last octet. (example: 127.0.0.1 to 127.0.0.3) I know I can exec a long string of crap, but I was hopping that every thing could be done in ruby so I can put it in my Fact.rb file in puppet. The only problem is my ruby skill are currently low, but growing.

Will any one help?

Thanks in advance.

grail 01-04-2013 04:08 AM

I am not sure where you are stuck? Maybe you could provide what you have tried as my initial thought is that editing a string is particularly simple.


All times are GMT -5. The time now is 07:01 PM.