Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload iso to datastore #120

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

OrrBG
Copy link
Contributor

@OrrBG OrrBG commented Jan 7, 2025

No description provided.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot the .yml extension

---
galaxy_info:
author: Ansible Cloud Content Team (@redhat-cop)
description: Manage a content library in vCenter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the description

ansible.builtin.include_vars:
file: "{{ role_path }}/../../vars/main.yml"

- name: Check Mandatory Variables Are Defined
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upload_iso_to_datastore_src is also required

datacenter: "{{ upload_iso_to_datastore_datacenter }}"
datastore: "{{ upload_iso_to_datastore_datastore }}"
path: "{{ upload_iso_to_datastore_dst}}"
validate_certs: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be an input variable, upload_iso_to_datastore_validate_certs

Comment on lines +2 to +7
- name: Test
when: not run_on_simulator
block:
- name: Import common vars
ansible.builtin.include_vars:
file: ../group_vars.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theres no need for a block here since these will never be run against the simulator

- name: Check ISO was copied to Datastore
ansible.builtin.assert:
that:
- file_result.changed is false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works, but ansible has a builtin test for changed. so you could say file_result is not changed. just an fyi

---
- name: Create Mock VCSA Deployment Binary Path
ansible.builtin.file:
path: "{{ provision_vcenter_test_mock_binary_root }}/lin64"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provision_vcenter_test_mock_binary_root you should use a different variable name, one specific to this role/test

- name: Create Mock VCSA ISO file
community.general.iso_create:
src_files:
- "{{ provision_vcenter_test_mock_binary_root }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as provision_vcenter_test_mock_binary_root

src: "{{ upload_iso_to_datastore_src }}"
datacenter: "{{ upload_iso_to_datastore_datacenter }}"
datastore: "{{ upload_iso_to_datastore_datastore }}"
path: "{{ upload_iso_to_datastore_dst}}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe here we can add an option to upload a file to a specific directory inside the datastore?
we can do a task before this one, that creates a folder in a specific datastore, and then upload the iso to that folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants