Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ansible-roles
Openvpn Client
Commits
894af961
Commit
894af961
authored
2 years ago
by
Пальмин Альберт
Browse files
Options
Download
Email Patches
Plain Diff
fix
parent
f9151703
master
1 merge request
!3
Dev
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
handlers/main.yml
+1
-1
handlers/main.yml
tasks/main.yml
+9
-3
tasks/main.yml
with
10 additions
and
4 deletions
+10
-4
handlers/main.yml
View file @
894af961
---
-
name
:
start vpn connect
shell
:
openvpn --config ~/for-servers.ovpn &
#выполняет задачу в фоне
shell
:
openvpn --config ~/
vpn/
for-servers.ovpn &
#выполняет задачу в фоне
This diff is collapsed.
Click to expand it.
tasks/main.yml
View file @
894af961
...
...
@@ -16,7 +16,7 @@
tags
:
start
-
name
:
Deleting all other configurations
#удаление других конфигураций чтобы одно на другое на наложилось
shell
:
rm ~/*.ovpn ||
true
shell
:
rm ~/
vpn/
*.ovpn ||
true
tags
:
start
-
name
:
Started openvpn-client
#служба должна быть просто запущена. Это не включение VPN соединения
...
...
@@ -42,10 +42,16 @@
become
:
no
tags
:
start
-
name
:
Creates directory for config
file
:
path
:
~/vpn
state
:
directory
tags
:
start
-
name
:
Copy *.ovpn file
#копирование найденного файла на сервер и запуск подключения. Подключение занимает секунд 5-7
ansible.builtin.copy
:
src
:
"
{{item.path}}"
dest
:
"
~/for-servers.ovpn"
dest
:
"
~/
vpn/
for-servers.ovpn"
with_items
:
-
"
{{find_result_ovpn.files}}"
notify
:
...
...
@@ -64,5 +70,5 @@
tags
:
stop
-
name
:
Deleting all other configurations
#удаление других конфигураций чтобы одно на другое на наложилось
shell
:
rm ~/*.ovpn ||
true
shell
:
rm ~/
vpn/
*.ovpn ||
true
tags
:
stop
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help