From dace8b00e4fae77e985a4a67b99852854e3edd07 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 11 Mar 2023 23:32:23 -0800 Subject: [PATCH] example usage files --- test/tf/.terraformrc | 6 +++++ test/tf/main.tf | 59 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 test/tf/.terraformrc create mode 100644 test/tf/main.tf 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 = <