Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make LDAP client certificates optional/configurable and add new options for Bridge interface #52

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jangrewe
Copy link

We don't use a client cert for connecting to LDAP, and the CA certificate path didn't match on Ubuntu 16.04, so this makes it optional and configurable.

@jangrewe jangrewe changed the title LDAP: make TLS client certificates optional and configurable Make LDAP client certificates optional/configurable and add new options for Bridge interface Nov 25, 2016
@conorsch
Copy link
Contributor

Thanks for submitting this, @jangrewe. Thoughts, @nemesisdesign? Since the proposed changes politely respect current role default behavior, and are opt-in, I'm inclined to merge, but holler if you have feedback on these changes.

@nemesifier
Copy link
Contributor

The line that changes the bridge_ports is not backward compatible. Existing playbooks would break after upgrading.

I suggest something like the following:

bridge_ports {% if 'ports' in openvpn_bridge %}{{ openvpn_bridge.ports }}{% else %}{{ openvpn_dev }}{% endif %}

@jangrewe
Copy link
Author

Agreed, @nemesisdesign. I have commited a fix for this situation.

@nemesifier
Copy link
Contributor

Thank you @jangrewe, I'm not 100% sure the syntax is correct, I'll leave an inline comment on the code.

bridge_ports {{ openvpn_dev }}
bridge_ports {% if 'ports' in openvpn_bridge %}{{ openvpn_bridge.ports }}
{% else %}{{ openvpn_dev }}
{% endif -%}
Copy link
Contributor

@nemesifier nemesifier Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure the - at the end is ok? Shouldn't it be {% endif %}, or is it a jinja2 feature I don't know?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The - removes the whitespace/newline, depending on where you put it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -11,9 +11,14 @@ iface {{ openvpn_dev }} inet manual
# Bridge
auto br-{{ openvpn_dev }}
iface br-{{ openvpn_dev }} inet static
bridge_ports {{ openvpn_dev }}
bridge_ports {% if 'ports' in openvpn_bridge %}{{ openvpn_bridge.ports }}
Copy link
Contributor

@nemesifier nemesifier Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this is just a style related comment)
even if it would be long, I would prefer having everything on oneline, the resulting configuration would look more readable, although I would have to test it, which I haven't yet. Have you tested it and if yes does the resulting configuration file look ok and works?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that the formatting is ugly this way, but otherwise you have the next line either indented one tabstop too much, or on the same line. If there was any way to force a newline character, i'd put it as a oneliner, too! =)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jangrewe
Copy link
Author

The - removes the whitespace/newline, depending on where you put it. I know that the formatting is ugly this way, but otherwise you have the next line either indented one tabstop too much, or on the same line. If there was any way to force a newline character, i'd put it as a oneliner, too! =)

@nemesifier
Copy link
Contributor

Thanks for the explaination, ok for me 👍

bridge_stp off
address {{openvpn_bridge.address}}
netmask {{openvpn_bridge.netmask}}
network {{openvpn_bridge.network}}
broadcast {{openvpn_bridge.broadcast}}
{% for line in openvpn_bridge.script -%}
{{ line }}
{% endfor %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this structure, the dict openvpn_bridge must contain a script list element. If that's truly a requirement, fine as-is, otherwise a |default([]) would come in handy here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@conorsch you are right, I was not thinking about it. Yes, keeping backward compatibility is better, I would prefer it, what do you think @jangrewe?

@conorsch
Copy link
Contributor

@nemesisdesign @jangrewe Can you both +1 here if you're satisfied for merge? I am not using bridged connections, but these changes look solid. If they work well for both of your uses cases, happy to include.

@nemesifier
Copy link
Contributor

👍

@nemesifier
Copy link
Contributor

Was this forgotten?

@nkakouros nkakouros added this to the Version 3.0 milestone Feb 17, 2019
@jasiek
Copy link

jasiek commented Apr 7, 2019

Hey, any chance this could be merged in?

@nkakouros
Copy link
Collaborator

I don't have the time right now to go through this PR and resolve the conflicts, but if someone does, I would be glad to merge.

@nkakouros nkakouros force-pushed the develop branch 2 times, most recently from 4845328 to b7bb783 Compare January 5, 2020 19:20
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.

5 participants