browbeat/ansible/install/shaker_build.yml
Chuck Short 959bed59a5 Enable linter test for ANSIBLE0013
Use shell only shell functionality is required.
The shell functionality should only be used when piping, redirecting or
chaining commands.

Change-Id: Icb9b1dd5ea22a2af895a87a9fa2cc1b9a488ac0c
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-08-10 14:28:36 +00:00

26 lines
730 B
YAML

---
#
# Playbook to build shaker-image
#
- hosts: browbeat
remote_user: "{{ browbeat_user }}"
tasks:
- name: Check external connectivity
command: ping -c 1 google.com
register: ping
ignore_errors: true
- name: Fail if no external connectivity
fail:
msg: "There should be external connectivity to build shaker image"
when: ping.rc != 0
- name: Build shaker image
shell: >
source {{ overcloudrc }}; source {{ shaker_venv }}/bin/activate;
shaker-image-builder --image-builder-mode dib --image-builder-distro
{{shaker_image}} --os-region-name {{ shaker_region }}
register: image_result
failed_when: image_result.rc != 0