copr: be-dev: configure aws.aarch64 builders
This commit is contained in:
parent
66f633cd56
commit
e1dc06c346
5 changed files with 83 additions and 38 deletions
|
@ -18,6 +18,7 @@ copr_builder_images:
|
|||
aarch64: copr-builder-20191126_114948
|
||||
aws:
|
||||
x86_64: ami-0e9d83941943de0f2
|
||||
aarch64: ami-05927168596f8f271
|
||||
|
||||
nrpe_procs_warn: 2200
|
||||
nrpe_procs_crit: 2500
|
||||
|
|
|
@ -18,6 +18,7 @@ copr_builder_images:
|
|||
aarch64: copr-builder-20191126_114948
|
||||
aws:
|
||||
x86_64: ami-0e9d83941943de0f2
|
||||
aarch64: ami-05927168596f8f271
|
||||
|
||||
do_sign: "true"
|
||||
|
||||
|
|
42
roles/copr/backend/files/provision/builderpb-aws-aarch64.yml
Normal file
42
roles/copr/backend/files/provision/builderpb-aws-aarch64.yml
Normal file
|
@ -0,0 +1,42 @@
|
|||
- name: create an instance in aws
|
||||
hosts: 127.0.0.1
|
||||
gather_facts: False
|
||||
|
||||
roles:
|
||||
- spawner
|
||||
|
||||
vars_files:
|
||||
- vars.yml
|
||||
- aws_cloud_vars.yml
|
||||
|
||||
vars:
|
||||
keypair: copr-builder
|
||||
instance_type: a1.xlarge
|
||||
security_group: ssh-only
|
||||
max_spawn_time: 1100
|
||||
spawning_vm_user: "fedora"
|
||||
arch: aarch64
|
||||
|
||||
tasks:
|
||||
- include: "spinup_aws_task.yml"
|
||||
|
||||
|
||||
- name: provision builder
|
||||
hosts: builder_temp_group
|
||||
gather_facts: False
|
||||
become: true
|
||||
user: fedora
|
||||
|
||||
vars_files:
|
||||
- vars.yml
|
||||
- aws_cloud_vars.yml
|
||||
|
||||
vars:
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
|
||||
tasks:
|
||||
- include: "create_swap_file.yml"
|
||||
when:
|
||||
- prepare_base_image is defined
|
||||
|
||||
- include: "provision_builder_tasks.yml"
|
|
@ -15,47 +15,10 @@
|
|||
security_group: ssh-only
|
||||
max_spawn_time: 1100
|
||||
spawning_vm_user: "fedora"
|
||||
image_name: "{{ builder_images.x86_64 }}"
|
||||
arch: x86_64
|
||||
|
||||
tasks:
|
||||
- debug: msg="vm_name={{ vm_name }}"
|
||||
|
||||
- name: Launch instance
|
||||
ec2:
|
||||
key_name: "{{ keypair }}"
|
||||
group: "{{ security_group }}"
|
||||
instance_type: "{{ instance_type }}"
|
||||
image: "{{ image_name }}"
|
||||
wait: true
|
||||
region: "{{ aws_region }}"
|
||||
vpc_subnet_id: subnet-01d4e967ab5e78005
|
||||
assign_public_ip: yes
|
||||
instance_tags:
|
||||
FedoraGroup: copr
|
||||
Name: "{{ vm_name }}"
|
||||
arch: "{{ arch }}"
|
||||
aws_access_key: "{{ aws_access_key }}"
|
||||
aws_secret_key: "{{ aws_secret_key }}"
|
||||
register: ec2
|
||||
|
||||
- name: Add new instance to host group
|
||||
add_host:
|
||||
hostname: "{{ item.public_ip }}"
|
||||
groupname: builder_temp_group
|
||||
loop: "{{ ec2.instances }}"
|
||||
|
||||
- set_fact: builder_ip={{ ec2.instances[0].public_ip }}
|
||||
|
||||
- debug: msg="VM_IP={{ builder_ip }}"
|
||||
|
||||
- name: wait for he host to be hot
|
||||
local_action: wait_for host={{ builder_ip }} port=22 delay=1 timeout={{ max_spawn_time }}
|
||||
|
||||
- name: wait until ssh is available
|
||||
local_action: shell false; until [ "$?" -eq "0" ]; do sleep 2; ssh -o PasswordAuthentication=no {{ spawning_vm_user|default('fedora') }}@{{ builder_ip }} 'echo foobar' 2>/dev/null; done
|
||||
async: 600
|
||||
poll: 2
|
||||
- include: "spinup_aws_task.yml"
|
||||
|
||||
|
||||
- name: provision builder
|
||||
|
|
38
roles/copr/backend/files/provision/spinup_aws_task.yml
Normal file
38
roles/copr/backend/files/provision/spinup_aws_task.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
- debug: msg="vm_name={{ vm_name }}"
|
||||
|
||||
- name: Launch instance
|
||||
ec2:
|
||||
key_name: "{{ keypair }}"
|
||||
group: "{{ security_group }}"
|
||||
instance_type: "{{ instance_type }}"
|
||||
image: "{{ builder_images[arch] }}"
|
||||
wait: true
|
||||
region: "{{ aws_region }}"
|
||||
vpc_subnet_id: subnet-01d4e967ab5e78005
|
||||
assign_public_ip: yes
|
||||
instance_tags:
|
||||
FedoraGroup: copr
|
||||
Name: "{{ vm_name }}"
|
||||
arch: "{{ arch }}"
|
||||
aws_access_key: "{{ aws_access_key }}"
|
||||
aws_secret_key: "{{ aws_secret_key }}"
|
||||
volumes: []
|
||||
register: ec2
|
||||
|
||||
- name: Add new instance to host group
|
||||
add_host:
|
||||
hostname: "{{ item.public_ip }}"
|
||||
groupname: builder_temp_group
|
||||
loop: "{{ ec2.instances }}"
|
||||
|
||||
- set_fact: builder_ip={{ ec2.instances[0].public_ip }}
|
||||
|
||||
- debug: msg="VM_IP={{ builder_ip }}"
|
||||
|
||||
- name: wait for he host to be hot
|
||||
local_action: wait_for host={{ builder_ip }} port=22 delay=1 timeout={{ max_spawn_time }}
|
||||
|
||||
- name: wait until ssh is available
|
||||
local_action: shell false; until [ "$?" -eq "0" ]; do sleep 2; ssh -o PasswordAuthentication=no {{ spawning_vm_user|default('fedora') }}@{{ builder_ip }} 'echo foobar' 2>/dev/null; done
|
||||
async: 600
|
||||
poll: 2
|
Loading…
Add table
Add a link
Reference in a new issue