Skip to content

Commit

Permalink
Merge pull request #56 from redhat-nfvpe/hotfix
Browse files Browse the repository at this point in the history
[crio][bugfix] Fix to allow expanding the qcow image
  • Loading branch information
dougbtv authored Sep 19, 2017
2 parents 87d7ab9 + 7ce47b6 commit 20c0bd1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
16 changes: 6 additions & 10 deletions inventory/examples/crio/crio.inventory
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
kube-master ansible_host=master.example.local
kube-minion-1 ansible_host=minion.example.local

kubehost ansible_host=192.168.1.119 ansible_ssh_user=root
kubehost ansible_host=virt-host.example.local ansible_ssh_user=root

[kubehost]
kubehost
Expand All @@ -10,27 +9,24 @@ kubehost
# Using Fedora
centos_genericcloud_url=https://download.fedoraproject.org/pub/fedora/linux/releases/26/CloudImages/x86_64/images/Fedora-Cloud-Base-26-1.5.x86_64.qcow2
image_destination_name=Fedora-Cloud-Base-26-1.5.x86_64.qcow2
increase_root_size_gigs=10

[master]
kube-master

[minions]
kube-minion-1
# kube-minion-2
# kube-minion-3

[all_vms]
kube-master
kube-minion-1
# kube-minion-2
# kube-minion-3

[all_vms:vars]
# Using Fedora
ansible_ssh_user=fedora
ansible_ssh_private_key_file=/home/doug/.ssh/id_testvms
# Using CRI-O (you must set this as an extra var, e.g. `-e "container_runtime=crio"`)
# container_runtime=crio
# Using Fedora
kubectl_home=/home/fedora
kubectl_user=fedora
kubectl_group=fedora
kubectl_group=fedora
# Using CRI-O (you must set this as an extra var, e.g. `-e "container_runtime=crio"`)
# container_runtime=crio
18 changes: 17 additions & 1 deletion roles/virthost-basics/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,26 @@
path: "{{ images_directory }}"
state: directory

- name: Download CentOS cloud image
- name: Download CentOS (or Fedora) cloud image
get_url:
url: "{{ centos_genericcloud_url }}"
dest: "{{ images_directory }}/{{ image_destination_name }}"
register: download_image

- name: Default to not resizing cloud image
set_fact:
resize_image: false

- name: Flag for resizing
set_fact:
resize_image: true
when: increase_root_size_gigs is defined

- name: Increase root disk size (optionally)
shell: >
qemu-img resize {{ images_directory }}/{{ image_destination_name }} +{{ increase_root_size_gigs }}G
when: resize_image and download_image.changed


- name: Generate an ssh key for root
user:
Expand Down

0 comments on commit 20c0bd1

Please sign in to comment.