If you say ‘add’ it should only put the file there if it’s not there.
Name space value ?
Although this is a old thread, I do have the same "problem" with the grammar file.
authorized keys is nothing more than a name space grammar file but the main problem is that the config entry name at the moment is value2.
In fact the authorized_keys files has the following
ssh-rsa <key> user
So a file will be something along these lines:
ssh-rsa 3894629dsufbvçsbcvaoer78t034 user1
ssh-rsa 124059289165twdshçflsdhdosh2 user2
ssh-rsa coshnfoswiru20972930y74ujdap user3
Based on the name space grammar file I get the following:
name= ssh-rsa, value2=user1
which makes hard to configure as the alternative is to use whole line grammar file.
But if by any chance I have the user1 with updated keys I cannot change just the key, the compliance rule will try to match the whole line and then I will have 2 entries for the same user.
so create a new grammar so the 3rd column in the key instead of the first.
Better said than done I am afraid.
That is one of the things I have not yet covered, specially when it says for advanced users ... far from it at the moment.
the name space grammar uses the 1st column as the key/name. that doesn't seem to make sense for this file. there's a guide here: Creating custom grammars - BMC Server Automation 8.7
you can use the current name space one as a start and just figure out how to flip the columns.