Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vagrantsetup
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
devbox
vagrantsetup
Commits
f5996c73
Commit
f5996c73
authored
Sep 28, 2019
by
Reimar Stier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix path in conda installer; update env path
parent
0460704a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
20 deletions
+53
-20
install.yml
local_roles/conda_installer/tasks/install.yml
+2
-1
playbook.yml
playbook.yml
+4
-1
add_path_to_env.yml
tasks/add_path_to_env.yml
+47
-0
xfce4_configuration.yml
tasks/xfce4_configuration.yml
+0
-18
No files found.
local_roles/conda_installer/tasks/install.yml
View file @
f5996c73
...
...
@@ -23,9 +23,10 @@
-
name
:
Add miniconda bin to path
lineinfile
:
path
:
/etc/profile
path
:
/etc/profile
.d/conda.sh
regexp
:
'
^export
PATH={{
conda_installer_dir
}}/bin:\$PATH$'
line
:
"
export
PATH={{
conda_installer_dir
}}/bin:$PATH"
create
:
true
-
name
:
conda - read permission for all
file
:
path
:
"
{{
conda_installer_path
}}"
...
...
playbook.yml
View file @
f5996c73
...
...
@@ -23,5 +23,8 @@
post_tasks
:
-
name
:
post configuration tasks
block
:
-
import_tasks
:
tasks/xfce4_configuration.yml
-
import_tasks
:
tasks/add_path_to_env.yml
tags
:
desktop_config
tasks/add_path_to_env.yml
0 → 100644
View file @
f5996c73
-
name
:
Define paths to be added
set_fact
:
environment_file
:
"
/etc/environment"
environment_shell_file
:
"
/etc/profile.d/custom.sh"
environment_path_add
:
"
/opt/bin/"
environment_path_default
:
"
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
-
name
:
Ensure default path is present in environment
block
:
-
name
:
Check default path
shell
:
"
grep
-E
'^PATH='
{{
environment_file
}}"
register
:
_environment_check
failed_when
:
false
changed_when
:
false
-
name
:
Ensure default path is present
lineinfile
:
path
:
"
{{
environment_file
}}"
regexp
:
'
^PATH=.*'
line
:
'
PATH="{{
environment_path_default
}}"'
create
:
true
when
:
_environment_check.rc != 0
-
name
:
Ensure custom path is present in environment
block
:
-
name
:
Check custom path
shell
:
"
grep
'{{
environment_path_add
}}:'
{{
environment_file
}}"
register
:
_environment_check
failed_when
:
false
changed_when
:
false
-
name
:
Add custom path if not present
lineinfile
:
path
:
"
{{
environment_file
}}"
regexp
:
'
^PATH="?([^"\n]+)"?$'
line
:
'
PATH="{{
environment_path_add
}}:\1"'
backrefs
:
true
create
:
true
when
:
_environment_check.rc != 0
-
name
:
Add path to shell profile
lineinfile
:
path
:
"
{{
environment_shell_file
}}"
regexp
:
'
^export
PATH={{
environment_path_add
}}:\$PATH$'
line
:
"
export
PATH={{
environment_path_add
}}:$PATH"
create
:
true
tasks/xfce4_configuration.yml
View file @
f5996c73
...
...
@@ -9,21 +9,3 @@
service
:
name="gdm" state="restarted"
when
:
_shell_output.changed
-
name
:
Define paths to be added
set_fact
:
environment_file
:
"
/etc/environment"
environment_path_add
:
"
/opt/bin/"
-
name
:
Check if path in environment
shell
:
"
grep
'/opt/bin/'
{{
environment_file
}}"
register
:
_environment_check
failed_when
:
false
changed_when
:
false
-
name
:
Ensure path is added to environment
lineinfile
:
path
:
"
{{
environment_file
}}"
regexp
:
'
^PATH="(.*)"$'
line
:
'
PATH="{{
environment_path_add
}}:\1"'
backrefs
:
yes
when
:
_environment_check.rc != 0
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