-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
- name: Test | ||
when: not run_on_simulator | ||
block: | ||
- name: Import common vars | ||
ansible.builtin.include_vars: | ||
file: ../group_vars.yml |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 }}" |
There was a problem hiding this comment.
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}}" |
There was a problem hiding this comment.
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
No description provided.