Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
matoval committed Apr 5, 2024
1 parent fa83631 commit 95f7d2e
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions roles/builder/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,30 +99,30 @@
when: builder_blueprint_import_file is not defined

- block:
- name: Copy the blueprint file
copy:
src: "{{ builder_blueprint_import_file }}"
dest: "{{ builder_blueprint_src_path }}"

## TODO: Check the imported file TOML format
- name: Read the content of the TOML file
slurp:
src: "{{ builder_blueprint_src_path }}"
register: toml_file_content

- name: Parse TOML content
shell: "echo '{{ toml_file_content.content | b64decode }}' | python -c 'import sys, toml; print(toml.loads(sys.stdin.read())[\"version\"])'"
register: _imported_blueprint_version

- name: Set blueprint name in the imported TOML file
shell: "sed -i '0,/name =/ s/name =.*/name = \"{{ builder_blueprint_name }}\"/' {{ builder_blueprint_src_path }}"

- name: Set expected var output with current_version from TOML
set_fact:
builder_blueprint_output:
msg: "Blueprint file written to location: {{ builder_blueprint_src_path }}"
changed: true
current_version: "{{ _imported_blueprint_version.stdout }}"
- name: Copy the blueprint file
copy:
src: "{{ builder_blueprint_import_file }}"
dest: "{{ builder_blueprint_src_path }}"

## TODO: Check the imported file TOML format
- name: Read the content of the TOML file
slurp:
src: "{{ builder_blueprint_src_path }}"
register: toml_file_content

- name: Parse TOML content
shell: "echo '{{ toml_file_content.content | b64decode }}' | python -c 'import sys, toml; print(toml.loads(sys.stdin.read())[\"version\"])'"
register: _imported_blueprint_version

- name: Set blueprint name in the imported TOML file
shell: "sed -i '0,/name =/ s/name =.*/name = \"{{ builder_blueprint_name }}\"/' {{ builder_blueprint_src_path }}"

- name: Set expected var output with current_version from TOML
set_fact:
builder_blueprint_output:
msg: "Blueprint file written to location: {{ builder_blueprint_src_path }}"
changed: true
current_version: "{{ _imported_blueprint_version.stdout }}"
when: builder_blueprint_import_file is defined

- name: Push the blueprint into image builder
Expand Down

0 comments on commit 95f7d2e

Please sign in to comment.