What gives? With this SaltStack script, everything happens except the assignment, where the posted error occurs:
{% if grains['os'] == 'Windows' %}
stop_teamviewer:
service.dead:
- name: TeamViewer
remove_previous_host:
pkg.purged:
- name: teamviewer-host
remove_previous_installation:
pkg.removed:
- name: teamviewer-12
load_teamviewer_packages:
file.recurse:
- name: 'C:/Users/adminW/Documents/teamviewer'
- source: salt://packages/windows/admin/teamviewer
- replace: True
- required_in: install_teamviewer
install_teamviewer:
pkg.installed:
- name: teamviewer-host
- version: 13.2.5287
- required_in: assign_teamviewer
assign_teamviewer:
cmd:
- run
- name: C:\Users\adminW\Documents\teamviewer\TeamViewer_Assignment.exe -apitoken {{ pillar['teamviewer_apitoken'] }} -datafile "${ProgramFiles(x86)}\TeamViewer\AssignmentData.json" -allowEasyAccess=false devicealias={{ grains['id'] }} -wait=30
{% endif %}
{% if pillar['teamviewer'] is defined
and pillar['teamviewer'] == 'Full' %}
teamviewer_13:
pkg.installed:
- name: teamviewer-13
{% endif %}
start_teamviewer:
service.running:
- name: TeamViewer
The error when "assign_teamviewer" is attempted:
----------
ID: assign_teamviewer
Function: cmd.run
Name: C:\Users\adminW\Documents\teamviewer\TeamViewer_Assignment.exe -apitoken xxx -datafile "${ProgramFiles(x86)}\TeamViewer\AssignmentData.json" -allowEasyAccess=false devicealias=yyyy -wait=30
Result: False
Comment: Command "C:\Users\adminW\Documents\teamviewer\TeamViewer_Assignment.exe -apitoken xxx -datafile "${ProgramFiles(x86)}\TeamViewer\AssignmentData.json" -allowEasyAccess=false devicealias=yyyy -wait=30" run
Started: 13:35:40.796000
Duration: 10112.0 ms
Changes:
----------
pid:
6508
retcode:
1
stderr:
stdout:
TeamViewer_Assignment (r345)
..........
=> Assignment failed with:
Reading datafile 'C:\Program Files (x86)\TeamViewer\AssignmentData.json' failed with: File not found
And when I check the machine itself, there's a TeamViewer.json file, as if I'd tried installing the full version (which isn't installed, just the Host is).