Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
funkwhale
ansible
Commits
ade5f7c8
Commit
ade5f7c8
authored
1 year ago
by
Georg Krause
Browse files
Options
Downloads
Patches
Plain Diff
feat: Install Ansible in venv
parent
75ab16ce
Branches
Branches containing commit
No related tags found
1 merge request
!36
ci: Run tests on debian 12
Pipeline
#31990
failed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
install.sh
+7
-6
7 additions, 6 deletions
install.sh
upgrade.sh
+2
-1
2 additions, 1 deletion
upgrade.sh
with
9 additions
and
7 deletions
install.sh
+
7
−
6
View file @
ade5f7c8
...
@@ -20,7 +20,7 @@ min_python_version_major="3"
...
@@ -20,7 +20,7 @@ min_python_version_major="3"
min_python_version_minor
=
"5"
min_python_version_minor
=
"5"
base_path
=
"/srv/funkwhale"
base_path
=
"/srv/funkwhale"
ansible_conf_path
=
"
$base_path
/ansible"
ansible_conf_path
=
"
$base_path
/ansible"
ansible_
bin
_path
=
"
$HOME
/.local/
bin
"
ansible_
venv
_path
=
"
$HOME
/.local/
ansible
"
ansible_funkwhale_role_version
=
"
${
ANSIBLE_FUNKWHALE_ROLE_VERSION
-master
}
"
ansible_funkwhale_role_version
=
"
${
ANSIBLE_FUNKWHALE_ROLE_VERSION
-master
}
"
ansible_funkwhale_role_path
=
"
${
ANSIBLE_FUNKWHALE_ROLE_PATH
-
}
"
ansible_funkwhale_role_path
=
"
${
ANSIBLE_FUNKWHALE_ROLE_PATH
-
}
"
funkwhale_systemd_after
=
""
funkwhale_systemd_after
=
""
...
@@ -216,9 +216,10 @@ do_install() {
...
@@ -216,9 +216,10 @@ do_install() {
init_ansible
()
{
init_ansible
()
{
echo
"[2/
$total_steps
] Installing ansible dependencies..."
echo
"[2/
$total_steps
] Installing ansible dependencies..."
install_packages curl git python3-pip python3-apt python3-psycopg2
sudo
locales locales-all
install_packages curl git python3-pip
python3-venv
python3-apt python3-psycopg2
sudo
locales locales-all
echo
"[2/
$total_steps
] Installing Ansible..."
echo
"[2/
$total_steps
] Installing Ansible..."
pip3
install
--user
ansible
==
"
$ansible_version
"
python3
-m
venv
$ansible_venv_path
$ansible_venv_path
/bin/pip3
install
ansible
==
"
$ansible_version
"
echo
"[2/
$total_steps
] Creating ansible configuration files in
$ansible_conf_path
..."
echo
"[2/
$total_steps
] Creating ansible configuration files in
$ansible_conf_path
..."
mkdir
-p
"
$ansible_conf_path
"
mkdir
-p
"
$ansible_conf_path
"
...
@@ -287,7 +288,7 @@ EOF
...
@@ -287,7 +288,7 @@ EOF
#!/bin/sh
#!/bin/sh
# reapply playbook with existing parameter
# reapply playbook with existing parameter
# Useful if you changed some variables in playbook.yml
# Useful if you changed some variables in playbook.yml
exec
$ansible_
bin
_path
/ansible-playbook -i
$ansible_conf_path
/inventory.ini
$ansible_conf_path
/playbook.yml -u root
$ansible_flags
exec
$ansible_
venv
_path
/
bin/
ansible-playbook -i
$ansible_conf_path
/inventory.ini
$ansible_conf_path
/playbook.yml -u root
$ansible_flags
EOF
EOF
chmod
+x ./reconfigure
chmod
+x ./reconfigure
if
[
"
$funkwhale_redis_managed
"
=
"false"
]
;
then
if
[
"
$funkwhale_redis_managed
"
=
"false"
]
;
then
...
@@ -306,7 +307,7 @@ EOF
...
@@ -306,7 +307,7 @@ EOF
EOF
EOF
if
[
"
$ansible_funkwhale_role_path
"
=
''
]
;
then
if
[
"
$ansible_funkwhale_role_path
"
=
''
]
;
then
echo
"[2/
$total_steps
] Downloading Funkwhale playbook dependencies"
echo
"[2/
$total_steps
] Downloading Funkwhale playbook dependencies"
$ansible_
bin
_path
/ansible-galaxy
install
-r
requirements.yml
-f
$ansible_
venv
_path
/
bin/
ansible-galaxy
install
-r
requirements.yml
-f
else
else
echo
"[2/
$total_steps
] Skipping playbook dependencies, using local role instead"
echo
"[2/
$total_steps
] Skipping playbook dependencies, using local role instead"
fi
fi
...
@@ -314,7 +315,7 @@ EOF
...
@@ -314,7 +315,7 @@ EOF
run_playbook
()
{
run_playbook
()
{
cd
"
$ansible_conf_path
"
cd
"
$ansible_conf_path
"
echo
"[3/
$total_steps
] Installing Funkwhale using ansible playbook in
$ansible_conf_path
..."
echo
"[3/
$total_steps
] Installing Funkwhale using ansible playbook in
$ansible_conf_path
..."
playbook_command
=
"
$ansible_
bin
_path
/ansible-playbook -i
$ansible_conf_path
/inventory.ini
$ansible_conf_path
/playbook.yml -u root
$ansible_flags
"
playbook_command
=
"
$ansible_
venv
_path
/
bin/
ansible-playbook -i
$ansible_conf_path
/inventory.ini
$ansible_conf_path
/playbook.yml -u root
$ansible_flags
"
if
[
"
$is_dry_run
"
=
"true"
]
;
then
if
[
"
$is_dry_run
"
=
"true"
]
;
then
playbook_command
=
"
$playbook_command
--check"
playbook_command
=
"
$playbook_command
--check"
echo
"[3/
$total_steps
] Skipping playbook because DRY_RUN=true"
echo
"[3/
$total_steps
] Skipping playbook because DRY_RUN=true"
...
...
This diff is collapsed.
Click to expand it.
upgrade.sh
+
2
−
1
View file @
ade5f7c8
...
@@ -14,7 +14,8 @@ skip_confirm="${SKIP_CONFIRM-}"
...
@@ -14,7 +14,8 @@ skip_confirm="${SKIP_CONFIRM-}"
is_dry_run
=
${
DRY_RUN
-false
}
is_dry_run
=
${
DRY_RUN
-false
}
base_path
=
"/srv/funkwhale"
base_path
=
"/srv/funkwhale"
ansible_conf_path
=
"
$base_path
/ansible"
ansible_conf_path
=
"
$base_path
/ansible"
ansible_bin_path
=
"
$HOME
/.local/bin"
ansible_venv_path
=
"
$HOME
/.local/ansible"
ansible_bin_path
=
"
$ansible_venv_path
/bin"
ansible_funkwhale_role_version
=
"
${
ANSIBLE_FUNKWHALE_ROLE_VERSION
-master
}
"
ansible_funkwhale_role_version
=
"
${
ANSIBLE_FUNKWHALE_ROLE_VERSION
-master
}
"
funkwhale_systemd_after
=
""
funkwhale_systemd_after
=
""
total_steps
=
"4"
total_steps
=
"4"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment