Using Ansible, how can I take actions on each file in a specific location?How can I implement ansible with...

How can guns be countered by melee combat without raw-ability or exceptional explanations?

Is the percentage symbol a constant?

How do I avoid the "chosen hero" feeling?

What does an unprocessed RAW file look like?

How can I keep my gold safe from other PCs?

Does Plato's "Ring of Gyges" have a corrupting influence on its wearer?

Why is Acetic acid (pKa = 4.76) stronger than carbonic acid (pKa = 6.36)?

Can I use a single resistor for multiple LED with different +ve sources?

Do the speed limit reductions due to pollution also apply to electric cars in France?

Why does a single AND gate need 60 transistors?

How to wrap a figure in exam document?

Is the UK legally prevented from having another referendum on Brexit?

What is an efficient way to digitize a family photo collection?

Why is it that Bernie Sanders is always called a "socialist"?

When does a person lose diplomatic status?

Is this Article About Possible Mirrored Universe Junk Science?

Did ancient Germans take pride in leaving the land untouched?

How unreachable are Jupiter's moons from Mars with the technology developed for going to Mars?

Can you say "leftside right"?

Dealing with an internal ScriptKiddie

Explicit chain homotopy for the Alexander-Whitney, Eilenberg-Zilber pair

What is formjacking?

Why did Ylvis use "go" instead of "say" in phrases like "Dog goes 'woof'"?

How bad is a Computer Science course that doesn't teach Design Patterns?



Using Ansible, how can I take actions on each file in a specific location?


How can I implement ansible with per-host passwords, securely?How to manage hosts with multiple sites using Ansible?How to notify a remote service using Ansible?ansible: using host_vars in template filehow can i terminate ec2 instances using ansible dynamic inventory?Creating an instance service file using an ansible templateHow can I log inventory_hostname to a file on the remote using a Playbook?Ansible | Access multi dimensional variable for when conditional in nested loop taskHow to copy a 1 GB file using ansible to remote machine as different remote user and passwordHow can I abstract away Ansible roles?













1















I'm building playbooks to deploy a Windows application that requires some prerequisites (Visual C++ runtimes and dotNet framework) to be installed before the application itself.
These prerequisites are .EXE files and are all contained in a specific folder.



I want to build an Ansible playbook that would (amongst other things) execute each of the .EXE files in the preriquisites folder with the parameters "/install /passive"



I don't want to have to specify each filename in my playbook.



My idea was to first find the prerequisites setup files using the "win_file" module, assign the result to a variable and them iterate over the variable and run the "win_command" module for each file it contains.



Unfortunately, I cannot assign the win_find result to a variable using the register statement, it simply doesn't do anything.



Here is what I tried:



- hosts: "{{ target }}"

tasks:

- name: Find files in path
win_find:
register: myvar
paths: E:TempPrognosis_11.2Prerequisites

- name: debug
debug:
msg: "{{ myvar }}"


And the playbook's output when ran with -v (verbose mode):




TASK [Find files in path] **********************************************************************************************************************************************************



ok: [SMN001] => {"changed": false, "examined": 5, "files": [{"attributes": "Archive", "checksum": "3049a85843eaf65e89e2336d5fe6e85e416797be", "creationtime": 1550942958.6690862, "extension": ".exe", "filename": "NDP46-KB3045557-x86-x64-AllOS-ENU.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.6690862, "lastwritetime": 1459427148, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2PrerequisitesNDP46-KB3045557-x86-x64-AllOS-ENU.exe", "size": 65444688}, {"attributes": "Archive", "checksum": "8bf41ba9eef02d30635a10433817dbb6886da5a2", "creationtime": 1550942958.7627323, "extension": ".exe", "filename": "vcredist2013_x64.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7627323, "lastwritetime": 1489501866, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2013_x64.exe", "size": 7194312}, {"attributes": "Archive", "checksum": "df7f0a73bfa077e483e51bfb97f5e2eceedfb6a3", "creationtime": 1550942958.7779777, "extension": ".exe", "filename": "vcredist2013_x86.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7779777, "lastwritetime": 1489501866, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2013_x86.exe", "size": 6503984}, {"attributes": "Archive", "checksum": "007064d974a55940838f19cd0b0e3aaf27ca06a7", "creationtime": 1550942958.7939014, "extension": ".exe", "filename": "vcredist2017_x64.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7939014, "lastwritetime": 1488965662, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2017_x64.exe", "size": 15261400}, {"attributes": "Archive", "checksum": "ba1f7e7cace62f7c55ab948cd3b29acc4e8e2329", "creationtime": 1550942958.8406758, "extension": ".exe", "filename": "vcredist2017_x86.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.8406758, "lastwritetime": 1488965662, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2017_x86.exe", "size": 14401656}], "matched": 5}



TASK [debug] ***********************************************************************************************************************************************************************



fatal: [SMN001]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'myvar' is undefinednnThe error appears to have been in '/etc/ansible/playbooks/test_find_files.yaml': line 18, column 5, but maynbe elsewhere in the file depending on the exact syntax problem.nnThe offending line appears to be:nnn - name: debugn ^ heren"}




As you can see, the files are properly found, but the "myvar" variable doesn't exist even though it should have been assigned.



According to this page, this logic does seem to work on Linux hosts: http://www.mydailytutorials.com/using-ansible-find-module-search-filesfolder/ (ref "Storing the file names in a register" at the bottom of the page).



Could it be an issue with the win_find module itself?
Any thoughts?



Thanks!










share|improve this question







New contributor




GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • I forgot to mention I'm using Ansible 2.7.7

    – GuillaumeN
    2 hours ago
















1















I'm building playbooks to deploy a Windows application that requires some prerequisites (Visual C++ runtimes and dotNet framework) to be installed before the application itself.
These prerequisites are .EXE files and are all contained in a specific folder.



I want to build an Ansible playbook that would (amongst other things) execute each of the .EXE files in the preriquisites folder with the parameters "/install /passive"



I don't want to have to specify each filename in my playbook.



My idea was to first find the prerequisites setup files using the "win_file" module, assign the result to a variable and them iterate over the variable and run the "win_command" module for each file it contains.



Unfortunately, I cannot assign the win_find result to a variable using the register statement, it simply doesn't do anything.



Here is what I tried:



- hosts: "{{ target }}"

tasks:

- name: Find files in path
win_find:
register: myvar
paths: E:TempPrognosis_11.2Prerequisites

- name: debug
debug:
msg: "{{ myvar }}"


And the playbook's output when ran with -v (verbose mode):




TASK [Find files in path] **********************************************************************************************************************************************************



ok: [SMN001] => {"changed": false, "examined": 5, "files": [{"attributes": "Archive", "checksum": "3049a85843eaf65e89e2336d5fe6e85e416797be", "creationtime": 1550942958.6690862, "extension": ".exe", "filename": "NDP46-KB3045557-x86-x64-AllOS-ENU.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.6690862, "lastwritetime": 1459427148, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2PrerequisitesNDP46-KB3045557-x86-x64-AllOS-ENU.exe", "size": 65444688}, {"attributes": "Archive", "checksum": "8bf41ba9eef02d30635a10433817dbb6886da5a2", "creationtime": 1550942958.7627323, "extension": ".exe", "filename": "vcredist2013_x64.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7627323, "lastwritetime": 1489501866, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2013_x64.exe", "size": 7194312}, {"attributes": "Archive", "checksum": "df7f0a73bfa077e483e51bfb97f5e2eceedfb6a3", "creationtime": 1550942958.7779777, "extension": ".exe", "filename": "vcredist2013_x86.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7779777, "lastwritetime": 1489501866, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2013_x86.exe", "size": 6503984}, {"attributes": "Archive", "checksum": "007064d974a55940838f19cd0b0e3aaf27ca06a7", "creationtime": 1550942958.7939014, "extension": ".exe", "filename": "vcredist2017_x64.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7939014, "lastwritetime": 1488965662, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2017_x64.exe", "size": 15261400}, {"attributes": "Archive", "checksum": "ba1f7e7cace62f7c55ab948cd3b29acc4e8e2329", "creationtime": 1550942958.8406758, "extension": ".exe", "filename": "vcredist2017_x86.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.8406758, "lastwritetime": 1488965662, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2017_x86.exe", "size": 14401656}], "matched": 5}



TASK [debug] ***********************************************************************************************************************************************************************



fatal: [SMN001]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'myvar' is undefinednnThe error appears to have been in '/etc/ansible/playbooks/test_find_files.yaml': line 18, column 5, but maynbe elsewhere in the file depending on the exact syntax problem.nnThe offending line appears to be:nnn - name: debugn ^ heren"}




As you can see, the files are properly found, but the "myvar" variable doesn't exist even though it should have been assigned.



According to this page, this logic does seem to work on Linux hosts: http://www.mydailytutorials.com/using-ansible-find-module-search-filesfolder/ (ref "Storing the file names in a register" at the bottom of the page).



Could it be an issue with the win_find module itself?
Any thoughts?



Thanks!










share|improve this question







New contributor




GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • I forgot to mention I'm using Ansible 2.7.7

    – GuillaumeN
    2 hours ago














1












1








1








I'm building playbooks to deploy a Windows application that requires some prerequisites (Visual C++ runtimes and dotNet framework) to be installed before the application itself.
These prerequisites are .EXE files and are all contained in a specific folder.



I want to build an Ansible playbook that would (amongst other things) execute each of the .EXE files in the preriquisites folder with the parameters "/install /passive"



I don't want to have to specify each filename in my playbook.



My idea was to first find the prerequisites setup files using the "win_file" module, assign the result to a variable and them iterate over the variable and run the "win_command" module for each file it contains.



Unfortunately, I cannot assign the win_find result to a variable using the register statement, it simply doesn't do anything.



Here is what I tried:



- hosts: "{{ target }}"

tasks:

- name: Find files in path
win_find:
register: myvar
paths: E:TempPrognosis_11.2Prerequisites

- name: debug
debug:
msg: "{{ myvar }}"


And the playbook's output when ran with -v (verbose mode):




TASK [Find files in path] **********************************************************************************************************************************************************



ok: [SMN001] => {"changed": false, "examined": 5, "files": [{"attributes": "Archive", "checksum": "3049a85843eaf65e89e2336d5fe6e85e416797be", "creationtime": 1550942958.6690862, "extension": ".exe", "filename": "NDP46-KB3045557-x86-x64-AllOS-ENU.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.6690862, "lastwritetime": 1459427148, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2PrerequisitesNDP46-KB3045557-x86-x64-AllOS-ENU.exe", "size": 65444688}, {"attributes": "Archive", "checksum": "8bf41ba9eef02d30635a10433817dbb6886da5a2", "creationtime": 1550942958.7627323, "extension": ".exe", "filename": "vcredist2013_x64.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7627323, "lastwritetime": 1489501866, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2013_x64.exe", "size": 7194312}, {"attributes": "Archive", "checksum": "df7f0a73bfa077e483e51bfb97f5e2eceedfb6a3", "creationtime": 1550942958.7779777, "extension": ".exe", "filename": "vcredist2013_x86.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7779777, "lastwritetime": 1489501866, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2013_x86.exe", "size": 6503984}, {"attributes": "Archive", "checksum": "007064d974a55940838f19cd0b0e3aaf27ca06a7", "creationtime": 1550942958.7939014, "extension": ".exe", "filename": "vcredist2017_x64.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7939014, "lastwritetime": 1488965662, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2017_x64.exe", "size": 15261400}, {"attributes": "Archive", "checksum": "ba1f7e7cace62f7c55ab948cd3b29acc4e8e2329", "creationtime": 1550942958.8406758, "extension": ".exe", "filename": "vcredist2017_x86.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.8406758, "lastwritetime": 1488965662, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2017_x86.exe", "size": 14401656}], "matched": 5}



TASK [debug] ***********************************************************************************************************************************************************************



fatal: [SMN001]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'myvar' is undefinednnThe error appears to have been in '/etc/ansible/playbooks/test_find_files.yaml': line 18, column 5, but maynbe elsewhere in the file depending on the exact syntax problem.nnThe offending line appears to be:nnn - name: debugn ^ heren"}




As you can see, the files are properly found, but the "myvar" variable doesn't exist even though it should have been assigned.



According to this page, this logic does seem to work on Linux hosts: http://www.mydailytutorials.com/using-ansible-find-module-search-filesfolder/ (ref "Storing the file names in a register" at the bottom of the page).



Could it be an issue with the win_find module itself?
Any thoughts?



Thanks!










share|improve this question







New contributor




GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm building playbooks to deploy a Windows application that requires some prerequisites (Visual C++ runtimes and dotNet framework) to be installed before the application itself.
These prerequisites are .EXE files and are all contained in a specific folder.



I want to build an Ansible playbook that would (amongst other things) execute each of the .EXE files in the preriquisites folder with the parameters "/install /passive"



I don't want to have to specify each filename in my playbook.



My idea was to first find the prerequisites setup files using the "win_file" module, assign the result to a variable and them iterate over the variable and run the "win_command" module for each file it contains.



Unfortunately, I cannot assign the win_find result to a variable using the register statement, it simply doesn't do anything.



Here is what I tried:



- hosts: "{{ target }}"

tasks:

- name: Find files in path
win_find:
register: myvar
paths: E:TempPrognosis_11.2Prerequisites

- name: debug
debug:
msg: "{{ myvar }}"


And the playbook's output when ran with -v (verbose mode):




TASK [Find files in path] **********************************************************************************************************************************************************



ok: [SMN001] => {"changed": false, "examined": 5, "files": [{"attributes": "Archive", "checksum": "3049a85843eaf65e89e2336d5fe6e85e416797be", "creationtime": 1550942958.6690862, "extension": ".exe", "filename": "NDP46-KB3045557-x86-x64-AllOS-ENU.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.6690862, "lastwritetime": 1459427148, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2PrerequisitesNDP46-KB3045557-x86-x64-AllOS-ENU.exe", "size": 65444688}, {"attributes": "Archive", "checksum": "8bf41ba9eef02d30635a10433817dbb6886da5a2", "creationtime": 1550942958.7627323, "extension": ".exe", "filename": "vcredist2013_x64.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7627323, "lastwritetime": 1489501866, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2013_x64.exe", "size": 7194312}, {"attributes": "Archive", "checksum": "df7f0a73bfa077e483e51bfb97f5e2eceedfb6a3", "creationtime": 1550942958.7779777, "extension": ".exe", "filename": "vcredist2013_x86.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7779777, "lastwritetime": 1489501866, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2013_x86.exe", "size": 6503984}, {"attributes": "Archive", "checksum": "007064d974a55940838f19cd0b0e3aaf27ca06a7", "creationtime": 1550942958.7939014, "extension": ".exe", "filename": "vcredist2017_x64.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.7939014, "lastwritetime": 1488965662, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2017_x64.exe", "size": 15261400}, {"attributes": "Archive", "checksum": "ba1f7e7cace62f7c55ab948cd3b29acc4e8e2329", "creationtime": 1550942958.8406758, "extension": ".exe", "filename": "vcredist2017_x86.exe", "isarchive": true, "isdir": false, "ishidden": false, "islnk": false, "isreadonly": false, "isshared": false, "lastaccesstime": 1550942958.8406758, "lastwritetime": 1488965662, "owner": "BUILTINAdministrators", "path": "E:TempPrognosis_11.2Prerequisitesvcredist2017_x86.exe", "size": 14401656}], "matched": 5}



TASK [debug] ***********************************************************************************************************************************************************************



fatal: [SMN001]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'myvar' is undefinednnThe error appears to have been in '/etc/ansible/playbooks/test_find_files.yaml': line 18, column 5, but maynbe elsewhere in the file depending on the exact syntax problem.nnThe offending line appears to be:nnn - name: debugn ^ heren"}




As you can see, the files are properly found, but the "myvar" variable doesn't exist even though it should have been assigned.



According to this page, this logic does seem to work on Linux hosts: http://www.mydailytutorials.com/using-ansible-find-module-search-filesfolder/ (ref "Storing the file names in a register" at the bottom of the page).



Could it be an issue with the win_find module itself?
Any thoughts?



Thanks!







windows ansible ansible-playbook






share|improve this question







New contributor




GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 hours ago









GuillaumeNGuillaumeN

84




84




New contributor




GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






GuillaumeN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • I forgot to mention I'm using Ansible 2.7.7

    – GuillaumeN
    2 hours ago



















  • I forgot to mention I'm using Ansible 2.7.7

    – GuillaumeN
    2 hours ago

















I forgot to mention I'm using Ansible 2.7.7

– GuillaumeN
2 hours ago





I forgot to mention I'm using Ansible 2.7.7

– GuillaumeN
2 hours ago










1 Answer
1






active

oldest

votes


















3














It's just a typo, your register: is too far indented.



It should appear as:



  - name: Find files in path
win_find:
paths: E:TempPrognosis_11.2Prerequisites
register: myvar





share|improve this answer
























  • Argh, I just saw that too, gave it a try and it worked like a charm! Thank you @MichaelHampton :)

    – GuillaumeN
    2 hours ago













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






GuillaumeN is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f955466%2fusing-ansible-how-can-i-take-actions-on-each-file-in-a-specific-location%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














It's just a typo, your register: is too far indented.



It should appear as:



  - name: Find files in path
win_find:
paths: E:TempPrognosis_11.2Prerequisites
register: myvar





share|improve this answer
























  • Argh, I just saw that too, gave it a try and it worked like a charm! Thank you @MichaelHampton :)

    – GuillaumeN
    2 hours ago


















3














It's just a typo, your register: is too far indented.



It should appear as:



  - name: Find files in path
win_find:
paths: E:TempPrognosis_11.2Prerequisites
register: myvar





share|improve this answer
























  • Argh, I just saw that too, gave it a try and it worked like a charm! Thank you @MichaelHampton :)

    – GuillaumeN
    2 hours ago
















3












3








3







It's just a typo, your register: is too far indented.



It should appear as:



  - name: Find files in path
win_find:
paths: E:TempPrognosis_11.2Prerequisites
register: myvar





share|improve this answer













It's just a typo, your register: is too far indented.



It should appear as:



  - name: Find files in path
win_find:
paths: E:TempPrognosis_11.2Prerequisites
register: myvar






share|improve this answer












share|improve this answer



share|improve this answer










answered 2 hours ago









Michael HamptonMichael Hampton

170k27309633




170k27309633













  • Argh, I just saw that too, gave it a try and it worked like a charm! Thank you @MichaelHampton :)

    – GuillaumeN
    2 hours ago





















  • Argh, I just saw that too, gave it a try and it worked like a charm! Thank you @MichaelHampton :)

    – GuillaumeN
    2 hours ago



















Argh, I just saw that too, gave it a try and it worked like a charm! Thank you @MichaelHampton :)

– GuillaumeN
2 hours ago







Argh, I just saw that too, gave it a try and it worked like a charm! Thank you @MichaelHampton :)

– GuillaumeN
2 hours ago












GuillaumeN is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















GuillaumeN is a new contributor. Be nice, and check out our Code of Conduct.













GuillaumeN is a new contributor. Be nice, and check out our Code of Conduct.












GuillaumeN is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f955466%2fusing-ansible-how-can-i-take-actions-on-each-file-in-a-specific-location%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Anexo:Material bélico de la Fuerza Aérea de Chile Índice Aeronaves Defensa...

Always On Availability groups resolving state after failover - Remote harden of transaction...

update json value to null Announcing the arrival of Valued Associate #679: Cesar Manara ...