ansible/tasks/growroot_cloud.yml

32 lines
823 B
YAML
Raw Normal View History

2016-08-08 19:36:31 +00:00
- name: add infra repo
get_url: url=http://infrastructure.fedoraproject.org/el/infrastructure.repo dest=/etc/yum.repos.d/
2014-03-04 18:47:58 +00:00
when: is_rhel is defined
2013-05-21 20:15:34 +00:00
tags:
- config
- name: install cloud-utils
package: name=cloud-utils state=present
2013-05-21 20:15:34 +00:00
tags:
- packages
- name: growpart the second partition (/) to full size
command: growpart /dev/vda 2
register: growpart
check_mode: no
changed_when: "growpart.rc != 1"
#failed_when: growpart.rc == 2
ignore_errors: true
2016-08-08 19:36:31 +00:00
- name: reboot the box
command: /sbin/reboot
when: growpart.rc == 0
ignore_errors: true
- name: wait for it to come back (should be quick)
local_action: wait_for host={{ inventory_hostname }} port=22 delay=10 timeout=120
when: growpart.rc == 0
- name: resize the /dev/vda 2 fs
command: resize2fs /dev/vda2
when: growpart.rc == 0