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
17be6b20
Commit
17be6b20
authored
Feb 17, 2015
by
Max Rothman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1847 from edx/max/refactor-minos
refactor minos to use new edx_service role
parents
63565290
b7c9e1b1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
52 deletions
+26
-52
playbooks/roles/edx_service/tasks/main.yml
+6
-5
playbooks/roles/minos/defaults/main.yml
+12
-8
playbooks/roles/minos/handlers/main.yml
+0
-18
playbooks/roles/minos/meta/main.yml
+5
-3
playbooks/roles/minos/tasks/main.yml
+2
-11
playbooks/roles/minos/templates/edx/etc/minos/minos.yml.j2
+0
-6
playbooks/roles/minos/templates/tmp/git-identity.sh.j2
+1
-1
No files found.
playbooks/roles/edx_service/tasks/main.yml
View file @
17be6b20
...
...
@@ -110,10 +110,11 @@
-
name
:
set git fetch.prune to ignore deleted remote refs
shell
:
git config --global fetch.prune
true
sudo_user
:
"
{{
edx_service_user
}}"
when
:
edx_service_repos is defined
-
name
:
validate git protocol
fail
:
msg='REPOS.PROTOCOL must be "https" or "ssh"'
when
:
(item.PROTOCOL != "https") and (item.PROTOCOL != "ssh")
when
:
(item.PROTOCOL != "https") and (item.PROTOCOL != "ssh")
and edx_service_repos is defined
with_items
:
edx_service_repos
-
name
:
install read-only ssh key
...
...
@@ -121,7 +122,7 @@
dest="{{ edx_service_home }}/.ssh/{{ item.REPO }}"
content="{{ item.SSH_KEY }}" owner={{ edx_service_user }}
group={{ edx_service_user }} mode=0600
when
:
item.PROTOCOL == "ssh"
when
:
item.PROTOCOL == "ssh"
and edx_service_repos is defined
with_items
:
edx_service_repos
-
name
:
checkout code over ssh
...
...
@@ -131,7 +132,7 @@
accept_hostkey=yes key_file={{ edx_service_home }}/.ssh/{{ item.REPO }}
sudo_user
:
"
{{
edx_service_user
}}"
register
:
code_checkout
when
:
item.PROTOCOL == "ssh"
when
:
item.PROTOCOL == "ssh"
and edx_service_repos is defined
with_items
:
edx_service_repos
-
name
:
checkout code over https
...
...
@@ -140,7 +141,7 @@
dest={{ item.DESTINATION }} version={{ item.VERSION }}
sudo_user
:
"
{{
edx_service_user
}}"
register
:
code_checkout
when
:
item.PROTOCOL == "https"
when
:
item.PROTOCOL == "https"
and edx_service_repos is defined
with_items
:
edx_service_repos
...
...
@@ -153,7 +154,7 @@
args
:
tags
:
"
version:{{edx_service_name}}"
:
"
{{
item.0.DOMAIN
}}/{{
item.0.PATH
}}/{{
item.0.REPO
}}
{{
item.1.after
|truncate(7,True,'')
}}"
when
:
item.1.after is defined and ansible_ec2_instance_id is defined
when
:
item.1.after is defined and ansible_ec2_instance_id is defined
and edx_service_repos is defined
with_together
:
-
edx_service_repos
-
code_checkout.results
...
...
playbooks/roles/minos/defaults/main.yml
View file @
17be6b20
...
...
@@ -12,17 +12,21 @@
#
MINOS_GIT_IDENTITY
:
!!null
MINOS_SERVICE_CONFIG
:
aws_profile
:
!!null
s3_bucket
:
edx-{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}
bucket_path
:
lifecycle/minos
voter_conf_d
:
"
{{
minos_voter_cfg
}}"
#
# vars are namespace with the module name.
#
minos_role_name
:
minos
minos_service_name
:
"
{{
minos_role_name
}}"
minos_data_dir
:
"
{{
COMMON_DATA_DIR
}}/minos"
minos_app_dir
:
"
{{
COMMON_APP_DIR
}}/minos"
minos_venv_dir
:
"
{{
minos_app_dir
}}/venvs/"
minos_log_dir
:
"
{{
COMMON_LOG_DIR
}}/minos"
minos_cfg_file
:
"
{{
COMMON_CFG_DIR
}}/minos/minos.yml"
minos_voter_cfg
:
"
{{
COMMON_CFG_DIR
}}/minos/conf.d/"
minos_service_name
:
minos
minos_data_dir
:
"
{{
COMMON_DATA_DIR
}}/{{
minos_service_name
}}"
minos_app_dir
:
"
{{
COMMON_APP_DIR
}}/{{
minos_service_name
}}"
minos_log_dir
:
"
{{
COMMON_LOG_DIR
}}/{{
minos_service_name
}}"
minos_cfg_file
:
"
{{
COMMON_CFG_DIR
}}/{{
minos_service_name
}}/minos.yml"
minos_voter_cfg
:
"
{{
COMMON_CFG_DIR
}}/{{
minos_service_name
}}/conf.d/"
minos_git_ssh
:
"
/tmp/git.sh"
minos_git_identity
:
"
{{
minos_app_dir
}}/minos-git-identity"
minos_edx_server_tools_repo
:
"
git@github.com/edx-ops/edx-minos.git"
...
...
playbooks/roles/minos/handlers/main.yml
deleted
100644 → 0
View file @
63565290
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Handlers for role minos
#
# Overview:
#
#
-
name
:
notify me
debug
:
msg="stub handler"
playbooks/roles/minos/meta/main.yml
View file @
17be6b20
...
...
@@ -20,5 +20,7 @@
# }
dependencies
:
-
role
:
edx_service
edx_role_name
:
"
{{
minos_role_name
}}"
edx_service_name
:
"
{{
minos_service_name
}}"
\ No newline at end of file
edx_service_name
:
"
{{
minos_service_name
}}"
edx_service_config
:
"
{{
MINOS_SERVICE_CONFIG
}}"
edx_service_user
:
root
edx_service_home
:
"
{{
minos_app_dir
}}"
\ No newline at end of file
playbooks/roles/minos/tasks/main.yml
View file @
17be6b20
...
...
@@ -34,9 +34,6 @@
# - minos
#
-
name
:
gather ec2 facts
action
:
ec2_facts
-
name
:
create minos config directory
file
:
>
path={{ minos_voter_cfg }}
...
...
@@ -44,12 +41,6 @@
owner=root
group=root
mode=0755
-
name
:
create minos config
template
:
>
dest={{ minos_cfg_file }}
src=edx/etc/minos/minos.yml.j2
mode=0755 owner=root group=root
-
name
:
create minos voters configs
template
:
>
...
...
@@ -81,13 +72,13 @@
-
name
:
install read-only ssh key
copy
:
>
content="{{
COMMON
_GIT_IDENTITY }}" dest="{{ minos_git_identity }}"
content="{{
MINOS
_GIT_IDENTITY }}" dest="{{ minos_git_identity }}"
force=yes mode=0600
-
name
:
install python custom-requirements
pip
:
>
name="{{ item }}"
virtualenv="{{ minos_
venv_dir }}
"
virtualenv="{{ minos_
app_dir }}/venvs/
"
state=present
extra_args="--exists-action w"
environment
:
...
...
playbooks/roles/minos/templates/edx/etc/minos/minos.yml.j2
deleted
100644 → 0
View file @
63565290
---
aws_profile: !!null
s3_bucket: 'edx-{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}'
bucket_path: 'lifecycle/minos'
voter_conf_d: '{{ minos_voter_cfg }}'
playbooks/roles/minos/templates/tmp/git-identity.sh.j2
View file @
17be6b20
#!/bin/sh
exec
/usr/bin/ssh
-o
StrictHostKeyChecking
=
no
{
%
if
COMMON
_GIT_IDENTITY %
}
-i
{{
minos_git_identity
}}{
% endif %
}
"
$@
"
exec
/usr/bin/ssh
-o
StrictHostKeyChecking
=
no
{
%
if
MINOS
_GIT_IDENTITY %
}
-i
{{
minos_git_identity
}}{
% endif %
}
"
$@
"
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