Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
piops-roles
rp
Commits
1a61a90f
Commit
1a61a90f
authored
Mar 06, 2019
by
Okhin
Browse files
Installation et configuration de la rp
parent
bb2b5f10
Pipeline
#2458
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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