ci: Factor out image prep bootstrap as a role
Promoting the script to a full template will fix some whitespace errors later.pull/1254/head
parent
d1c4217db0
commit
780f8af1a4
@ -0,0 +1 @@
|
||||
bootstrap_packages: []
|
||||
@ -0,0 +1,3 @@
|
||||
- name: Bootstrap
|
||||
raw: "{{ lookup('template', 'bootstrap.sh.j2') }}"
|
||||
changed_when: true
|
||||
@ -0,0 +1,13 @@
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
{% if bootstrap_packages %}
|
||||
if command -v apt-get; then
|
||||
apt-get -y update
|
||||
apt-get -y --no-install-recommends install {{ bootstrap_packages | join(' ') }}
|
||||
elif command -v yum; then
|
||||
yum -y install {{ bootstrap_packages | join(' ') }}
|
||||
else
|
||||
exit 42
|
||||
fi
|
||||
{% endif %}
|
||||
Loading…
Reference in New Issue