Files
tripleo-quickstart-extras/playbooks/ovb-setup.yml
Sorin Sbarnea 2ded6f1df1 Make build-test-packages more resilient
OVB failures due to
- ansible_user variable was used instead of ansible_user_id, the first
one being unreliable as is may only be user defined (or undefined).
- lack of become on tasks that needed it

Fixes problem identified by molecule testing
- lack of idempotence on few tasks
- failure when ansible_user variale was not defined

Change-Id: I11adec7104a59bfa29b00c702eb9b7eb6a5c6766
Depends-On: Iade08ee92d7f48e07a625678d2a1c6ac1cd1982b
Partial-Bug: https://tree.taiga.io/project/tripleo-ci-board/task/358
Closes-Bug: #1802825
2018-11-14 19:01:46 +00:00

66 lines
2.3 KiB
YAML

---
- include: ovb-create-stack.yml
when: not use_testenv_broker|default(false)|bool
- include: prepare-slave.yml
when: use_testenv_broker|default(false)|bool
- name: Inventory the undercloud instance
hosts: localhost
gather_facts: yes
roles:
- tripleo-inventory
- name: Setup the undercloud
hosts: undercloud
gather_facts: yes
roles:
- undercloud-setup
tasks:
- name: Add eth2 interface from eth2.conf
command: os-net-config -c {{ working_dir }}/eth2.conf -v
become: yes
when:
- network_isolation|bool
- use_testenv_broker|default(false)|bool
- name: Inventory the undercloud instance
hosts: localhost
gather_facts: yes
roles:
- tripleo-inventory
# Small playbook with logic for when to build images or not.
# The logic there can be completely overridden by setting the
# to_build variable.
- include: to-build-or-not-to-build.yml
- name: Run DLRN gate role and install repo
hosts: undercloud
vars:
artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz"
artg_repos_dir: "{{ repo_clone_dir|default('/opt/stack/new') }}"
ib_create_web_repo: "{{ to_build|bool }}"
roles:
- { role: build-test-packages, when: build_test_packages|default(false)|bool }
- { role: install-built-repo, when: compressed_gating_repo is defined }
tags:
- build
- name: Get images for quickstart
hosts: undercloud
gather_facts: no
vars:
ib_repo_image_inject: "{{ not to_build|bool }}"
ib_repo_run_live: false
modify_image_vc_ram: 4096
modify_image_vc_cpu: 4
modify_image_vc_verbose: true
roles:
- { role: fetch-images, when: not to_build|bool }
- { role: repo-setup, repo_inject_image_path: "$HOME/overcloud-full.qcow2", repo_run_live: false, when: not to_build|bool }
- { role: repo-setup, repo_inject_image_path: "$HOME/ironic-python-agent.initramfs", repo_run_live: false, initramfs_image: true, libguestfs_mode: false, when: not to_build|bool }
- { role: install-built-repo, ib_repo_image_path: "$HOME/overcloud-full.qcow2", when: compressed_gating_repo is defined and not to_build|bool }
- { role: install-built-repo, ib_repo_image_path: "$HOME/ironic-python-agent.initramfs", initramfs_image: true, libguestfs_mode: false, when: compressed_gating_repo is defined and not to_build|bool }