mayn/packerlicious

Provisioners do not support the 'only' key

adarobin opened this issue · 4 comments

packerlicious version

0.8.0

Expected behavior

I would like to use the only option with a provisioner

Actual behavior

AttributeError: shell object does not support attribute only
or
AttributeError: powershell object does not support attribute only

Steps to reproduce

azure_deprovision_provisioner = provisioner.Shell(
            inline = [ "sudo /usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" ],
            only = [ "azure-arm" ]      
 )

or

azure_deprovision_provisioner = provisioner.PowerShell(
            inline = [ "if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}",
                       "& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit",
                       "while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10  } else { break } }" ],
            only = [ "azure-arm" ]
)
mayn commented

thanks @adarobin for reporting, please update to v0.8.1 and report any additional issues

@mayn This seems to be working now, thanks!

mayn commented

@adarobin thanks for the feedback.