Created
July 5, 2009 23:46
-
-
Save lak/141182 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BaseTesting | |
| STORE = :data_mapper | |
| def initialize | |
| Puppet::Node.terminus_class = STORE | |
| Puppet::Node::Facts.terminus_class = STORE | |
| end | |
| def node_test | |
| node = Puppet::Node.new("foo.madstop.com") | |
| node.environment = "production" | |
| node.ipaddress = "127.0.0.1" | |
| node.save | |
| p node | |
| node = Puppet::Node.find("foo.madstop.com") | |
| p node | |
| node.environment = "development" | |
| node.ipaddress = "127.0.0.5" | |
| node.save | |
| p Puppet::Node.find("foo.madstop.com") | |
| end | |
| def facts_test | |
| p Puppet::Node::Facts.find("foo.madstop.com") | |
| facts = Puppet::Node::Facts.new("foo.madstop.com") | |
| facts.values = {"one" => "two", "horse" => "shoe"} | |
| facts.save | |
| p facts | |
| facts = Puppet::Node::Facts.find("foo.madstop.com") | |
| p facts | |
| facts.values["foo"] = "bar" | |
| facts.values.delete("one") | |
| facts.save | |
| p Puppet::Node::Facts.find("foo.madstop.com") | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment