2013-04-26 21:48:18 +00:00
|
|
|
# setup a transient fedora instance
|
|
|
|
# optionally can take --extra-vars="hostbase=hostnamebase root_auth_users='user1 user2 user3'"
|
|
|
|
|
|
|
|
- name: check/create instance
|
|
|
|
hosts: lockbox01.phx2.fedoraproject.org
|
|
|
|
user: root
|
|
|
|
gather_facts: False
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
|
|
- ${private}/vars.yml
|
|
|
|
vars:
|
|
|
|
- keypair: fedora-admin
|
|
|
|
- image: $f19_qcow_id
|
|
|
|
- instance_type: m1.small
|
|
|
|
- security_group: default
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- include: $tasks/transient_cloud.yml
|
|
|
|
|
|
|
|
- name: provision instance
|
|
|
|
hosts: tmp_just_created
|
|
|
|
user: root
|
|
|
|
gather_facts: True
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
|
|
- ${private}/vars.yml
|
|
|
|
- ${vars}/${ansible_distribution}.yml
|
|
|
|
|
|
|
|
tasks:
|
2013-04-26 21:57:20 +00:00
|
|
|
- name: growpart /dev/vda1 partition (/) to full size
|
2013-04-26 21:48:18 +00:00
|
|
|
action: command growpart /dev/vda 1
|
|
|
|
ignore_errors: true
|
|
|
|
register: growpart
|
|
|
|
|
|
|
|
- name: resize the /dev/vda 1 fs
|
|
|
|
action: command resize2fs /dev/vda1
|
|
|
|
when_integer: ${growpart.rc} == 0
|
|
|
|
|
2013-04-26 21:57:20 +00:00
|
|
|
- name: put the mbr back - b/c the resize breaks booting otherwise
|
2013-04-26 21:53:32 +00:00
|
|
|
action: shell cat /usr/share/syslinux/mbr.bin > /dev/vda
|
|
|
|
when_integer: ${growpart.rc} == 0
|
|
|
|
|
|
|
|
|
2013-04-26 21:48:18 +00:00
|
|
|
- include: $tasks/cloud_setup_basic.yml
|
|
|
|
|
|
|
|
handlers:
|
|
|
|
- include: $handlers/restart_services.yml
|