Skip to content

Commit 40d9fcd

Browse files
authored
Prepare Release 2.1.0 (#135)
* Prepare Release 2.1.0 * add formatting for release summary + add docs for new plugins
1 parent 011fbdc commit 40d9fcd

File tree

7 files changed

+1047
-19
lines changed

7 files changed

+1047
-19
lines changed

CHANGELOG.rst

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ The cloud.terraform collection Release Notes
44

55
.. contents:: Topics
66

7+
v2.1.0
8+
======
9+
10+
Release Summary
11+
---------------
12+
13+
The cloud.terraform 2.1.0 release includes a new module to ``plan_stash`` and a new inventory plugin ``terraform_state``.
14+
15+
New Plugins
16+
-----------
17+
18+
Inventory
19+
~~~~~~~~~
20+
21+
- terraform_state - Builds an inventory from resources created by cloud providers.
22+
23+
New Modules
24+
-----------
25+
26+
- plan_stash - Handle the base64 encoding or decoding of a terraform plan file
727

828
v2.0.0
929
======
@@ -13,33 +33,31 @@ Breaking Changes / Porting Guide
1333

1434
- Remove support for ansible-core < 2.14 (https://github.com/ansible-collections/cloud.terraform/pull/102).
1535

16-
1736
Major Changes
1837
-------------
1938

20-
- terraform_provider - Added ``search_child_modules`` option (https://github.com/ansible-collections/cloud.terraform/pull/55).
2139
- terraform_provider - Allow ``project_path`` in terraform_provider inventory plugin to accept a list of paths (https://github.com/ansible-collections/cloud.terraform/pull/55).
40+
- terraform_provider - Added ``search_child_modules`` option (https://github.com/ansible-collections/cloud.terraform/pull/55).
2241

2342
Minor Changes
2443
-------------
2544

2645
- Removed integration tests workaround in terrform_provider. (https://github.com/ansible-collections/cloud.terraform/pull/84)
2746
- Set default of ``state_file`` in terraform_provider inventory plugin to a blank string (https://github.com/ansible-collections/cloud.terraform/pull/55).
28-
- terraform - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
47+
- terraform - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
48+
- terraform - cleanup temporary file create during module execution. (https://github.com/ansible-collections/cloud.terraform/issues/2)
2949
- terraform_output - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
3050
- tf_output - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
31-
- terraform - cleanup temporary file create during module execution. (https://github.com/ansible-collections/cloud.terraform/issues/2)
32-
3351

3452
Bugfixes
3553
--------
3654

3755
- module_utils - Accept Terraform executables present on PATH passed in as ``binary_path`` without specifying their absolute path. (https://github.com/ansible-collections/cloud.terraform/issues/49)
3856
- module_utils - Allow ``nested_type`` attribute in terraform schema. (https://github.com/ansible-collections/cloud.terraform/issues/93)
3957
- module_utils - Fix AWS SQS queue creation. The ``values`` attribute in terraform output is optional. SQS is one of (rare) cases where ``values`` is absent. (https://github.com/ansible-collections/cloud.terraform/issues/86)
40-
- terraform - fix spaces between characters in command field in result (https://github.com/ansible-collections/cloud.terraform/pull/76).
4158
- move test requirements out of the requirements.txt file (https://github.com/ansible-collections/cloud.terraform/pull/67).
4259
- terraform - fix issue with ``plan_file`` option specified with ``check_mode=true`` and ``state`` set to one of ``present`` and ``absent``, the module is enable now to generate a Terraform file to the specified location (https://github.com/ansible-collections/cloud.terraform/issues/87).
60+
- terraform - fix spaces between characters in command field in result (https://github.com/ansible-collections/cloud.terraform/pull/76).
4361

4462
v1.1.0
4563
======

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This collection requires Ansible Core 2.14 or later and thus Python 3.9 or later
3030
Name | Description
3131
--- | ---
3232
[cloud.terraform.terraform_provider](https://github.com/ansible-collections/cloud.terraform/blob/main/docs/cloud.terraform.terraform_provider_inventory.rst)|Builds an inventory from Terraform state file.
33+
[cloud.terraform.terraform_state](https://github.com/ansible-collections/cloud.terraform/blob/main/docs/cloud.terraform.terraform_state_inventory.rst)|Builds an inventory from resources created by cloud providers.
3334

3435
### Lookup plugins
3536
Name | Description
@@ -39,6 +40,7 @@ Name | Description
3940
### Modules
4041
Name | Description
4142
--- | ---
43+
[cloud.terraform.plan_stash](https://github.com/ansible-collections/cloud.terraform/blob/main/docs/cloud.terraform.plan_stash_module.rst)|Handle the base64 encoding or decoding of a terraform plan file
4244
[cloud.terraform.terraform](https://github.com/ansible-collections/cloud.terraform/blob/main/docs/cloud.terraform.terraform_module.rst)|Manages a Terraform deployment (and plans)
4345
[cloud.terraform.terraform_output](https://github.com/ansible-collections/cloud.terraform/blob/main/docs/cloud.terraform.terraform_output_module.rst)|Returns Terraform module outputs.
4446

@@ -132,3 +134,4 @@ ansible-doc --list | grep cloud.terraform | cut -d " " -f 1 | xargs -I {} antsib
132134
GNU General Public License v3.0 or later.
133135

134136
See [LICENSE](https://github.com/ansible-collections/cloud.terraform/blob/main/LICENSE) to see the full text.
137+

changelogs/changelog.yaml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,32 @@ releases:
7575
breaking_changes:
7676
- Remove support for ansible-core < 2.14 (https://github.com/ansible-collections/cloud.terraform/pull/102).
7777
bugfixes:
78-
- module_utils - Accept Terraform executables present on PATH passed in as ``binary_path`` without specifying their absolute path. (https://github.com/ansible-collections/cloud.terraform/issues/49)
78+
- module_utils - Accept Terraform executables present on PATH passed in as ``binary_path``
79+
without specifying their absolute path. (https://github.com/ansible-collections/cloud.terraform/issues/49)
7980
- module_utils - Allow ``nested_type`` attribute in terraform schema. (https://github.com/ansible-collections/cloud.terraform/issues/93)
80-
- module_utils - Fix AWS SQS queue creation. The ``values`` attribute in terraform output is optional. SQS is one of (rare) cases where ``values`` is absent. (https://github.com/ansible-collections/cloud.terraform/issues/86)
81-
- terraform - fix spaces between characters in command field in result (https://github.com/ansible-collections/cloud.terraform/pull/76).
81+
- module_utils - Fix AWS SQS queue creation. The ``values`` attribute in terraform
82+
output is optional. SQS is one of (rare) cases where ``values`` is absent.
83+
(https://github.com/ansible-collections/cloud.terraform/issues/86)
8284
- move test requirements out of the requirements.txt file (https://github.com/ansible-collections/cloud.terraform/pull/67).
83-
- terraform - fix issue with ``plan_file`` option specified with ``check_mode=true`` and ``state`` set to one of ``present`` and ``absent``, the module is enable now to generate a Terraform file to the specified location (https://github.com/ansible-collections/cloud.terraform/issues/87).
85+
- terraform - fix issue with ``plan_file`` option specified with ``check_mode=true``
86+
and ``state`` set to one of ``present`` and ``absent``, the module is enable
87+
now to generate a Terraform file to the specified location (https://github.com/ansible-collections/cloud.terraform/issues/87).
88+
- terraform - fix spaces between characters in command field in result (https://github.com/ansible-collections/cloud.terraform/pull/76).
8489
major_changes:
90+
- terraform_provider - Allow ``project_path`` in terraform_provider inventory
91+
plugin to accept a list of paths (https://github.com/ansible-collections/cloud.terraform/pull/55).
8592
- terraform_provider - Added ``search_child_modules`` option (https://github.com/ansible-collections/cloud.terraform/pull/55).
86-
- terraform_provider - Allow ``project_path`` in terraform_provider inventory plugin to accept a list of paths (https://github.com/ansible-collections/cloud.terraform/pull/55).
8793
minor_changes:
8894
- Removed integration tests workaround in terrform_provider. (https://github.com/ansible-collections/cloud.terraform/pull/84)
89-
- Set default of ``state_file`` in terraform_provider inventory plugin to a blank string (https://github.com/ansible-collections/cloud.terraform/pull/55).
90-
- terraform - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
91-
- terraform_output - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
92-
- tf_output - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
95+
- Set default of ``state_file`` in terraform_provider inventory plugin to a
96+
blank string (https://github.com/ansible-collections/cloud.terraform/pull/55).
97+
- terraform - add support for ``workspace`` when running ``terraform output``
98+
(https://github.com/ansible-collections/cloud.terraform/issues/85).
9399
- terraform - cleanup temporary file create during module execution. (https://github.com/ansible-collections/cloud.terraform/issues/2)
100+
- terraform_output - add support for ``workspace`` when running ``terraform
101+
output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
102+
- tf_output - add support for ``workspace`` when running ``terraform output``
103+
(https://github.com/ansible-collections/cloud.terraform/issues/85).
94104
fragments:
95105
- 20230524-aws_integration_tests.yml
96106
- 20230913-add-support-for-workspace-when-running-terraform_output.yml
@@ -107,3 +117,20 @@ releases:
107117
- terraform-cleanup-file.yml
108118
- terraform_provider_remove_workaround.yml
109119
release_date: '2023-11-17'
120+
2.1.0:
121+
changes:
122+
release_summary: The cloud.terraform 2.1.0 release includes a new module to
123+
plan_stash and a new inventory plugin terraform_state
124+
fragments:
125+
- 20240217-fix-awscc-integration-test.yaml
126+
- release.yaml
127+
modules:
128+
- description: Handle the base64 encoding or decoding of a terraform plan file
129+
name: plan_stash
130+
namespace: ''
131+
plugins:
132+
inventory:
133+
- description: Builds an inventory from resources created by cloud providers.
134+
name: terraform_state
135+
namespace: null
136+
release_date: '2024-05-21'

changelogs/fragments/20240217-fix-awscc-integration-test.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
.. _cloud.terraform.plan_stash_module:
2+
3+
4+
**************************
5+
cloud.terraform.plan_stash
6+
**************************
7+
8+
**Handle the base64 encoding or decoding of a terraform plan file**
9+
10+
11+
Version added: 2.1.0
12+
13+
.. contents::
14+
:local:
15+
:depth: 1
16+
17+
18+
Synopsis
19+
--------
20+
- This module performs base64-encoding of a terraform plan file and saves it into playbook execution stats similar to :ref:`ansible.builtin.set_stats <ansible.builtin.set_stats_module>` module.
21+
- The module also performs base64-decoding of a terraform plan file from a variable defined into ansible facts and writes them into a file specified by the user.
22+
23+
24+
25+
26+
Parameters
27+
----------
28+
29+
.. raw:: html
30+
31+
<table border=0 cellpadding=0 class="documentation-table">
32+
<tr>
33+
<th colspan="1">Parameter</th>
34+
<th>Choices/<font color="blue">Defaults</font></th>
35+
<th width="100%">Comments</th>
36+
</tr>
37+
<tr>
38+
<td colspan="1">
39+
<div class="ansibleOptionAnchor" id="parameter-"></div>
40+
<b>binary_data</b>
41+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
42+
<div style="font-size: small">
43+
<span style="color: purple">raw</span>
44+
</div>
45+
</td>
46+
<td>
47+
</td>
48+
<td>
49+
<div>When O(state=load), this parameter defines the base64-encoded data of the terraform plan file.</div>
50+
<div>Mutually exclusive with V(var_name).</div>
51+
<div>Ignored when O(state=stash).</div>
52+
</td>
53+
</tr>
54+
<tr>
55+
<td colspan="1">
56+
<div class="ansibleOptionAnchor" id="parameter-"></div>
57+
<b>path</b>
58+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
59+
<div style="font-size: small">
60+
<span style="color: purple">path</span>
61+
/ <span style="color: red">required</span>
62+
</div>
63+
</td>
64+
<td>
65+
</td>
66+
<td>
67+
<div>The path to the terraform plan file.</div>
68+
</td>
69+
</tr>
70+
<tr>
71+
<td colspan="1">
72+
<div class="ansibleOptionAnchor" id="parameter-"></div>
73+
<b>per_host</b>
74+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
75+
<div style="font-size: small">
76+
<span style="color: purple">boolean</span>
77+
</div>
78+
</td>
79+
<td>
80+
<ul style="margin: 0; padding: 0"><b>Choices:</b>
81+
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
82+
<li>yes</li>
83+
</ul>
84+
</td>
85+
<td>
86+
<div>Whether the stats are per host or for all hosts in the run.</div>
87+
<div>Ignored when O(state=load).</div>
88+
</td>
89+
</tr>
90+
<tr>
91+
<td colspan="1">
92+
<div class="ansibleOptionAnchor" id="parameter-"></div>
93+
<b>state</b>
94+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
95+
<div style="font-size: small">
96+
<span style="color: purple">string</span>
97+
</div>
98+
</td>
99+
<td>
100+
<ul style="margin: 0; padding: 0"><b>Choices:</b>
101+
<li><div style="color: blue"><b>stash</b>&nbsp;&larr;</div></li>
102+
<li>load</li>
103+
</ul>
104+
</td>
105+
<td>
106+
<div>O(state=stash): base64-encodes the terraform plan file and saves it into ansible stats like using the <span class='module'>ansible.builtin.set_stats</span> module.</div>
107+
<div>O(state=load): base64-decodes data from variable specified in O(var_name) and writes them into terraform plan file.</div>
108+
</td>
109+
</tr>
110+
<tr>
111+
<td colspan="1">
112+
<div class="ansibleOptionAnchor" id="parameter-"></div>
113+
<b>var_name</b>
114+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
115+
<div style="font-size: small">
116+
<span style="color: purple">string</span>
117+
</div>
118+
</td>
119+
<td>
120+
</td>
121+
<td>
122+
<div>When O(state=stash), this parameter defines the variable name to be set into stats.</div>
123+
<div>When O(state=load), this parameter defines the variable from ansible facts containing the base64-encoded data of the terraform plan file.</div>
124+
<div>Variables must start with a letter or underscore character, and contain only letters, numbers and underscores.</div>
125+
<div>The module will use V(terraform_plan) as default variable name if not specified.</div>
126+
</td>
127+
</tr>
128+
</table>
129+
<br/>
130+
131+
132+
Notes
133+
-----
134+
135+
.. note::
136+
- For security reasons, this module should be used with *no_log=true* and *register* functionalities as the plan file can contain unencrypted secrets.
137+
138+
139+
140+
Examples
141+
--------
142+
143+
.. code-block:: yaml
144+
145+
# Encode terraform plan file into default variable 'terraform_plan'
146+
- name: Encode a terraform plan file into terraform_plan variable
147+
cloud.terraform.plan_stash:
148+
path: /path/to/terraform_plan_file
149+
state: stash
150+
no_log: true
151+
152+
# Encode terraform plan file into variable 'stashed_plan'
153+
- name: Encode a terraform plan file into terraform_plan variable
154+
cloud.terraform.plan_stash:
155+
path: /path/to/terraform_plan_file
156+
var_name: stashed_plan
157+
state: stash
158+
no_log: true
159+
160+
# Load terraform plan file from variable 'stashed_plan'
161+
- name: Load a terraform plan file data from variable 'stashed_plan' into file 'tfplan'
162+
cloud.terraform.plan_stash:
163+
path: tfplan
164+
var_name: stashed_plan
165+
state: load
166+
no_log: true
167+
168+
# Load terraform plan file from binary data
169+
- name: Load a terraform plan file data from binary data
170+
cloud.terraform.plan_stash:
171+
path: tfplan
172+
binary_data: "{{ terraform_binary_data }}"
173+
state: load
174+
no_log: true
175+
176+
177+
178+
179+
Status
180+
------
181+
182+
183+
Authors
184+
~~~~~~~
185+
186+
- Aubin Bikouo (@abikouo)

0 commit comments

Comments
 (0)