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

[Windows] gpg --import is not supported #294

Open
wappam opened this issue Sep 18, 2019 · 1 comment
Open

[Windows] gpg --import is not supported #294

wappam opened this issue Sep 18, 2019 · 1 comment
Assignees
Milestone

Comments

@wappam
Copy link

wappam commented Sep 18, 2019

Hi,
I have been scratching my head for a bit to make the pillar decryption work on windows. Then to find out that gpg import (contain in gpgkey.sh) is not ran for windows_os.

I got kitchen-salt running on a git runner where I got the gpg key, the key get properly export to the guest instance, but its never being imported again.

salt_solo.rb

if windows_os?
          salt_config_path = config[:salt_config]
          cmd << "(get-content #{os_join(config[:root_path], salt_config_path, 'minion')}) -replace '\\$env:TEMP', $env:TEMP | set-content #{os_join(config[:root_path], salt_config_path, 'minion')} ;"
          RUN GPG IMPORT HERE
        else
          # install/update dependencies
          cmd << sudo("chmod +x #{config[:root_path]}/*.sh;")
          cmd << sudo("#{config[:root_path]}/dependencies.sh;")
          cmd << sudo("#{config[:root_path]}/gpgkey.sh;") if config[:gpg_key]
          salt_config_path = config[:salt_config]
end

Let say that if gpg for windows is install then run the import (or pretty much what is in the gpgkey.erb):

 gpg.exe --allow-secret-key-import --no-default-keyring --homedir "$GPGKEY_DIR" --import <"#{config[:root_path]}/gpgkey.txt"

Regards,

@gtmanfred
Copy link
Contributor

Feel free to open a PR to implement this for windows. I did not have a windows machine to test this feature on windows, so I didn't implement it.

@gtmanfred gtmanfred added this to the Approved milestone Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants