From 2121eb8a306505979165573551bba748f618d7af Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 25 Jun 2014 20:21:37 +0000 Subject: [PATCH] el7 cloud --- playbooks/el7_temp_instance.yml | 52 +++++++++++++++++++++++++++++++++ vars/global.yml | 2 ++ 2 files changed, 54 insertions(+) create mode 100644 playbooks/el7_temp_instance.yml diff --git a/playbooks/el7_temp_instance.yml b/playbooks/el7_temp_instance.yml new file mode 100644 index 0000000000..1b510275a0 --- /dev/null +++ b/playbooks/el7_temp_instance.yml @@ -0,0 +1,52 @@ +# 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-20130801 + - image: "{{ el7_qcow_id }}" + - instance_type: m1.small + - security_group: default + + tasks: + - include: "{{ tasks }}/transient_cloud.yml" + +- name: provision instance + hosts: tmp_just_created + user: fedora + gather_facts: True + sudo: yes + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "{{ private }}/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + tasks: + - name: growpart /dev/vda1 partition (/) to full size + action: command growpart /dev/vda 1 + register: growpart + always_run: true + changed_when: "growpart.rc != 1" + failed_when: growpart.rc == 2 + + - name: resize the /dev/vda 1 fs + action: command resize2fs /dev/vda1 + when: growpart.rc == 0 + + - name: put the mbr back - b/c the resize breaks booting otherwise + action: shell cat /usr/share/syslinux/mbr.bin > /dev/vda + when: growpart.rc == 0 + + + - include: "{{ tasks }}/cloud_setup_basic.yml" + + handlers: + - include: "{{ handlers }}/restart_services.yml" diff --git a/vars/global.yml b/vars/global.yml index d1fb1f4466..96715d2198 100644 --- a/vars/global.yml +++ b/vars/global.yml @@ -20,6 +20,8 @@ f19_qcow_id: ami-00000020 f20_qcow_id: ami-00000042 # RHEL7beta el7b_qcow_id: ami-0000003f +# RHEL7 +el7_qcow_id: ami-0000004b # Set a default hostname base to transient. Override in host vars or command line. hostbase: transient