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

Support for Hooks for windows VMs #956

Open
jsakil14 opened this issue Jul 11, 2024 · 2 comments
Open

Support for Hooks for windows VMs #956

jsakil14 opened this issue Jul 11, 2024 · 2 comments

Comments

@jsakil14
Copy link

Hello anyone has success with using pre / post hooks for windows vms? I am looking to capture network config and disk layout part of pre hook and run a condition check for nw and disks in post hook and apply them if they are not correct. Is this possible using ansible ? since I see only requirement is to have ssh enabled , for sake of windows I got winrm enabled. I am trying to achieve this by below:

postHooks:
  - name: Bring all disks online
    type: Ansible
    image: quay.io/konveyor/hook-runner
    playbook: |
      ---
      - name: Bring all disks online
        hosts: all
        tasks:
          - name: Bring disks online
            win_shell: |
              $disks = Get-Disk | Where-Object IsOffline -eq $true
              foreach ($disk in $disks) {
                Set-Disk -Number $disk.Number -IsOffline $false
                Set-Disk -Number $disk.Number -IsReadOnly $false
              }
            become: yes
@ahadas
Copy link
Member

ahadas commented Jul 14, 2024

I didn't try, but I'd recommend to look at this example which is supposedly working as a pre-migration hook for Windows guests

@jsakil14
Copy link
Author

@ahadas Thanks - if I understand correctly , in the hooks section - can we create a custom docker image with hook runner and ansible scripts added and leave the dialog box empty?

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

No branches or pull requests

2 participants