Skip to content

Commit d66bd7e

Browse files
committed
Merge branch 'bhupender-singh' into 'master'
added restricted entries in tasks/firewall.yaml tasks, added variables... See merge request oosm/osm_openvpn!20
2 parents 03210d4 + f15550a commit d66bd7e

15 files changed

Lines changed: 79 additions & 47 deletions

.circleci/config.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
2+
version: 2.1
3+
jobs:
4+
yaml_lint:
5+
docker:
6+
- image: opstree/docker:ansible-lint
7+
steps:
8+
- checkout
9+
- run: yamllint ./*/*.yml
10+
ansible_lint:
11+
docker:
12+
- image: opstree/docker:ansible-lint
13+
steps:
14+
- checkout
15+
- run: ansible-lint .
16+
workflows:
217
version: 2.1
3-
jobs:
4-
yaml_lint:
5-
docker:
6-
- image: opstree/docker:ansible-lint
7-
steps:
8-
- checkout
9-
- run: yamllint ./*/*.yml
10-
ansible_lint:
11-
docker:
12-
- image: opstree/docker:ansible-lint
13-
steps:
14-
- checkout
15-
- run: ansible-lint .
16-
workflows:
17-
version: 2.1
18-
lint_tests:
19-
jobs:
20-
- yaml_lint
21-
- ansible_lint
18+
lint_tests:
19+
jobs:
20+
- yaml_lint
21+
- ansible_lint
2222
...

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ yaml_lint:
99
stage: yaml-lint
1010
image: opstree/docker:ansible-lint
1111
script:
12-
- yamllint ./*/*.yml
12+
- yamllint ./*/*.yml
1313
allow_failure: true
1414

1515
ansible_lint:

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
extends: default
23

34
rules:

Jenkinsfile.publisher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Library('opstree-library@github-promoter-v1.0')_
1+
@Library('opstree-library@feature')_
22

33
node{
44
githubpromoterworkflow.call(

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ Role Variables
113113
| openvpn_server_network | 10.8.0.0 | CIDR range given to vpn network | Optional |
114114
| base_directory | /etc/openvpn | Configuration path of openvpn server | Optional |
115115
| easy_rsa_url | url | URL to download Easy RSA | Optional |
116+
| block_all_connection | false | Block all communication for openvpn client | Optional |
117+
| port_list | [80,443] | Allow specific ports for openvpn client & only applicable if block_all_connection == true | Optional |
118+
116119

117120
Example Playbook
118121
----------------

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ apache_dir_ubuntu: "/etc/apache2/conf-available/openvpn-monitor.conf"
1616
apache_dir_centos: "/etc/httpd/conf.d/openvpn-monitor.conf"
1717
client_list: clientlist
1818
revoke_list: revokelist
19+
block_all_connection: false
20+
port_list: [80, 443]
1921
...

meta/main.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ galaxy_info:
1414
- xenial
1515
- bionic
1616
galaxy_tags:
17-
- vpn
18-
- tunnel
19-
- system
20-
- networking
17+
- vpn
18+
- tunnel
19+
- system
20+
- networking
2121
dependencies: []
2222
...

tasks/client_keys.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
dest: /{{ base_directory }}
2222
owner: nobody
2323
group: nogroup
24-
remote_src: yes
24+
remote_src: true
2525

2626
- name: Copying client keys to openvpn directory
2727
copy:
2828
src: "/{{ base_directory }}/easy-rsa/pki/private/{{ item }}.key"
2929
dest: /{{ base_directory }}
30-
remote_src: yes
30+
remote_src: true
3131
with_items: "{{ lookup('file', '{{ client_list }}').splitlines() | trim }}"
3232
ignore_errors: true
3333

3434
- name: Copying client certificate to openvpn directory
3535
copy:
3636
src: "/{{ base_directory }}/easy-rsa/pki/issued/{{ item }}.crt"
3737
dest: /{{ base_directory }}
38-
remote_src: yes
38+
remote_src: true
3939
with_items: "{{ lookup('file', '{{ client_list }}').splitlines() }}"
4040
ignore_errors: true
4141

@@ -58,7 +58,7 @@
5858
fetch:
5959
src: "/{{ base_directory }}/{{ item }}.ovpn"
6060
dest: /tmp/
61-
flat: yes
61+
flat: true
6262
with_items: "{{ lookup('file', '{{ client_list }}').splitlines() }}"
6363
ignore_errors: true
6464
...

tasks/config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
line: "{{ item.line }}"
1919
state: present
2020
with_items:
21-
- { regexp: 'port 1194', line: 'port {{ PORT }}' }
22-
- { regexp: 'proto udp', line: 'proto {{ PROTOCOL }}' }
21+
- { regexp: 'port 1194', line: 'port {{ PORT }}' }
22+
- { regexp: 'proto udp', line: 'proto {{ PROTOCOL }}' }
2323

2424
- name: Getting public IP for client.conf
2525
ipify_facts:
@@ -31,8 +31,8 @@
3131
line: "{{ item.line }}"
3232
state: present
3333
with_items:
34-
- { regexp: 'proto udp', line: 'proto {{ PROTOCOL }}' }
35-
- { regexp: 'remote my-server-1 1194', line: 'remote {{ ipify_public_ip }} {{ PORT }}' }
34+
- { regexp: 'proto udp', line: 'proto {{ PROTOCOL }}' }
35+
- { regexp: 'remote my-server-1 1194', line: 'remote {{ ipify_public_ip }} {{ PORT }}' }
3636
notify:
3737
- daemon_reload
3838
- starting_openvpn

tasks/easy-rsa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
get_url:
44
url: "{{ easy_rsa_url }}"
55
dest: /tmp/
6-
validate_certs: False
6+
validate_certs: false
77

88
- name: Unarchiving easy-rsa
99
unarchive:

0 commit comments

Comments
 (0)