aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/build_vm.yml
blob: 9774f9ff5da3a88674b6e1d565e04901f1c93bd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- name: Prepare to build VM
  hosts: jumphost
  become: yes
  vars:
    img_prop_item: "{{ IMG_PROPERTY }}"
    img_arch: "{{ YARD_IMG_ARCH }}"

  tasks:
    - name: Include pre-build
      include_role:
        name: build_yardstick_image
        tasks_from: pre_build.yml
      when:
        - installation_mode != inst_mode_container


- name: Build VM in chroot
  hosts: chroot_image
  connection: chroot
  become: yes
  vars:
    img_property: "{{ IMG_PROPERTY }}"
  environment: "{{ proxy_env }}"

  tasks:
    - name: Include image build
      include_role:
        name: build_yardstick_image
        tasks_from: "cloudimg_modify_{{ img_property }}.yml"
      when:
        - installation_mode != inst_mode_container


- name: Clear up after VM is built
  hosts: jumphost
  become: yes

  tasks:
    - name: Include post-build
      include_role:
        name: build_yardstick_image
        tasks_from: post_build.yml
      when:
        - installation_mode != inst_mode_container