Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #329 from deNBI/feat/gateway-play
Browse files Browse the repository at this point in the history
  • Loading branch information
eKatchko authored May 14, 2020
2 parents 61a543e + c66d1ce commit 975d259
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/gateway/gateway-setup-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
general:
REPO_PATH: /home/ubuntu/cloud-portal-client
SCRIPT_PERSISTENT_PATH: /home/ubuntu/gateway_persistent
TCP_SCRIPT_PERSISTENT_NAME: gateway_TCP.sh
UDP_SCRIPT_PERSISTENT_NAME: gateway_UDP.sh
58 changes: 58 additions & 0 deletions scripts/gateway/gateway-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
- name: Setting up gateway
hosts: all
become: yes
vars_files:
- gateway-setup-variables.yml
tasks:

- name: Create persistent gateway script directorie
file:
path: "{{ general.SCRIPT_PERSISTENT_PATH }}"
state: directory

- name: Checkout cloud-portal-client repository
git:
repo: "[email protected]:deNBI/cloud-portal-client.git"
dest: "{{ general.REPO_PATH }}"
accept_hostkey: yes
force: yes
version: "{{ repo_version | default('master') }}"
become: no

- name: Copy TCP script from repository
copy:
src: "{{ general.REPO_PATH }}/scripts/gateway/{{ general.TCP_SCRIPT_PERSISTENT_NAME }}"
dest: "{{ SCRIPT_PERSISTENT_PATH }}/{{ general.TCP_SCRIPT_PERSISTENT_NAME }}"
mode: 0774
remote_src: yes
when: tcp_script_in is not defined

- name: Copy UDP script from repository
copy:
src: "{{ general.REPO_PATH }}/scripts/gateway/{{ general.UDP_SCRIPT_PERSISTENT_NAME }}"
dest: "{{ SCRIPT_PERSISTENT_PATH }}/{{ general.UDP_SCRIPT_PERSISTENT_NAME }}"
mode: 0774
remote_src: yes
when: udp_script_in is not defined

- name: Copy specified TCP script
copy:
src: "{{ tcp_script_in }}"
dest: "{{ SCRIPT_PERSISTENT_PATH }}/{{ general.TCP_SCRIPT_PERSISTENT_NAME }}"
mode: 0774
when: tcp_script_in is defined

- name: Copy specified UDP script
copy:
src: "{{ udp_script_in }}"
dest: "{{ SCRIPT_PERSISTENT_PATH }}/{{ general.UDP_SCRIPT_PERSISTENT_NAME }}"
mode: 0774
when: udp_script_in is defined

- name: Run TCP script
become: yes
command: "{{ SCRIPT_PERSISTENT_PATH }}/{{ general.TCP_SCRIPT_PERSISTENT_NAME }}"

- name: Run UDP script
become: yes
command: "{{ SCRIPT_PERSISTENT_PATH }}/{{ general.UDP_SCRIPT_PERSISTENT_NAME }}"

0 comments on commit 975d259

Please sign in to comment.