I don't understand. If you didn't specify an index, then how would you expect Puppet to know which sn you're talking about?
Your data are laid out quite strangely, however, probably not as you intended. The value of the top-level 'users' key is an array of one-element hashes, which are not all similar in apparent data content. Perhaps this would be closer to what you want:
users:
project : Symfony
dbname : test
dbuser : test
dbpwd : test
project : Idephix
dbname : test
dbuser : test
dbpwd : test
That makes 'users' an array containing only two elements, each one of them a hash with five keys. You would still need to index into the array and then into the hash, but all the data associated with a given server would be in the same hash, accessed at the same array index.
Depending on how you want to use it, something like this might also be useful:
users:
project : Symfony
dbname : test
dbuser : test
dbpwd : test
project : Idephix
dbname : test
dbuser : test
dbpwd : test
That makes 'users' a hash of hashes, with server names as the outer hash keys. You would access leaf elements like so:
$users = hiera('users')
$project = $users['
server.example.com']['project']
If you don't want to rely on prior knowledge of the outer hash keys (i.e. the server names) then you can extract them from the data via the keys() function, available from Puppetlabs's "stdlib" add-in module (
https://forge.puppetlabs.com/puppetlabs/stdlib).
John