Open xstasi opened 4 years ago
Thank you for your patch. You are right, when there are missing keys for policy, the role fails - I have created a test scenario that shows that nicely.
What do you think about replacing the brackets with get
method? That way we would have {{ policy.get('key') }}
instead of {{ policy['key'] }}
, which should take care of the failures and looks more compact.
Hi Ondra,
I didn't even know that syntax existed, but sure. You're the developer, feel free to use the style that suits you best.
For what it's worth my comment only added the if's, the hash['key'] form was already there.
The scap client doesn't really need a lot of the parameters that are included in the template, however it will fail if they are left blank. This way if a parameter is not specified in the ansible variables the line will just not be added to the configuration file.