-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# vi: ft=yaml.ansible.jinja2 | ||
# yamllint disable rule:braces | ||
--- | ||
|
||
- name: OpenVPN host up | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
|
||
- name: Allow connections to the OpenVPN server | ||
iptables: | ||
chain: INPUT | ||
in_interface: "{{ openvpn_out_interface | default(omit, true) }}" | ||
ctstate: NEW | ||
protocol: "{{ openvpn_proto }}" | ||
destination_port: "{{ openvpn_port }}" | ||
jump: ACCEPT | ||
comment: incoming_openvpn | ||
notify: openvpn save iptables | ||
when: iptables_rules.stdout.find("incoming_openvpn") == -1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
sysctl_set: true | ||
state: present | ||
reload: true | ||
when: not lookup('env', 'IN_MOLECULE') | d(true, true) | bool | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nkakouros
Author
Collaborator
|
To configure a VPN server, I just executed in a playbook a fork of this role and with this condition, the corresponding task, which is needed for the VPN server to be a router (forward IP traffic), was not executed.
I understand that the environment variable
IN_MOLECULE
is present and set to true when executing molecule ansible test environement. And I understand that you don't want to execute the task in such environement. But, when deploying an openvpn server, it should be executed. Therefore the whole condition should be:(I have to check if ti works. It should.). Or, which is semantically less clear: