2013-02-26 21:04:20 +01:00
|
|
|
- name: add infra repo
|
|
|
|
action: get_url url=http://infrastructure.fedoraproject.org/el/infrastructure.repo dest=/etc/yum.repos.d/
|
2014-03-04 19:47:58 +01:00
|
|
|
when: is_rhel is defined
|
2013-05-21 22:15:34 +02:00
|
|
|
tags:
|
|
|
|
- config
|
2013-04-23 02:21:32 +02:00
|
|
|
|
2013-02-26 21:04:20 +01:00
|
|
|
- name: install cloud-utils
|
|
|
|
action: yum name=cloud-utils state=present
|
2013-05-21 22:15:34 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2013-02-26 21:04:20 +01:00
|
|
|
|
|
|
|
- name: growpart the second partition (/) to full size
|
2014-01-22 22:50:52 +01:00
|
|
|
command: growpart /dev/vda 2
|
2013-02-26 21:04:20 +01:00
|
|
|
register: growpart
|
2014-01-01 21:41:26 +01:00
|
|
|
always_run: true
|
2014-01-07 20:54:00 +01:00
|
|
|
changed_when: "growpart.rc != 1"
|
2014-01-22 22:51:53 +01:00
|
|
|
failed_when: growpart.rc == 2
|
2013-02-26 21:04:20 +01:00
|
|
|
|
|
|
|
- name: reboot the box
|
2014-01-22 22:50:52 +01:00
|
|
|
command: /sbin/reboot
|
2014-01-01 20:39:48 +01:00
|
|
|
when: growpart.rc == 0
|
2013-03-04 23:11:51 +01:00
|
|
|
ignore_errors: true
|
2013-02-26 21:04:20 +01:00
|
|
|
|
|
|
|
- name: wait for it to come back (should be quick)
|
2014-01-01 20:15:11 +01:00
|
|
|
local_action: wait_for host={{ inventory_hostname }} port=22 delay=10 timeout=120
|
2014-01-01 20:39:48 +01:00
|
|
|
when: growpart.rc == 0
|
2013-02-26 21:04:20 +01:00
|
|
|
|
|
|
|
- name: resize the /dev/vda 2 fs
|
2014-01-22 22:50:52 +01:00
|
|
|
command: resize2fs /dev/vda2
|
2014-01-01 20:39:48 +01:00
|
|
|
when: growpart.rc == 0
|