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
94699a64
Commit
94699a64
authored
Nov 05, 2014
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
harprofiler ami creation via packer.
TE-583
parent
49b3882e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
0 deletions
+62
-0
playbooks/roles/harprofiler/defaults/main.yml
+1
-0
playbooks/roles/harprofiler/tasks/main.yml
+14
-0
playbooks/roles/harprofiler/templates/validate_harprofiler_install.sh.j2
+9
-0
util/packer/harprofiler.json
+38
-0
No files found.
playbooks/roles/harprofiler/defaults/main.yml
View file @
94699a64
...
...
@@ -11,3 +11,4 @@ harprofiler_github_url: https://github.com/edx/harprofiler
harprofiler_version
:
master
harprofiler_dir
:
/edx/app/harprofiler
harprofiler_venv_dir
:
"
{{
harprofiler_dir
}}/venvs/harprofiler"
harprofiler_validation_script
:
validate_harprofiler_install.sh
playbooks/roles/harprofiler/tasks/main.yml
View file @
94699a64
...
...
@@ -38,3 +38,17 @@
regexp="browsermob_dir"
line="browsermob_dir: /usr/local"
state=present
-
name
:
create validation shell script
template
:
owner
:
"
{{
harprofiler_user
}}"
src
:
validate_harprofiler_install.sh.j2
dest
:
"
{{
harprofiler_dir
}}/{{
harprofiler_validation_script
}}"
mode
:
0755
sudo_user
:
"
{{
harprofiler_user
}}"
-
name
:
test install
shell
:
>
./{{ harprofiler_validation_script }} chdir={{ harprofiler_dir }}
sudo_user
:
"
{{
harprofiler_user
}}"
playbooks/roles/harprofiler/templates/validate_harprofiler_install.sh.j2
0 → 100644
View file @
94699a64
#!/usr/bin/env bash
# This script confirms that harprofiler can successfully run on the
# target machine.
source
{{
harprofiler_venv_dir
}}
/bin/activate
cd
{{
harprofiler_dir
}}
python harprofiler.py
util/packer/harprofiler.json
0 → 100644
View file @
94699a64
{
"variables"
:
{
"aws_access_key"
:
"{{env `AWS_ACCESS_KEY_ID`}}"
,
"aws_secret_key"
:
"{{env `AWS_SECRET_ACCESS_KEY`}}"
,
"playbook_remote_dir"
:
"/tmp/packer-edx-playbooks"
,
"ami"
:
"{{env `HARPROFILER_BASE_AMI`}}"
},
"builders"
:
[{
"type"
:
"amazon-ebs"
,
"access_key"
:
"{{user `aws_access_key`}}"
,
"secret_key"
:
"{{user `aws_secret_key`}}"
,
"region"
:
"us-east-1"
,
"source_ami"
:
"{{user `ami`}}"
,
"instance_type"
:
"m1.small"
,
"ssh_username"
:
"ubuntu"
,
"ami_name"
:
"harprofiler-{{isotime | clean_ami_name}}"
}],
"provisioners"
:
[{
"type"
:
"shell"
,
"inline"
:
[
"rm -rf {{user `playbook_remote_dir`}}"
]
},
{
"type"
:
"file"
,
"source"
:
"../../playbooks"
,
"destination"
:
"{{user `playbook_remote_dir`}}"
},
{
"type"
:
"file"
,
"source"
:
"../../requirements.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/requirements.txt"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cd {{user `playbook_remote_dir`}}"
,
"virtualenv packer-venv"
,
". packer-venv/bin/activate"
,
"pip install -q -r requirements.txt"
,
"echo 'localhost' > inventory.ini"
,
"ansible-playbook run_role.yml -i inventory.ini -c local -e role=harprofiler -vvvv"
]
}]
}
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