Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,42 @@ The cloud.terraform collection Release Notes
.. contents:: Topics


v2.0.0
======

Breaking Changes / Porting Guide
--------------------------------

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


Major Changes
-------------

- terraform_provider - Added ``search_child_modules`` option (https://github.com/ansible-collections/cloud.terraform/pull/55).
- 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).

Minor Changes
-------------

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


Bugfixes
--------

- 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)
- module_utils - Allow ``nested_type`` attribute in terraform schema. (https://github.com/ansible-collections/cloud.terraform/issues/93)
- 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)
- terraform - fix spaces between characters in command field in result (https://github.com/ansible-collections/cloud.terraform/pull/76).
- move test requirements out of the requirements.txt file (https://github.com/ansible-collections/cloud.terraform/pull/67).
- 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).

v1.1.0
======

Expand Down
37 changes: 37 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,40 @@ releases:
name: terraform_provider
namespace: null
release_date: '2023-03-23'
2.0.0:
changes:
breaking_changes:
- Remove support for ansible-core < 2.14 (https://github.com/ansible-collections/cloud.terraform/pull/102).
bugfixes:
- 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)
- module_utils - Allow ``nested_type`` attribute in terraform schema. (https://github.com/ansible-collections/cloud.terraform/issues/93)
- 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)
- terraform - fix spaces between characters in command field in result (https://github.com/ansible-collections/cloud.terraform/pull/76).
- move test requirements out of the requirements.txt file (https://github.com/ansible-collections/cloud.terraform/pull/67).
- 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).
major_changes:
- terraform_provider - Added ``search_child_modules`` option (https://github.com/ansible-collections/cloud.terraform/pull/55).
- 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).
minor_changes:
- Removed integration tests workaround in terrform_provider. (https://github.com/ansible-collections/cloud.terraform/pull/84)
- Set default of ``state_file`` in terraform_provider inventory plugin to a blank string (https://github.com/ansible-collections/cloud.terraform/pull/55).
- terraform - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
- terraform_output - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
- tf_output - add support for ``workspace`` when running ``terraform output`` (https://github.com/ansible-collections/cloud.terraform/issues/85).
- terraform - cleanup temporary file create during module execution. (https://github.com/ansible-collections/cloud.terraform/issues/2)
fragments:
- 20230524-aws_integration_tests.yml
- 20230913-add-support-for-workspace-when-running-terraform_output.yml
- 20230914-fix-integration-target-terraform_provider.yml
- 20231016-fix-terraform-plan_file-option.yml
- 20231025-fix-aws-sqs.yml
- 20231109-update-supported-ansible-versions.yaml
- 20231110-allow-nested_type-attributes.yml
- 49-command_name_in_binary_path.yaml
- 67-test-requirements.yml
- 76-fix_command_spaces_in_output.yml
- inventory_parse_options.yaml
- standardize_requirements.yml
- terraform-cleanup-file.yml
- terraform_provider_remove_workaround.yml
release_date: '2023-11-17'
4 changes: 2 additions & 2 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - breaking_changes
- Breaking Changes / Porting Guide
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
Expand Down
2 changes: 0 additions & 2 deletions changelogs/fragments/20230524-aws_integration_tests.yml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions changelogs/fragments/20231025-fix-aws-sqs.yml

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions changelogs/fragments/49-command_name_in_binary_path.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions changelogs/fragments/67-test-requirements.yml

This file was deleted.

2 changes: 0 additions & 2 deletions changelogs/fragments/76-fix_command_spaces_in_output.yml

This file was deleted.

5 changes: 0 additions & 5 deletions changelogs/fragments/inventory_parse_options.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions changelogs/fragments/standardize_requirements.yml

This file was deleted.

3 changes: 0 additions & 3 deletions changelogs/fragments/terraform-cleanup-file.yml

This file was deleted.

3 changes: 0 additions & 3 deletions changelogs/fragments/terraform_provider_remove_workaround.yml

This file was deleted.

5 changes: 3 additions & 2 deletions docs/cloud.terraform.terraform_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ Parameters
<td>
</td>
<td>
<div>The path to an existing Terraform plan file to apply. If this is not specified, Ansible will build a new TF plan and execute it.</div>
<div>Note that this option is required if &#x27;state&#x27; has the &#x27;planned&#x27; value. In this case, the plan file is only generated, but not applied.</div>
<div>The path to a Terraform plan file to apply or generate.</div>
<div>When &#x27;check_mode&#x27; is set to <em>True</em> or <em>state=planned</em>, a Terraform plan file with be generated and saved into the specified location.</div>
<div>When &#x27;check_mode&#x27; is set to <em>False</em> and <em>state</em> is set to either <code>present</code> or <code>absent</code>, The existing Terraform plan file will be applied.</div>
</td>
</tr>
<tr>
Expand Down
21 changes: 21 additions & 0 deletions docs/cloud.terraform.terraform_output_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,22 @@ Parameters
<div>The <code>TF_DATA_DIR</code> environment variable is respected.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>workspace</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
<div style="font-style: italic; font-size: small; color: darkgreen">added in 1.2.0</div>
</td>
<td>
</td>
<td>
<div>The terraform workspace to work with.</div>
</td>
</tr>
</table>
<br/>

Expand Down Expand Up @@ -162,6 +178,11 @@ Examples
name: individual_output
format: raw

- name: List outputs from workspace 'dev' in project_dir
cloud.terraform.terraform_output:
project_path: project_dir
workspace: dev



Return Values
Expand Down
122 changes: 76 additions & 46 deletions docs/cloud.terraform.terraform_provider_inventory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Parameters
<b>project_path</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">path</span>
<span style="color: purple">raw</span>
</div>
<div style="font-style: italic; font-size: small; color: darkgreen">added in 1.1.0</div>
</td>
Expand All @@ -93,8 +93,31 @@ Parameters
</td>
<td>
<div>The path to the initialized Terraform directory with the .tfstate file.</div>
<div>If <em>state_file</em> is not specified, <code>terraform.tfstate</code> in <em>project_path</em> is used as an inventory source.</div>
<div>If <em>state_file</em> and <em>project_path</em> are not specified, <code>terraform.tfstate</code> file in the current working directory is used as an inventory source.</div>
<div>If <em>state_file</em> is not specified, Terraform will attempt to automatically find the state file in <em>project_path</em> for use as inventory source.</div>
<div>If <em>state_file</em> and <em>project_path</em> are not specified, Terraform will attempt to automatically find the state file in the current working directory.</div>
<div>Accepts a string or a list of paths for use with multiple Terraform projects.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>search_child_modules</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
<div style="font-style: italic; font-size: small; color: darkgreen">added in 1.2.0</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
</td>
<td>
<div>Whether to include ansible_host and ansible_group resources from Terraform child modules.</div>
</td>
</tr>
<tr>
Expand All @@ -113,8 +136,8 @@ Parameters
</td>
<td>
<div>Path to an existing Terraform state file to be used as an inventory source.</div>
<div>If <em>state_file</em> is not specified, <code>terraform.tfstate</code> in <em>project_path</em> is used as an inventory source.</div>
<div>If <em>state_file</em> and <em>project_path</em> are not specified, <code>terraform.tfstate</code> file in the current working directory is used as an inventory source.</div>
<div>If <em>state_file</em> is not specified, Terraform will attempt to automatically find the state file in <em>project_path</em> for use as inventory source.</div>
<div>If <em>state_file</em> and <em>project_path</em> are not specified, Terraform will attempt to automatically find the state file in the current working directory</div>
</td>
</tr>
</table>
Expand All @@ -128,47 +151,54 @@ Examples

.. code-block:: yaml

# Example configuration file inventory.yml, that creates an inventory from terraform.tfstate file in cwd
plugin: cloud.terraform.terraform_provider
# Running command `ansible-inventory -i inventory.yml --graph --vars` would then produce the inventory:
# @all:
# |--@anothergroup:
# | |--somehost
# | | |--{group_hello = from group!}
# | | |--{group_variable = 11}
# | | |--{host_hello = from host!}
# | | |--{host_variable = 7}
# |--@childlessgroup:
# |--@somegroup:
# | |--@anotherchild:
# | |--@somechild:
# | | |--anotherhost
# | | | |--{group_hello = from group!}
# | | | |--{group_variable = 11}
# | | | |--{host_hello = from anotherhost!}
# | | | |--{host_variable = 5}
# | |--somehost
# | | |--{group_hello = from group!}
# | | |--{group_variable = 11}
# | | |--{host_hello = from host!}
# | | |--{host_variable = 7}
# | |--{group_hello = from group!}
# | |--{group_variable = 11}
# |--@ungrouped:
# | |--ungrupedhost

# Example configuration file that creates an inventory from terraform.tfstate file in selected project directory
plugin: cloud.terraform.terraform_provider
project_path: some/project/path

# Example configuration file that creates an inventory from specified state file
plugin: cloud.terraform.terraform_provider
state_file: some/state/file/path

# Example configuration file that creates an inventory from mycustomstate.tfstate file in selected project directory
plugin: cloud.terraform.terraform_provider
project_path: some/project/path
state_file: mycustomstate.tfstate
- name: Create an inventory from state file in current directory
plugin: cloud.terraform.terraform_provider

# Running command `ansible-inventory -i inventory.yml --graph --vars` would then produce the inventory:
# @all:
# |--@anothergroup:
# | |--somehost
# | | |--{group_hello = from group!}
# | | |--{group_variable = 11}
# | | |--{host_hello = from host!}
# | | |--{host_variable = 7}
# |--@childlessgroup:
# |--@somegroup:
# | |--@anotherchild:
# | |--@somechild:
# | | |--anotherhost
# | | | |--{group_hello = from group!}
# | | | |--{group_variable = 11}
# | | | |--{host_hello = from anotherhost!}
# | | | |--{host_variable = 5}
# | |--somehost
# | | |--{group_hello = from group!}
# | | |--{group_variable = 11}
# | | |--{host_hello = from host!}
# | | |--{host_variable = 7}
# | |--{group_hello = from group!}
# | |--{group_variable = 11}
# |--@ungrouped:
# | |--ungrupedhost

- name: Create an inventory from state file in provided directory
plugin: cloud.terraform.terraform_provider
project_path: some/project/path

- name: Create an inventory from state file in multiple provided directories
plugin: cloud.terraform.terraform_provider
project_path:
- some/project/path
- some/other/project/path

- name: Create an inventory from provided state file
plugin: cloud.terraform.terraform_provider
state_file: some/state/file/path

- name: Create an inventory from state file in provided project directory
plugin: cloud.terraform.terraform_provider
project_path: some/project/path
state_file: mycustomstate.tfstate



Expand Down
Loading