Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspect components, ansible_managed templatable #83053

Merged
merged 14 commits into from Apr 23, 2024
Merged

Conversation

bcoca
Copy link
Member

@bcoca bcoca commented Apr 16, 2024

fixes #82322

ISSUE TYPE
  • Bugfix Pull Request

@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. has_issue labels Apr 16, 2024
@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Apr 16, 2024
@webknjaz webknjaz added the ci_verified Changes made in this PR are causing tests to fail. label Apr 16, 2024
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Apr 18, 2024
@ansible ansible deleted a comment from ansibot Apr 18, 2024
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Apr 18, 2024
@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 18, 2024
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Apr 18, 2024
@ansibot ansibot removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. ci_verified Changes made in this PR are causing tests to fail. labels Apr 18, 2024
@bcoca bcoca marked this pull request as ready for review April 18, 2024 22:02
@ansible ansible deleted a comment from ansibot Apr 18, 2024
lib/ansible/template/__init__.py Outdated Show resolved Hide resolved
@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Apr 19, 2024
@ansibot ansibot added the stale_review Updates were made after the last review and the last review is more than 7 days old. label Apr 19, 2024
changelogs/fragments/ansible_managed_restore.yml Outdated Show resolved Hide resolved
lib/ansible/template/__init__.py Outdated Show resolved Hide resolved
@ansibot ansibot removed the stale_review Updates were made after the last review and the last review is more than 7 days old. label Apr 19, 2024
@mattclay
Copy link
Member

There are several string values in temp_vars which shouldn't be treated as templates, but could potentially contain values that look like templates. These should be marked unsafe:

  • template_host
  • template_path
  • template_uid
  • template_destpath
  • template_fullpath

temp_vars = {
'template_host': to_text(os.uname()[1]),
'template_path': path,
'template_mtime': datetime.datetime.fromtimestamp(os.path.getmtime(b_path)),
'template_uid': to_text(template_uid),
'template_run_date': datetime.datetime.now(),
'template_destpath': to_native(dest_path) if dest_path else None,
}
if fullpath is None:
temp_vars['template_fullpath'] = os.path.abspath(path)
else:
temp_vars['template_fullpath'] = fullpath

@ansibot ansibot added stale_review Updates were made after the last review and the last review is more than 7 days old. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 19, 2024
@webknjaz
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ansibot ansibot removed the stale_review Updates were made after the last review and the last review is more than 7 days old. label Apr 22, 2024
@bcoca bcoca merged commit 124d031 into ansible:devel Apr 23, 2024
66 checks passed
@bcoca bcoca deleted the amangedly branch April 23, 2024 16:44
bcoca added a commit to bcoca/ansible that referenced this pull request Apr 23, 2024
* inspect components, ansible_managed templatable

fixes ansible#82322

(cherry picked from commit 124d031)
bcoca added a commit to bcoca/ansible that referenced this pull request Apr 23, 2024
* inspect components, ansible_managed templatable

fixes ansible#82322

(cherry picked from commit 124d031)
sivel pushed a commit that referenced this pull request Apr 24, 2024
* inspect components, ansible_managed templatable

fixes #82322

(cherry picked from commit 124d031)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. has_issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of ansible_managed variable changes in 2.16
4 participants