Bad checksum error with Ansible win_template -


i've made first playbook targets windows hosts , i'm having trouble creating config file jinja2 template.

the playbook split multiple roles.

this particular task, creates config file, in 1 of roles (app-framework).

the templating of config file has worked in role reason failing now, , can't figure out changed break it.

win_template throws error "copied file not match checksum.".

$ ansible-playbook main.yml --step -vvvv  ... ... ...  task [app-framework : create config file] ************************************************************************************************************* task path: /opt/oll/ansible/playbooks/win_imx/roles/app-framework/tasks/main.yml:101 using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_stat.ps1 exec (via pipeline wrapper) exec (via pipeline wrapper) exec (via pipeline wrapper) using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_stat.ps1 exec (via pipeline wrapper) <server.domain.com> put "/tmp/tmpugoqqs" "c:\users\ansible\appdata\local\temp\ansible-tmp-1502739932.8-151585893875217\source" using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_copy.ps1 exec (via pipeline wrapper) fatal: [server.domain.com]: failed! => {     "changed": true,     "dest": "\"c:\\program files\\app\\framework\\app.exe.config",     "failed": true,     "msg": "copied file not match checksum. src: b863b2bd4ff7f1803e96c28f4640b60025165277, dest: 1. failed copy file c:\\users\\ansible\\appdata\\local\\temp\\ansible-tmp-1502739932.8-151585893875217\\source \"c:\\program files\\app\\framework\\app.exe.config",     "original_basename": "app.exe.config.j2",     "src": "c:\\users\\ansible\\appdata\\local\\temp\\ansible-tmp-1502739932.8-151585893875217\\source" } 

the taskfile role looks in essence this

--- - name: service info   win_service:     name: appservice   register: appservice   - set_fact:     tehcservice_bin_path: "{{ appservice.path | win_dirname }}"   - name: create config file   win_template:     src: templates/app.exe.config.j2     dest: "{{ tehcservice_bin_path }}\\app.exe.config"   - name: start appservice   win_service:     name: appservice     state: started     start_mod: auto 

a simple playbook template task works

labb_win_template.yml --- - name: test win template   hosts: server.domain.com   strategy: debug   vars:     tehcservice_bin_path: c:\program files\app\framework    tasks:     - name: create config file       win_template:         src: roles/app-framework/templates/app.exe.config.j2         dest: "{{ tehcservice_bin_path }}\\app.exe.config"   $ ansible-playbook labb_win_template.yml -vvvv  task [create config file] ************************************************************************************************************************************** task path: /opt/ansible/playbooks/win_imx/labb_win_template.yml:16 using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_stat.ps1 exec (via pipeline wrapper) exec (via pipeline wrapper) exec (via pipeline wrapper) using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_stat.ps1 exec (via pipeline wrapper) <server.domain.com> put "/tmp/tmpc5tbjs" "c:\users\ansible\appdata\local\temp\ansible-tmp-1502740178.37-223031986905823\source" using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_copy.ps1 exec (via pipeline wrapper) changed: [server.domain.com] => {     "changed": true,     "checksum": "b863b2bd4ff7f1803e96c28f4640b60025165277",     "dest": "c:\\program files\\app\\framework\\app.exe.config",     "operation": "file_copy",     "original_basename": "source",     "size": 1678,     "src": "c:\\users\\ansible\\appdata\\local\\temp\\ansible-tmp-1502740178.37-223031986905823\\source" } 

using role test playbook not work either , gives same error.

labb_win_template.yml --- - name: test win template   hosts: server.domain.com   strategy: debug   vars:     tehcservice_bin_path: c:\program files\app\framework    roles:     - app-framework 

my control node running on rhel 7.3 ansible installed repo.

$ ansible --version ansible 2.3.1.0   config file = /opt/ansible/playbooks/win_imx/ansible.cfg   configured module search path = default w/o overrides   python version = 2.7.5 (default, aug  2 2016, 04:20:16) [gcc 4.8.5 20150623 (red hat 4.8.5-4)] 

any suggestions on how can troubleshoot further?

can turn on more debugging somehow -vvvv?

thanks!

edit:
added task file role i'm using.

i've narrowed down using win_dirname on path starting double quotes gets path messed somehow.

for example, using path of these services fails

ps> get-ciminstance -classname win32_service | ? { $_.pathname -like '"*' } | select name, pathname  name                         pathname ----                         -------- healthservice                "c:\program files\microsoft monitoring agent\agent\healthservice.exe" lpasvc                       "c:\program files\microsoft policy platform\policyhost.exe" /service lppsvc                       "c:\program files\microsoft policy platform\policyhost.exe" /service vgauthservice                "c:\program files\vmware\vmware tools\vmware vgauth\vgauthservice.exe" vmtools                      "c:\program files\vmware\vmware tools\vmtoolsd.exe" 

whereas using of these works

ps> get-ciminstance -classname win32_service | ? { $_.pathname -notlike '"*' } | select name, pathname  name                         pathname ----                         -------- spooler                      c:\windows\system32\spoolsv.exe c2wts                        c:\program files\windows identity foundation\v3.5\c2wtshost.exe vmicvss                      c:\windows\system32\svchost.exe -k localsystemnetworkrestricted 


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -