Fix theyvoteforyou_foreman sudoers task using template module - #600
Open
benrfairless wants to merge 4 commits into
Open
Fix theyvoteforyou_foreman sudoers task using template module#600benrfairless wants to merge 4 commits into
benrfairless wants to merge 4 commits into
Conversation
The task used the copy module, which only searches the role's files/ directory. Commit 25d76f8 moved theyvoteforyou_foreman to templates/, so copy could no longer find it and the task failed, halting the play and skipping all subsequent theyvoteforyou tasks. Switch to the template module, matching the equivalent planningalerts task. The file now also contains a {{ bundle_path }} variable that must be rendered, so template is required rather than optional. Set an explicit dest filename since template does not append the basename to a directory dest the way copy does. Resolves #598 Assisted-by: Claude Code:claude-opus-4-8 Signed-off-by: Ben Fairless <ben@oaf.org.au>
…to match what is currently on the server Signed-off-by: Ben Fairless <ben@oaf.org.au>
benrfairless
marked this pull request as ready for review
July 26, 2026 23:08
benrfairless
enabled auto-merge
July 26, 2026 23:08
ianheggie-oaf
requested changes
Jul 28, 2026
ianheggie-oaf
left a comment
Member
There was a problem hiding this comment.
Thanks for fixing my mistake, but there is (now) a merge conflict to be resolved.
ianheggie-oaf
requested changes
Aug 6, 2026
ianheggie-oaf
left a comment
Member
There was a problem hiding this comment.
theyvoteforyou_foreman should have a .j2 extension to follow recently established convention for template files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Ansible task "Allow deploy user to control application services" in the
theyvoteforyourole used thecopymodule, which only searches the role'sfiles/directory. Commit25d76f8bmovedtheyvoteforyou_foremaninto the role'stemplates/directory, socopycould no longer find it. The task failed on every run, halting the play and skipping all subsequenttheyvoteforyoutasks.This switches the task from
copyto thetemplatemodule (which searchestemplates/), matching the equivalent task in theplanningalertsrole. The file now also contains a{{ bundle_path }}variable that needs rendering, sotemplateis required rather than optional. Thedestis set to an explicit filename becausetemplate, unlikecopy, does not append the source basename whendestis a directory.Motivation and Context
Fixes #598. Without this, the
theyvoteforyourole cannot complete a run against the server.How Has This Been Tested?
ansible-lint roles/internal/theyvoteforyou/tasks/main.yml— passes (only the expected informational notice about the custom yamllint config).bundle_pathis defined ingroup_vars/all.yml, so the template renders.planningalertsdeploy_service_controltask (template+ explicitdestfilename).Screenshots (if appropriate):
N/A
Types of Changes
Checklist:
Assisted-by: Claude Code/claude-opus-4-8. AI-generated changes reviewed by the PR author