Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LQDN Adminsys
piops-roles
rp
Commits
1a61a90f
Commit
1a61a90f
authored
Mar 06, 2019
by
Okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Installation et configuration de la rp
parent
bb2b5f10
Pipeline
#2458
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
0 deletions
+129
-0
tasks/main.yml
tasks/main.yml
+115
-0
templates/env.py.j2
templates/env.py.j2
+5
-0
templates/vassals-rp.j2
templates/vassals-rp.j2
+9
-0
No files found.
tasks/main.yml
0 → 100644
View file @
1a61a90f
---
-
name
:
create a rp user
user
:
append
:
yes
groups
:
[
gitlab-runner
,
www-data
]
home
:
"
{{
rp_path
}}"
name
:
"
{{
rp_unix_user
}}"
state
:
present
system
:
yes
password
:
'
*'
-
name
:
install required nodejs packages
npm
:
global
:
yes
production
:
"
{%
if
rp_debug
%}false{%
else
%}true{%
endif
%}"
name
:
"
{{
item
}}"
state
:
latest
loop
:
"
{{
npm_packages
}}"
-
name
:
install uwsgi (emperor) packages
package
:
name
:
"
{{
item
}}"
state
:
latest
loop
:
-
uwsgi-emperor
-
uwsgi-plugin-python3
-
libapache2-mod-uwsgi
-
name
:
enable uwsgi (emperor) on start
service
:
name
:
uwsgi-emperor
enabled
:
yes
state
:
started
-
name
:
create /run/ directory
file
:
state
:
directory
path
:
/run/uwsgi/app/rp/
owner
:
"
{{
rp_unix_user
}}"
group
:
www-data
mode
:
0775
-
block
:
-
name
:
create the directory for code and environment
file
:
path
:
"
{{
rp_path
}}"
state
:
directory
group
:
gitlab-runner
-
name
:
unzip the rp code
unarchive
:
src
:
"
{{
rp_download_url
}}"
dest
:
"
{{
rp_path
}}"
keep_newer
:
yes
remote_src
:
yes
mode
:
g+rw
owner
:
"
{{
rp_unix_user
}}"
group
:
gitlab-runner
-
name
:
install python requirement
pip
:
requirements
:
"
{{
rp_source_path
}}/requirements.txt"
virtualenv
:
"
{{
rp_path
}}/env"
virtualenv_python
:
python3
-
name
:
install python dev requirements
pip
:
requirements
:
"
{{
rp_source_path
}}/requirements-dev.txt"
virtualenv
:
"
{{
rp_path
}}/env"
virtualenv_python
:
python3
when
:
rp_debug
-
name
:
yarn install the application
yarn
:
path
:
"
{{
rp_source_path
}}/"
state
:
latest
register
:
yarn_out
changed_when
:
'
"Already
up-to-date."
not
in
yarn_out.out'
-
name
:
webpack the css
command
:
webpack
args
:
chdir
:
"
{{
rp_source_path
}}/"
changed_when
:
false
-
name
:
create the local env settings for django
template
:
src
:
templates/env.py.j2
dest
:
"
{{
rp_source_path
}}/project/settings/env.py"
-
name
:
migrate the database
django_manage
:
command
:
migrate
virtualenv
:
"
{{
rp_path
}}/env/"
pythonpath
:
"
{{
rp_source_path
}}/project"
settings
:
project.settings
app_path
:
"
{{
rp_source_path
}}"
-
name
:
collect static file for django
django_manage
:
command
:
collectstatic
link
:
true
virtualenv
:
"
{{
rp_path
}}/env/"
pythonpath
:
"
{{
rp_source_path
}}/project"
settings
:
project.settings
app_path
:
"
{{
rp_source_path
}}"
become
:
yes
become_user
:
"
{{
rp_unix_user
}}"
-
name
:
adds a vassal for rp
template
:
src
:
templates/vassals-rp.j2
dest
:
/etc/uwsgi-emperor/vassals/rp.ini
templates/env.py.j2
0 → 100644
View file @
1a61a90f
{% if rp_debug %}
DEBUG = True
{% endif %}
SITE_ID = {{ rp_site_id }}
SECRET_KEY = '{{ rp_secret_key | replace('\n', '') }}'
templates/vassals-rp.j2
0 → 100644
View file @
1a61a90f
[uwsgi]
plugins = python3
module = project.wsgi:application
env = DJANGO_SETTINGS_MODULE=project.settings
chdir = {{ rp_source_path }}
home = {{ rp_path }}/env
socket = /run/uwsgi/app/rp/socket
pidfile = /run/uwsgi/app/rp/pid
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