Commit 93323888 by John Jarvis

creating arg for configuration-secure and adding role path

parent 4f51c912
../ansible.cfg
\ No newline at end of file
# config file for ansible -- http://ansible.github.com
# nearly all parameters can be overridden in ansible-playbook or with command line flags
# ansible will read ~/.ansible.cfg or /etc/ansible/ansible.cfg, whichever it finds first
[defaults]
jinja2_extensions=jinja2.ext.do
hash_behaviour=merge
host_key_checking=False
roles_path=../../../ansible-roles
......@@ -61,7 +61,7 @@ class MongoConnection:
}
try:
self.mongo_ami.insert(query)
except DuplicateKeyError as e:
except DuplicateKeyError:
if not args.noop:
print "Entry already exists for {}".format(ami)
raise
......@@ -71,11 +71,11 @@ class MongoConnection:
Adds the built AMI to the deployment
collection
"""
query = { '_id': args.jenkins_build }
query = {'_id': args.jenkins_build}
deployment = self.mongo_deployment.find_one(query)
try:
deployment['plays'][args.play]['amis'][args.environment] = ami
except KeyError as e:
except KeyError:
msg = "Unexpected document structure, couldn't write " +\
"to path deployment['plays']['{}']['amis']['{}']"
print msg.format(args.play, args.environment)
......@@ -95,6 +95,7 @@ class MongoConnection:
self.mongo_deployment.save(deployment)
class Unbuffered:
"""
For unbuffered output, not
......@@ -121,8 +122,8 @@ def parse_args():
parser.add_argument('--secure-vars', required=False,
metavar="SECURE_VAR_FILE",
help="path to secure-vars from the root of "
"configuration-secure, defaults to ansible/"
"vars/DEPLOYMENT/ENVIRONMENT-DEPLOYMENT.yml")
"the secure repo (defaults to ansible/"
"vars/DEPLOYMENT/ENVIRONMENT-DEPLOYMENT.yml)")
parser.add_argument('--stack-name',
help="defaults to ENVIRONMENT-DEPLOYMENT",
metavar="STACK_NAME",
......@@ -149,6 +150,9 @@ def parse_args():
parser.add_argument('--configuration-secure-version', required=False,
help="configuration-secure repo branch(no hashes)",
default="master")
parser.add_argument('--configuration-secure-repo', required=False,
default="git@github.com:edx-ops/prod-secure",
help="repo to use for the secure files")
parser.add_argument('-j', '--jenkins-build', required=False,
help="jenkins build number to update")
parser.add_argument('-b', '--base-ami', required=False,
......@@ -271,9 +275,8 @@ instance_type=\\
$(curl http://169.254.169.254/latest/meta-data/instance-type 2>/dev/null)
playbook_dir="$base_dir/configuration/playbooks/edx-east"
git_repo_name="configuration"
git_repo_secure_name="configuration-secure"
git_repo="https://github.com/edx/$git_repo_name"
git_repo_secure="git@github.com:edx/$git_repo_secure_name"
git_repo_secure="{configuration_secure_repo}"
if $config_secure; then
git_cmd="env GIT_SSH=$git_ssh git"
......@@ -349,6 +352,7 @@ rm -rf $base_dir
""".format(
configuration_version=args.configuration_version,
configuration_secure_version=args.configuration_secure_version,
configuration_secure_repo=args.configuration_secure_repo,
environment=args.environment,
deployment=args.deployment,
play=args.play,
......@@ -433,7 +437,7 @@ def poll_sqs_ansible():
to_disp['msg']['TS'] % 60,
to_disp['msg']['PREFIX'],
to_disp['msg']['START']),
elif 'TASK' in to_disp['msg']:
print "\n{:0>2.0f}:{:0>5.2f} {} : {}".format(
to_disp['msg']['TS'] / 60,
......@@ -472,7 +476,7 @@ def poll_sqs_ansible():
to_disp['msg']['TS'] / 60,
to_disp['msg']['TS'] % 60,
to_disp['msg']['PREFIX'])
# Since 3 ansible plays get run.
# We see the COMPLETE message 3 times
# wait till the last one to end listening
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment