Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 1.32 KB

README.md

File metadata and controls

50 lines (33 loc) · 1.32 KB

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