diff --git a/test/tf/.terraformrc b/test/tf/.terraformrc new file mode 100644 index 0000000..a845750 --- /dev/null +++ b/test/tf/.terraformrc @@ -0,0 +1,6 @@ +provider_installation { + filesystem_mirror { + path = "../../repo/" + include = ["registry.terraform.io/dpedu/*"] + } +} \ No newline at end of file diff --git a/test/tf/main.tf b/test/tf/main.tf new file mode 100644 index 0000000..050b6ef --- /dev/null +++ b/test/tf/main.tf @@ -0,0 +1,59 @@ +terraform { + required_providers { + system = { + version = "~> 0.0.1" + source = "dpedu/system" + } + } +} + + +provider "system" { + connection_string = "ssh://root@core00?agent=yes" +// connection_string = "ssh://dave:password@core00" +// connection_string = "ssh://root@core00?ssh_key_path=~/.ssh/id_rsa" +} + + +# creates a directory +resource "system_dir" "confdir" { + path = "/srv/myapp" + mode = "0755" + owner = "root" + group = "root" +} + + +output "test" { + value = system_dir.confdir +} + + +# creates a file +resource "system_file" "conffile" { + path = "${system_dir.confdir.path}/config.txt" + mode = "0644" + owner = "root" + group = "root" + content = <