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

Linux Support #28

Closed
charltonstanley opened this issue Jun 5, 2023 · 3 comments
Closed

Linux Support #28

charltonstanley opened this issue Jun 5, 2023 · 3 comments
Assignees
Labels
question Further information is requested stale This issue hasn't been updated in 60 days

Comments

@charltonstanley
Copy link

This looks like a really neat module and I was excited to try it out, but I ran into a few issues on Linux; I'm guessing this wasn't written with Linux support in mind.

Is your feature request related to a problem? Please describe.
Installing on Linux via Install-Module -Name Invoke-Terraform -Repository PSGallery -Scope CurrentUser works, but commands within the module (i.e. Get-ConfigurationPath) return the system configuration path instead of the config path within the user's home directory. The system configuration path requires root privileges to write to. I've attempted to go down the rabbit hole with this a little bit and get it working properly on Linux, but without intimately knowing exactly how this module is supposed to work, progress is slow and difficult.

Describe the solution you'd like
Proper support for Linux

Describe alternatives you've considered

Additional context

Below is what happens when attempting to set the terraform version on Linux.

$ set-TerraformVersion -TFVersion 1.4.6
WARNING: The Enterprise path /etc/xdg/xdg-cinnamon/powershell cannot be found
New-Item: Access to the path '/etc/xdg/xdg-cinnamon' is denied.
New-Item: Access to the path '/etc/xdg/xdg-cinnamon' is denied.

Confirm
Are you sure you want to perform this action?
Performing the operation "Setting TFVesion configuration version to 1.4.6" on target "/etc/xdg/xdg-cinnamon/powershell/Christian 
Pearce/Invoke-Terraform".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
WARNING: The Enterprise path /etc/xdg/xdg-cinnamon/powershell cannot be found
New-Item: Access to the path '/etc/xdg/xdg-cinnamon' is denied.
New-Item: Access to the path '/etc/xdg/xdg-cinnamon' is denied.
WARNING: The Enterprise path /etc/xdg/xdg-cinnamon/powershell cannot be found
New-Item: Access to the path '/etc/xdg/xdg-cinnamon' is denied.
New-Item: Access to the path '/etc/xdg/xdg-cinnamon' is denied.
Set-Content: Could not find a part of the path '/etc/xdg/xdg-cinnamon/powershell/Christian Pearce/Invoke-Terraform/Configuration.psd1'.
@pearcec pearcec self-assigned this Jun 9, 2023
@pearcec pearcec added the question Further information is requested label Jun 9, 2023
@pearcec
Copy link
Owner

pearcec commented Jun 9, 2023

HI I have tests that install on MacOS, Windows and Linux. I have personally used this in pipelines that run on Linux. I just installed it on Linux via Azure Cloud Shell.

  • What distribution are you running?
  • What is in your $PSGetPath ?

Similar issue? Jaykul/PowerLine#39

@charltonstanley
Copy link
Author

Sorry for the delayed reply, and thank you for taking the time to respond.

I have personally used this in pipelines that run on Linux. I just installed it on Linux via Azure Cloud Shell.

I'm glad that my (apparently poor) guess of this not having Linux support was wrong! 😄

What distribution are you running?

Short answer: Linux Mint.
Long Answer:

/home/user> cat /etc/os-release                                   
NAME="Linux Mint"
VERSION="21.1 (Vera)"
ID=linuxmint
ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 21.1"
VERSION_ID="21.1"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=vera
UBUNTU_CODENAME=jammy

What is in your $PSGetPath ?

/home/user> $PSGetPath

AllUsersModules    : /usr/local/share/powershell/Modules
AllUsersScripts    : /usr/local/share/powershell/Scripts
CurrentUserModules : /home/user/.local/share/powershell/Modules
CurrentUserScripts : /home/user/.local/share/powershell/Scripts

Similar issue? Jaykul/PowerLine#39

Hmm that is interesting; I think so! On my system, it appears that $Env:XDG_CONFIG_HOME is equal to $null. I'm not sure if this is specific to my distro of choice. (Curious: was it populated in AZ Cloud Shell?) The spec referenced in the issue you linked seems to indicate that it shouldn't matter if it is $null, since whatever relies on it should fall back to $HOME/.config/. However, I don't see XDG_CONFIG_HOME anywhere in your module so I don't think this is the problem, unless I'm mistaken.

@stale
Copy link

stale bot commented Sep 13, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale This issue hasn't been updated in 60 days label Sep 13, 2023
@stale stale bot closed this as completed Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale This issue hasn't been updated in 60 days
Projects
None yet
Development

No branches or pull requests

2 participants