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

Add bastion deployment on pre-installed libvirt server #29

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

kononovn
Copy link
Collaborator

  • Added playbooks/infra/deploy-vm-bastion-libvirt.yml playbook
  • Added infra/deploy-vm-bastion-libvirt.yml inventory
  • Fixed 'Reload NetworkManager connections' task in playbooks/infra/deploy-bm-hypervisor.yml playbook
  • Changed executors group to bastions in inventories/infra/deploy-bm-hypervisor.yml

@openshift-ci openshift-ci bot requested review from ccardenosa and shaior January 16, 2025 00:23
@kononovn kononovn force-pushed the deployment_bastion branch 3 times, most recently from 5c36ba8 to 18e9b44 Compare January 16, 2025 02:21
ansible.builtin.shell: >
nmcli con down {{ (net_config | from_yaml)['interface_name'] }} &&
nmcli con up {{ (net_config | from_yaml)['interface_name'] }} &&
nmcli con up bridge-baremetal && nmcli con up {{ (net_config | from_yaml)['interface_name'] }}
Copy link
Contributor

@shaior shaior Jan 16, 2025

Choose a reason for hiding this comment

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

nmcli con up {{ (net_config | from_yaml)['interface_name'] }} looks like this part is already happening on line 204. perhaps you meant con down on 204?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And maybe this line:

nmcli con up bridge-baremetal && nmcli con up {{ (net_config | from_yaml)['interface_name'] }}

should be split into two:

nmcli con up bridge-baremetal &&
nmcli con up  {{ (net_config | from_yaml)['interface_name'] }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ccardenosa Thanks lines are formatted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@shaior No, we need to bring this interface up 2 times due to some weird bridge interface behavior. It helps bring bridge up

force: true
mode: '0640'

- name: Resize VM hard disk
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to resize the disk?
Doesn't create_vms handle the disk creation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the creates_vms role creates an empty HDD, but in this case, we don't need an empty disk because I pre-pull the QCOW2 cloud image with the same name. As a result, the creates_vms role simply reuses my QCOW2 HDD image without any additional modifications

cmd: partprobe
changed_when: true

- name: Setup bastion host
Copy link
Collaborator

@natifridman natifridman Jan 16, 2025

Choose a reason for hiding this comment

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

Looks like we might need another user for connecting in the pipeline, currently it was passwordless sudo and ssh key.
Maybe we can add the option to the playbook?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's OK. We can always modify it once we have use case for multiple users. WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the use case is to have a different user for CI than the one for management

- Added playbooks/infra/deploy-vm-bastion-libvirt.yml playbook
- Added infra/deploy-vm-bastion-libvirt.yml inventory
- Fixed 'Reload NetworkManager connections' task in playbooks/infra/deploy-bm-hypervisor.yml playbook
- Changed executors group to bastions in inventories/infra/deploy-bm-hypervisor.yml
Copy link
Collaborator

@natifridman natifridman left a comment

Choose a reason for hiding this comment

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

Could we add the installation of the required packages? Otherwise, we will need to reinstall every time the VM is recreated

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2025
Copy link

openshift-ci bot commented Jan 19, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shaior

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 19, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit edb88fd into openshift-kni:main Jan 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants