Skip to content

Conversation

xstasi
Copy link

@xstasi xstasi commented Nov 28, 2019

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.

@xprazak2
Copy link
Contributor

xprazak2 commented Dec 3, 2019

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.

@xprazak2 xprazak2 self-assigned this Dec 3, 2019
@xstasi
Copy link
Author

xstasi commented Dec 3, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants