Commit 90ae7874 by Jesse Zoldak

Define jenkins flyweight worker for running flow jobs

parent 05a46e7b
# Configure a Jenkins flyweight worker instance
# This does not need to run platform tests, it will
# run only flyweight (e.g. flow) jobs.
- name: Configure instance(s)
hosts: jenkins_worker
become: True
gather_facts: True
vars:
serial_count: 1
COMMON_SECURITY_UPDATES: yes
SECURITY_UPGRADE_ON_ANSIBLE: true
serial: "{{ serial_count }}"
roles:
- aws
- jenkins_worker
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"new_relic_key": "{{env `NEW_RELIC_KEY`}}",
"playbook_remote_dir": "/tmp/packer-edx-playbooks",
"venv_dir": "/edx/app/edx_ansible/venvs/edx_ansible",
"ami": "{{env `JENKINS_WORKER_AMI`}}",
"security_group": "{{env `AWS_SECURITY_GROUP`}}",
"delete_or_keep": "{{env `DELETE_OR_KEEP_AMI`}}",
"remote_branch": "{{env `REMOTE_BRANCH`}}",
"jenkins_worker_key_url": "{{env `JENKINS_WORKER_KEY_URL`}}"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"ami_name": "jenkins_worker-{{isotime | clean_ami_name}}",
"instance_type": "m3.large",
"region": "us-east-1",
"source_ami": "{{user `ami`}}",
"ssh_username": "ubuntu",
"ami_description": "jenkins worker flyweight",
"iam_instance_profile": "jenkins-worker",
"security_group_id": "{{user `security_group`}}",
"tags": {
"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": [{
"type": "shell",
"inline": ["rm -rf {{user `playbook_remote_dir`}}",
"mkdir {{user `playbook_remote_dir`}}"]
}, {
"type": "file",
"source": "stop-automatic-updates.sh",
"destination": "{{user `playbook_remote_dir`}}/stop-automatic-updates.sh"
}, {
"type": "file",
"source": "../../util/install/ansible-bootstrap.sh",
"destination": "{{user `playbook_remote_dir`}}/ansible-bootstrap.sh"
}, {
"type": "shell",
"inline": ["cd {{user `playbook_remote_dir`}}",
"export CONFIGURATION_VERSION='{{user `remote_branch`}}'",
"sudo bash ./stop-automatic-updates.sh",
"sudo bash ./ansible-bootstrap.sh" ]
}, {
"type": "ansible-local",
"playbook_file": "../../playbooks/edx-east/jenkins_worker_flyweight.yml",
"playbook_dir": "../../playbooks",
"command": ". {{user `venv_dir`}}/bin/activate && ansible-playbook",
"inventory_groups": "jenkins_worker",
"extra_arguments": [
"-e \"NEWRELIC_LICENSE_KEY={{user `new_relic_key`}} jenkins_worker_key_url='{{user `jenkins_worker_key_url`}}'\"",
"-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