Skip to content

octocraft/terraform-local-ostype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ostype

Software License Build Status

This module tells you wheter you run on unix or windows

Why

If you want to extend Terraform using null_ressource or data external you need to know wheter to run a .sh or a .bat file. This allows you to create cross-platform modules without dependecies.

Usage

module "os" {
  source = "github.com/octocraft/terraform-local-ostype"
}

Outputs

type

${module.os.type} returns unix on Unix and windows on Windows.

output "type" {
  value = "${module.os.type}"
}

return

type = windows|unix

Notes

This module abuses the file system to tell you on which platform it runs. It check if it is possible to use a backslash in a filenme (unix) or not (windows).

Known Limitations

This module does not work if you run it from Linux Bash Shell on Windows file system (e.g. /mnt/c/foo/bar/). It fails with message "error: unable to create file conf/ext\ext".

License

MIT

About

Tells you whether you run on unix or windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published