-
Notifications
You must be signed in to change notification settings - Fork 198
Conversation
moved the check for user supplied settings to block head and reversed order of assignments to compensate for the missing check on the set variable Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
related to #256 At first I treid to order this by version, but that just destroyed the ordering of all common variables. Instead I tried to cut out the check for the base variable we want to set here. This made a lot more sense to me. What do you think @rndmh3ro ? Also as a consequence te assignments are now reversed (in natural ascending order) since the last task will override all previous settings. That should pose no problem, since the highest version wins and is also more natural to extend by simply putting the new stuff at the end. |
Sadly that's not the case with Ansible. The docs state: "In the example above, each of the 3 tasks will be executed after appending the when condition from the block and evaluating it in the task’s context. " This means that the condidition So the first task runs like this after applying the block-condition:
Since Then the second task runs:
This task gets skipped because This means we have to reverse the order again so the task with the latest sshd_version runs first. Unless you can think of an even better idea. |
you are absolutely right! However I really like the natural ordering and want to preserve this. One option would be to use |
We'd then have to create and include at least 6 new files (one for every version of ssh where ciphers, macs etc. change). Not to forget that the variables still have to be overrideable. |
I'd rather not do this for versions, but for the differen variables, so one file for each: kex, hostkeys, macs and ciphers. |
And how will do it with the ordering then? You can also just push some code to show what you mean. |
preserve the version ordering of defaults and group all tasks according to base configuration variable (cipthers, hostkeys, kex and macs) Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
ok, so how about this way? |
I like it that way. However could you please intergrate the include-tasks in the crypto.yml back into the hardening.yml? There's no need anymore for this additional layer. |
move include tasks to hardening.yml and remove intermediate crypto.yml Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
moved the check for user supplied settings to block head and reversed
order of assignments to compensate for the missing check on the set
variable
Signed-off-by: Martin Schurz Martin.Schurz@t-systems.com