Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
28a7f975
Commit
28a7f975
authored
Dec 18, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable X11 forwarding for devstack
parent
2261e372
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
84 additions
and
29 deletions
+84
-29
playbooks/roles/local_dev/app_bashrc.j2
+18
-0
playbooks/roles/local_dev/defaults/main.yml
+15
-5
playbooks/roles/local_dev/files/x11_display
+1
-0
playbooks/roles/local_dev/tasks/main.yml
+19
-1
playbooks/roles/local_dev/templates/app_bashrc.j2
+17
-0
playbooks/roles/local_dev/templates/edxapp_bashrc.j2
+0
-8
playbooks/roles/local_dev/templates/forum_bashrc.j2
+0
-8
playbooks/roles/local_dev/templates/ora_bashrc.j2
+0
-6
playbooks/roles/local_dev/templates/share_x11.j2
+8
-0
vagrant/base/devstack/Vagrantfile
+6
-1
No files found.
playbooks/roles/local_dev/app_bashrc.j2
0 → 100644
View file @
28a7f975
#! /usr/bin/env bash
# {{ ansible_managed }}
source
"{{ item.home }}/{{ item.env }}"
# If X11 forwarding is enabled, then use the DISPLAY value
# already set and use the X11 session cookie
if
[
-n
"
$DISPLAY
"
]
;
then
export
XAUTHORITY
=
"{{ localdev_xauthority }}"
# Otherwise, configure the display to use the virtual frame buffer
else
export
DISPLAY
=
"{{ localdev_xvfb_display }}"
fi
# Default to the code repository
cd
"{{ item.home }}/{{ item.repo }}"
playbooks/roles/local_dev/defaults/main.yml
View file @
28a7f975
---
localdev_user
:
"
vagrant"
localdev_home
:
"
/home/vagrant"
localdev_xauthority
:
"
{{
localdev_home
}}/.Xauthority"
localdev_xvfb_display
:
"
:1"
localdev_accounts
:
-
{
user
:
"
{{
edxapp_user}}"
,
home
:
"
{{
edxapp_app_dir
}}"
}
-
{
user
:
"
{{
forum_user
}}"
,
home
:
"
{{
forum_app_dir
}}"
}
-
{
user
:
"
{{
ora_user
}}"
,
home
:
"
{{
ora_app_dir
}}"
}
-
{
user
:
"
{{
edxapp_user}}"
,
home
:
"
{{
edxapp_app_dir
}}"
,
env
:
"
edxapp_env"
,
repo
:
"
edx-platform"
}
-
{
user
:
"
{{
forum_user
}}"
,
home
:
"
{{
forum_app_dir
}}"
,
env
:
"
forum_env"
,
repo
:
"
cs_comments_service"
}
-
{
user
:
"
{{
ora_user
}}"
,
home
:
"
{{
ora_app_dir
}}"
,
env
:
"
ora_env"
,
repo
:
"
ora"
}
localdev_env
:
DISPLAY
:
"
{{
browser_xvfb_display
}}"
# Helpful system packages for local dev
local_dev_pkgs
:
-
vim
-
emacs
-
xorg
-
openbox
playbooks/roles/local_dev/files/x11_display
0 → 100644
View file @
28a7f975
Defaults env_keep+=DISPLAY
playbooks/roles/local_dev/tasks/main.yml
View file @
28a7f975
...
...
@@ -27,7 +27,7 @@
# Create scripts to configure environment
-
name
:
local_dev | create login scripts
template
:
src=
{{ item.user }}
_bashrc.j2 dest={{ item.home }}/.bashrc
src=
app
_bashrc.j2 dest={{ item.home }}/.bashrc
owner={{ item.user }} mode=755
with_items
:
"
{{
localdev_accounts
}}"
...
...
@@ -38,3 +38,21 @@
src=gitconfig dest={{ item.home }}/.gitconfig
owner={{ item.user }} mode=700
with_items
:
"
{{
localdev_accounts
}}"
# Configure X11 for application users
-
name
:
local_dev | preserve DISPLAY for sudo
copy
:
src=x11_display dest=/etc/sudoers.d/x11_display
owner=root group=root mode=0440
-
name
:
local_dev | login share X11 auth to app users
template
:
src=share_x11.j2 dest={{ localdev_home }}/share_x11
owner={{ localdev_user }} mode=0700
-
name
:
local_dev | update bashrc with X11 share script
lineinfile
:
dest={{ localdev_home }}/.bashrc
regexp=". {{ localdev_home }}/share_x11"
line=". {{ localdev_home }}/share_x11"
state=present
playbooks/roles/local_dev/templates/app_bashrc.j2
0 → 100644
View file @
28a7f975
#! /usr/bin/env bash
# {{ ansible_managed }}
source
"{{ item.home }}/{{ item.env }}"
# If X11 forwarding is enabled, then use the DISPLAY value
# already set and use the X11 session cookie
if
[
-n
"
$DISPLAY
"
]
;
then
export
XAUTHORITY
=
"{{ localdev_xauthority }}"
# Otherwise, configure the display to use the virtual frame buffer
else
export
DISPLAY
=
"{{ localdev_xvfb_display }}"
fi
cd
"{{ item.home }}/{{ item.repo }}"
playbooks/roles/local_dev/templates/edxapp_bashrc.j2
deleted
100644 → 0
View file @
2261e372
#! /usr/bin/env bash
# {{ ansible_managed }}
source
"{{ edxapp_app_dir }}/edxapp_env"
export
DISPLAY
=
"{{ browser_xvfb_display }}"
cd
$HOME
/edx-platform
playbooks/roles/local_dev/templates/forum_bashrc.j2
deleted
100644 → 0
View file @
2261e372
#! /usr/bin/env bash
# {{ ansible_managed }}
source
"{{ forum_app_dir }}/forum_env"
export
DISPLAY
=
"{{ browser_xvfb_display }}"
cd
$HOME
/cs_comments_service
playbooks/roles/local_dev/templates/ora_bashrc.j2
deleted
100644 → 0
View file @
2261e372
#! /usr/bin/env bash
# {{ ansible_managed }}
source
"{{ ora_app_dir }}/ora_env"
cd
{{
ora_code_dir
}}
playbooks/roles/local_dev/templates/share_x11.j2
0 → 100644
View file @
28a7f975
#!/usr/bin/env bash
# Change permissions on the X11 session cookie
# so application users can use the same X11 session.
# This is very insecure and should *only* be used for local VMs.
if
[
-f
{{
localdev_xauthority
}}
]
;
then
chmod og+r
{{
localdev_xauthority
}}
fi
vagrant/base/devstack/Vagrantfile
View file @
28a7f975
...
...
@@ -16,7 +16,7 @@ end
Vagrant
.
configure
(
"2"
)
do
|
config
|
# Creates a devstack from a base Ubuntu 12.04 image
# Creates a devstack from a base Ubuntu 12.04 image
config
.
vm
.
box
=
"precise64"
config
.
vm
.
box_url
=
"http://files.vagrantup.com/precise64.box"
...
...
@@ -31,6 +31,11 @@ Vagrant.configure("2") do |config|
config
.
hostsupdater
.
aliases
=
[
"preview.localhost"
]
# Enable X11 forwarding so we can interact with GUI applications
if
ENV
[
'VAGRANT_X11'
]
config
.
ssh
.
forward_x11
=
true
end
config
.
vm
.
provider
:virtualbox
do
|
vb
|
vb
.
customize
[
"modifyvm"
,
:id
,
"--memory"
,
MEMORY
.
to_s
]
vb
.
customize
[
"modifyvm"
,
:id
,
"--cpus"
,
CPU_COUNT
.
to_s
]
...
...
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