Skip to content

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://[email protected]/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?

Add cleanup tests to full.sh
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.

2 participants