Created
July 23, 2015 17:48
-
-
Save Maniacal/2d2f2d819914fca5953d to your computer and use it in GitHub Desktop.
This file contains 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
I have this code that finds seed nodes: | |
def cassandra_seeds | |
nodes = search( | |
:node, "pds_cassandra_cluster_name:\ | |
#{node['pds_cassandra']['cluster_name']}\ | |
AND tags:*seed_node*" | |
) | |
seeds = Set.new | |
nodes.each do |data| | |
seeds.merge([data['ipaddress']]) | |
end | |
seeds.to_a | |
end | |
I've tried mocking it but no luck: | |
ChefSpec::ServerRunner.new do |node| | |
node.automatic['ipaddress'] = '192.168.50.100' | |
node.normal['tags'] = ['seed_node'] | |
end.converge(described_recipe) | |
I've also tried node.set['tags'] (instead of .normal) but no luck |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment