-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the structure to match that of the other services.
- Loading branch information
Showing
29 changed files
with
370 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
ansible-bender = "*" | ||
autopep8 = "*" | ||
flake8 = "*" | ||
pylint = "*" | ||
pytest = "*" | ||
selinux = "*" | ||
|
||
[packages] | ||
rtls = {editable = true, path = "./service"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
- name: rtls build | ||
hosts: all | ||
vars: | ||
www_root: '/var/www/rtls/service' | ||
ansible_bender: | ||
base_image: 'registry.fedoraproject.org/fedora:latest' | ||
cache_tasks: False | ||
layering: False | ||
target_image: | ||
name: rtls | ||
environment: | ||
PIPENV_VENV_IN_PROJECT: 'True' | ||
entrypoint: "{{ www_root }}/service_run.sh" | ||
working_dir: "{{ www_root }}" | ||
tasks: | ||
- name: Setup the base | ||
include_role: | ||
name: base | ||
|
||
- name: Setup the app | ||
include_role: | ||
name: app |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
|
||
- name: Setting up the app directory | ||
file: | ||
path: "{{ www_root }}" | ||
state: directory | ||
|
||
- name: Copy app code | ||
copy: | ||
src: "{{ playbook_dir }}/service" | ||
dest: "{{ app_root }}" | ||
|
||
- name: Copy python packaging files | ||
copy: | ||
src: "{{ item }}" | ||
dest: "{{ app_root }}" | ||
loop: | ||
- "{{ playbook_dir }}/service/setup.py" | ||
- "{{ playbook_dir }}/service/requirements.txt" | ||
|
||
- name: Copy Pipenv files | ||
copy: | ||
src: "{{ item }}" | ||
dest: "{{ www_root }}" | ||
mode: preserve | ||
loop: | ||
- "{{ playbook_dir }}/Pipfile" | ||
|
||
- name: Setup venv | ||
shell: | ||
cmd: "pipenv update" | ||
chdir: "{{ app_root }}" | ||
|
||
- name: Copy files | ||
template: | ||
src: templates/service_run.j2 | ||
dest: "{{ app_root }}/service_run.sh" | ||
mode: 'o+x' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /bin/bash | ||
|
||
source {{ www_root }}/.venv/bin/activate | ||
cd {{ www_root }} | ||
nginx | ||
# Timeout value is in seconds | ||
gunicorn wsgi:app \ | ||
--bind 127.0.0.1:8000 \ | ||
--timeout 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
|
||
app_root: '{{ www_root }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
server { | ||
listen 80; | ||
server_name server_domain_or_IP; | ||
|
||
location / { | ||
include proxy_params; | ||
proxy_pass http://127.0.0.1:8000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
|
||
- name: Install packages | ||
dnf: | ||
name: | ||
- pipenv | ||
- nginx | ||
- python38 | ||
state: present | ||
install_weak_deps: no | ||
|
||
- name: Clean dnf metadata | ||
shell: 'dnf clean all' | ||
args: | ||
warn: no | ||
|
||
- name: Remove dnf cache | ||
file: | ||
path: /var/lib/dnf | ||
state: absent | ||
|
||
- name: Set up base directory for apps | ||
file: | ||
path: "{{ www_root }}" | ||
state: directory | ||
|
||
- name: Copy nginx config | ||
copy: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
owner: nginx | ||
group: nginx | ||
loop: | ||
- {'src': 'rtls.conf', 'dest': '/etc/nginx/conf.d'} | ||
- {'src': 'proxy_params', 'dest': '/etc/nginx'} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.