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
|
2014-01-01 19:15:11 +00:00
|
|
|
- "{{ private }}/vars.yml"
|
2013-04-26 21:48:18 +00:00
|
|
|
vars:
|
2013-08-02 22:56:46 +00:00
|
|
|
- keypair: fedora-admin-20130801
|
2014-01-01 19:15:11 +00:00
|
|
|
- image: "{{ f19_qcow_id }}"
|
2013-04-26 21:48:18 +00:00
|
|
|
- instance_type: m1.small
|
|
|
|
- security_group: default
|
|
|
|
|
|
|
|
tasks:
|
2014-01-01 19:15:11 +00:00
|
|
|
- include: "{{ tasks }}/transient_cloud.yml"
|
2013-04-26 21:48:18 +00:00
|
|
|
|
|
|
|
- name: provision instance
|
|
|
|
hosts: tmp_just_created
|
2014-02-24 21:50:49 +00:00
|
|
|
user: fedora
|
2013-04-26 21:48:18 +00:00
|
|
|
gather_facts: True
|
2014-02-24 21:50:49 +00:00
|
|
|
sudo: yes
|
2013-04-26 21:48:18 +00:00
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- /srv/web/infra/ansible/vars/global.yml
|
2014-01-01 19:15:11 +00:00
|
|
|
- "{{ private }}/vars.yml"
|
2014-01-06 18:22:18 +00:00
|
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
2013-04-26 21:48:18 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
register: growpart
|
2014-01-22 21:53:50 +00:00
|
|
|
always_run: true
|
2014-01-07 19:54:00 +00:00
|
|
|
changed_when: "growpart.rc != 1"
|
2014-01-22 21:53:50 +00:00
|
|
|
failed_when: growpart.rc == 2
|
2013-04-26 21:48:18 +00:00
|
|
|
|
|
|
|
- name: resize the /dev/vda 1 fs
|
|
|
|
action: command resize2fs /dev/vda1
|
2014-01-01 19:39:48 +00:00
|
|
|
when: growpart.rc == 0
|
2013-04-26 21:48:18 +00:00
|
|
|
|
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
|
2014-01-01 19:39:48 +00:00
|
|
|
when: growpart.rc == 0
|
2013-04-26 21:53:32 +00:00
|
|
|
|
|
|
|
|
2014-01-01 19:15:11 +00:00
|
|
|
- include: "{{ tasks }}/cloud_setup_basic.yml"
|
2013-04-26 21:48:18 +00:00
|
|
|
|
|
|
|
handlers:
|
2014-01-01 19:15:11 +00:00
|
|
|
- include: "{{ handlers }}/restart_services.yml"
|