Created
February 22, 2016 07:20
-
-
Save feiskyer/474bf956f0283114e342 to your computer and use it in GitHub Desktop.
Update hyper and hyperstart by source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```yaml | |
| - hosts: k8s | |
| remote_user: root | |
| tasks: | |
| - name: install devel tools | |
| shell: yum -y install git cmake gcc g++ autoconf automake device-mapper-devel sqlite-devel pcre-devel libsepol-devel libselinux-devel systemd-container-devel automake autoconf gcc make glibc-devel glibc-devel.i686 | |
| - name: create dir | |
| file: path=/root/src/github.com/hyperhq owner=root group=root mode=755 state=directory | |
| - name: check dir | |
| stat: path=/root/src/github.com/hyperhq/hyper | |
| register: hyper_dir | |
| - name: remove old dir | |
| shell: /bin/rm -rf /root/src/github.com/hyperhq/hyper | |
| when: hyper_dir.stat.isdir is defined and hyper_dir.stat.isdir | |
| - name: check runv dir | |
| stat: path=/root/src/github.com/hyperhq/runv | |
| register: runv_dir | |
| - name: remove old runv dir | |
| shell: /bin/rm -rf /root/src/github.com/hyperhq/runv | |
| when: runv_dir.stat.isdir is defined and runv_dir.stat.isdir | |
| - name: checkout hyper branch | |
| shell: chdir=/root/src/github.com/hyperhq/ git clone https://github.com/feiskyer/hyper.git -b {{branch}} | |
| when: branch is defined | |
| - name: checkout hyper master | |
| shell: chdir=/root/src/github.com/hyperhq/ git clone https://github.com/feiskyer/hyper.git | |
| when: branch is not defined | |
| - name: checkout runv master | |
| shell: chdir=/root/src/github.com/hyperhq/ git clone https://github.com/feiskyer/runv.git | |
| - name: build and install hyper | |
| shell: chdir=/root/src/github.com/hyperhq/hyper ./autogen.sh && ./configure && make && make install | |
| - name: build qboot | |
| shell: chdir=/tmp git clone https://github.com/bonzini/qboot.git && cd qboot && make && /bin/cp bios.bin /var/lib/hyper/bios-qboot.bin && /bin/rm -rf /tmp/qboot | |
| - name: install cbfstool | |
| shell: chdir=/tmp curl -sSL https://www.coreboot.org/releases/coreboot-4.2.tar.xz | tar --xz -xvf - && cd coreboot-4.2/util/cbfstool && make && /bin/cp cbfstool /usr/local/bin/ && /bin/rm -rf /tmp/coreboot-4.2 | |
| - name: install hyperstart | |
| shell: chdir=/tmp git clone https://github.com/hyperhq/hyperstart.git && cd hyperstart && ./autogen.sh && ./configure && make && make cbfs && /bin/cp build/{hyper-initrd.img,kernel} /var/lib/hyper/ && /bin/cp build/cbfs.rom /var/lib/hyper/cbfs-qboot.rom && /bin/rm -rf /tmp/hyperstart | |
| - service: name=hyperd state=restarted | |
| - name: get hyperd status | |
| shell: systemctl status hyperd | |
| register: hyperd | |
| - debug: var=hyperd | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment