Browse Source

Update gen_iso_image

ca-cert-and-multi-ks
ePietry 2 years ago
parent
commit
6992116da5
  1. 36
      ansible/playbooks/gen_iso_image.yaml

36
ansible/playbooks/gen_iso_image.yaml

@ -2,18 +2,18 @@
hosts: all
vars_files: ../credentials.yaml
tasks:
- name: Clear /tmp/microshift_bluprint
- name: Clear /tmp/microshift_bluprint.toml
ansible.builtin.file:
path: /tmp/microshift_bluprint.toml
state: absent
- name: Create /tmp/microshift_bluprint
- name: Create /tmp/microshift_bluprint.toml
ansible.builtin.file:
path: /tmp/microshift_bluprint.toml
state: file
mode: "0755"
- name: Write blueprint content to /tmp/microshift_bluprint file
ansible.builtin.copy:
dest: "/tmp/microshift_blueprint"
dest: "/tmp/microshift_blueprint.toml"
content: |
name = "microshift-installer"
@ -29,27 +29,13 @@
infra.osbuild.push_blueprint:
src: "/tmp/microshift_blueprint.toml"
- name: Start the compose
ansible.builtin.shell: |
BUILDID=$(composer-cli compose start-ostree --url {{ repo_url }} --ref {{ ostree_ref }} {{ blueprint_name }} {{ compose_type }} | awk '{print $2}')
echo $BUILDID > /tmp/build_id
args:
executable: /bin/bash
register: start_compose_result
- name: Wait for compose to finish (simplified example)
ansible.builtin.shell: |
BUILDID=$(cat /tmp/build_id)
until composer-cli compose status | grep -E "$BUILDID.*FINISHED"; do
sleep 30
done
args:
executable: /bin/bash
- name: Get BUILDID from file
ansible.builtin.shell: "cat /tmp/build_id"
- name: Start OSTree Compose
ansible.builtin.shell:
cmd: composer-cli compose start-ostree --url http://{{ ansible_default_ipv4.address }}/repo --ref empty microshift-installer edge-installer | awk '{print $2}'
register: build_id
- name: Generate image from the compose
ansible.builtin.command:
cmd: "composer-cli compose image {{ build_id.stdout }}"
- name: Wait for compose to finish
infra.osbuild.wait_compose:
compose_id: "{{build_id.stdout_lines | first}}"
timeout: 3600

Loading…
Cancel
Save