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

added a new test prepare env for host test case #165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Imaanpreet
Copy link
Contributor

No description provided.

- name: lock
command: "{{item}}"
with_items:
- echo "ProvisioningTemplate.update_all(locked: false)" | foreman-rake console
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure this will not work as pipe | is a shell construct that does not work with command task


- name: lock
command: "{{item}}"
with_items:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not 3 separate tasks? IMO it just makes the script harder to read

with_items:
- echo "ProvisioningTemplate.update_all(locked: false)" | foreman-rake console
- hammer template build-pxe-default
- PROV_TEMPLATES="Kickstart default,Kickstart default finish,Kickstart default PXELinux,Kickstart default user data"
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting a bash variable in one task and using it in another does not work as these are two different environments


- name: hammer architecture create
command:
hammer -u "{{ sat_user}}" -p "{{ sat_pass }}" os create --name "RHEL" --major 8 --minor 4 --description="RHEL 8.4" --media "RHEL mirror" --provisioning-templates "$PROV_TEMPLATES" --architectures "x86_64" --family Redhat --partition-tables "Kickstart default"
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we use that variable only on one place, so we do not need to define it at all

command:
hammer -u "{{ sat_user}}" -p "{{ sat_pass }}" compute-resource create --provider "libvirt" --name "MyLibvirtComputeResource" --set-console-password "false" --url "qemu+ssh://root@192.168.111.1/system" --organizations "MyOrg" --locations "MyLoc"

# For testing we don't need to have them locked
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean by locking here?

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.

None yet

2 participants