2016-06-04 17:48:06 +03:00
---
- hosts : all
2016-06-22 19:00:45 +03:00
gather_facts : no
2016-06-04 17:48:06 +03:00
become : yes
tasks :
2016-06-21 19:30:04 +03:00
- name : add CAHC ostree remote
command : >
ostree remote add --set=gpg-verify=false centos-atomic-continuous
https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/ostree/repo/
2016-06-04 17:48:06 +03:00
args :
creates : /etc/ostree/remotes.d/centos-atomic-continuous.conf
2016-06-08 15:46:49 +03:00
# Experimenting with this as a potential new name.
2016-06-21 19:30:04 +03:00
- name : link nxs -> rpm-ostree
2016-06-08 15:46:49 +03:00
file : src=/usr/bin/rpm-ostree dest=/usr/local/bin/nxs owner=0 group=0 state=link
2016-06-22 19:00:45 +03:00
# add a little bit of storage (default is 3G) or docker save complains
- name : resize root
shell : lvresize -L 4G -r /dev/atomicos/root && touch /root/.resized
args :
creates : /root/.resized
2016-06-21 19:30:04 +03:00
- name : check for builder image
command : docker inspect rpm-ostree-builder
2016-06-04 17:48:06 +03:00
failed_when : False
changed_when : False
register : inspect
2016-06-22 19:00:45 +03:00
- name : check for local cache of builder image
local_action : stat path=vagrant/buildimg.tar.gz
register : cache
become : no
- set_fact :
# the image is available on the guest
on_guest : "{{ inspect.rc == 0 | bool }}"
# the image is available on the host
on_host : "{{ cache.stat.isreg is defined and cache.stat.isreg | bool }}"
# sync them up, building if necessary
# XXX: this is just a stopgap, we should also make it easy to update the
# container without having to rebuild it completely
- name : copy cached builder image
copy : src=buildimg.tar.gz dest=/tmp
when : not on_guest and on_host
- name : import cached builder image
shell : gunzip -c /tmp/buildimg.tar.gz | docker load
when : not on_guest and on_host
2016-06-21 19:30:04 +03:00
- name : build builder image
2016-06-04 17:48:06 +03:00
command : make buildimg
args :
2016-06-21 19:30:04 +03:00
chdir : sync/vagrant
2016-06-22 19:00:45 +03:00
when : not on_guest and not on_host
- name : export builder image
shell : docker save rpm-ostree-builder | gzip -c > /tmp/buildimg.tar.gz
when : not on_host
args :
creates : /tmp/buildimg.tar.gz
- name : fetch cached builder image
fetch : src=/tmp/buildimg.tar.gz dest=. flat=true
when : not on_host
become : no