tflat 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +2 -0
- data/lib/tflat.rb +7 -2
- data/lib/tflat/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d15b9198d7b98f7db2eebf26bc45cde58a272fc185b994df397944ef4c5eca1
|
4
|
+
data.tar.gz: cff2e13e095dfdf4d48c644afa3a59ed2230fda74045a2b854c59d6861044c0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3484b425066f7d77e27f98a61d7d80d349133127dd578eb1254032da3e9eac8cb3b98b9e1bcc0a1cabe8648af049d75b22508bf9e9d5d3bbe74c99f106096d92
|
7
|
+
data.tar.gz: a8afe6be65b184561fa55512e26223d6081a433fc39df7394ba339a90c6fce92c7d4e6774f3f151daaa788787888b28d70c941b1d33df2d03c3032b3f5e46bf0
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 0.1.3 - Nov 12 2018
|
4
|
+
- Added helper method `file_sha256(file)` to return the SHA256 of `file`'s content. This is useful for `null_resource` triggers.
|
5
|
+
- Fixed bug when file gets loaded before ERB parsed when using the `file` helper
|
6
|
+
## 0.1.2 - Nov 11 2018
|
7
|
+
- Variables listed in JSON format inside file `terraform.tfvars.json` are accessible in rendered ERB as a HASH named `@variables` (with string keys).
|
data/README.md
CHANGED
@@ -102,6 +102,8 @@ template = "${file("<%= f('files/userdata.tpl') %>")}"
|
|
102
102
|
|
103
103
|
It is up to you to choose what you like. Try both and look inside `.tflat/main.tf` to see the difference between the two ways.
|
104
104
|
|
105
|
+
> You can also use `<%= file_sha256('path/to_file') %>` to return its SHA256.
|
106
|
+
|
105
107
|
## Installation
|
106
108
|
1. [Download and install Terraform](https://www.terraform.io/intro/getting-started/install.html). Make sure the `terraform` command is in your **$PATH**.
|
107
109
|
|
data/lib/tflat.rb
CHANGED
@@ -3,6 +3,7 @@ require 'erb'
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'ptools'
|
5
5
|
require 'json'
|
6
|
+
require 'digest'
|
6
7
|
|
7
8
|
module Tflat
|
8
9
|
class Terraform
|
@@ -67,8 +68,12 @@ module Tflat
|
|
67
68
|
end
|
68
69
|
|
69
70
|
def file(file)
|
70
|
-
|
71
|
-
|
71
|
+
render(file).inspect[1...-1]
|
72
|
+
end
|
73
|
+
|
74
|
+
def file_sha256(ff)
|
75
|
+
f = file(ff)
|
76
|
+
Digest::SHA256.hexdigest(f)
|
72
77
|
end
|
73
78
|
|
74
79
|
def render(file)
|
data/lib/tflat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tflat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paulo Arruda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ptools
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- ".gitignore"
|
79
79
|
- ".rspec"
|
80
80
|
- ".travis.yml"
|
81
|
+
- CHANGELOG.md
|
81
82
|
- CODE_OF_CONDUCT.md
|
82
83
|
- Gemfile
|
83
84
|
- Gemfile.lock
|