Unverified Commit 009b5ad0 by Feanil Patel Committed by GitHub

Merge pull request #4160 from edx/feanil/jenkins_workers_mongo_update

Feanil/jenkins workers mongo update
parents ab7a7bb8 82e7890c
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
- mysql - mysql
- edxlocal - edxlocal
- memcache - memcache
- mongo - mongo_3_2
- browsers - browsers
- browsermob-proxy - browsermob-proxy
- jenkins_worker - jenkins_worker
...@@ -15,3 +15,5 @@ jenkins_debian_pkgs: ...@@ -15,3 +15,5 @@ jenkins_debian_pkgs:
# packer direct download URL # packer direct download URL
packer_url: "https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip" packer_url: "https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip"
jenkins_worker_key_url: null
...@@ -16,8 +16,12 @@ ...@@ -16,8 +16,12 @@
owner={{ jenkins_user }} group={{ jenkins_group }} owner={{ jenkins_user }} group={{ jenkins_group }}
ignore_errors: yes ignore_errors: yes
- name: Copy ssh keys for jenkins - name: Get the authorized key that should be used for this machine.
command: cp /home/ubuntu/.ssh/authorized_keys /home/{{ jenkins_user }}/.ssh/authorized_keys authorized_key:
user: "{{ jenkins_user }}"
state: present
key: "{{ jenkins_worker_key_url }}"
when: jenkins_worker_key_url
ignore_errors: yes ignore_errors: yes
- name: Set key permissions - name: Set key permissions
......
...@@ -26,6 +26,9 @@ mongodb_debian_pkgs: ...@@ -26,6 +26,9 @@ mongodb_debian_pkgs:
- "mongodb-org-tools={{ mongo_version }}" - "mongodb-org-tools={{ mongo_version }}"
mongo_configure_replica_set: true
# Vars Meant to be overridden # Vars Meant to be overridden
MONGO_ADMIN_USER: 'admin' MONGO_ADMIN_USER: 'admin'
MONGO_ADMIN_PASSWORD: 'password' MONGO_ADMIN_PASSWORD: 'password'
......
...@@ -280,6 +280,7 @@ ...@@ -280,6 +280,7 @@
rs_config: "{{ MONGO_RS_CONFIG }}" rs_config: "{{ MONGO_RS_CONFIG }}"
run_once: true run_once: true
register: replset_status register: replset_status
when: mongo_configure_replica_set
tags: tags:
- "manage" - "manage"
- "manage:db" - "manage:db"
...@@ -297,6 +298,7 @@ ...@@ -297,6 +298,7 @@
password: "{{ MONGO_ADMIN_PASSWORD }}" password: "{{ MONGO_ADMIN_PASSWORD }}"
register: status register: status
until: status.status is defined and 'PRIMARY' in status.status.members|map(attribute='stateStr')|list until: status.status is defined and 'PRIMARY' in status.status.members|map(attribute='stateStr')|list
when: mongo_configure_replica_set
retries: 5 retries: 5
delay: 2 delay: 2
run_once: true run_once: true
...@@ -318,6 +320,7 @@ ...@@ -318,6 +320,7 @@
replica_set: "{{ MONGO_REPL_SET }}" replica_set: "{{ MONGO_REPL_SET }}"
with_items: "{{ MONGO_USERS }}" with_items: "{{ MONGO_USERS }}"
run_once: true run_once: true
when: mongo_configure_replica_set
tags: tags:
- "manage" - "manage"
- "manage:db" - "manage:db"
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"test_platform_version": "{{env `TEST_PLATFORM_VERSION`}}", "test_platform_version": "{{env `TEST_PLATFORM_VERSION`}}",
"security_group": "{{env `AWS_SECURITY_GROUP`}}", "security_group": "{{env `AWS_SECURITY_GROUP`}}",
"delete_or_keep": "{{env `DELETE_OR_KEEP_AMI`}}", "delete_or_keep": "{{env `DELETE_OR_KEEP_AMI`}}",
"remote_branch": "{{env `REMOTE_BRANCH`}}" "remote_branch": "{{env `REMOTE_BRANCH`}}",
"jenkins_worker_key_url": "{{env `JENKINS_WORKER_KEY_URL`}}"
}, },
"builders": [{ "builders": [{
"type": "amazon-ebs", "type": "amazon-ebs",
...@@ -25,7 +26,13 @@ ...@@ -25,7 +26,13 @@
"security_group_id": "{{user `security_group`}}", "security_group_id": "{{user `security_group`}}",
"tags": { "tags": {
"delete_or_keep": "{{user `delete_or_keep`}}" "delete_or_keep": "{{user `delete_or_keep`}}"
} },
"launch_block_device_mappings": [{
"delete_on_termination": true,
"device_name": "/dev/sda1",
"volume_size": "40",
"volume_type": "gp2"
}]
}], }],
"provisioners": [{ "provisioners": [{
"type": "shell", "type": "shell",
...@@ -52,7 +59,7 @@ ...@@ -52,7 +59,7 @@
"command": ". {{user `venv_dir`}}/bin/activate && ansible-playbook", "command": ". {{user `venv_dir`}}/bin/activate && ansible-playbook",
"inventory_groups": "jenkins_worker", "inventory_groups": "jenkins_worker",
"extra_arguments": [ "extra_arguments": [
"-e \"jenkins_edx_platform_version={{user `test_platform_version`}} NEWRELIC_LICENSE_KEY={{user `new_relic_key`}}\"", "-e \"jenkins_edx_platform_version={{user `test_platform_version`}} NEWRELIC_LICENSE_KEY={{user `new_relic_key`}} initialize_replica_set=false mongo_configure_replica_set=false jenkins_worker_key_url='{{user `jenkins_worker_key_url`}}'\"",
"-vvv" "-vvv"
] ]
}, { }, {
......
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