Skip to content

Commit

Permalink
Always quote extra vars to support values with spaces (#57)
Browse files Browse the repository at this point in the history
* Always quote extra vars to support values with spaces

* Ensure extra vars are quoted

This fixes a bug when the values in extra vars have spaces in them.

---------

Co-authored-by: Mike Graves <[email protected]>
  • Loading branch information
AlexPykavy and gravesm authored Apr 4, 2024
1 parent 144251b commit e57ffda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/quote-extra-vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- ensure extra vars are quoted (https://github.com/ansible/terraform-provider-ansible/pull/57).
2 changes: 1 addition & 1 deletion provider/resource_playbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func resourcePlaybookCreate(ctx context.Context, data *schema.ResourceData, meta
})
}

args = append(args, "-e", key+"="+tmpVal)
args = append(args, "-e", fmt.Sprintf("%s='%s'", key, tmpVal))
}
}

Expand Down

0 comments on commit e57ffda

Please sign in to comment.