Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: execute powershell to get disk space
- win_command: "win_command: 'powershell.exe Get-PSDrive "{{ tmplocation[:1] | quote }}" | Select-Object Free | ConvertTo-Json"
- register: getpsdrive
- - name: Register freediskspace as a fact
- set_fact:
- freediskspace: "{{ (getpsdrive.stdout | from_json).Free // 1073741824 }}"
- - name: Create directory structure
- tags: basic
- win_file:
- path: "{{ tmplocation }}"
- state: directory
- - name: Download software
- win_get_url:
- url: "{{ item.value.url }}"
- dest: "{{ item.value.dst }}"
- force: no
- url_username: "{{ afilerepo_user }}"
- url_password: "{{ afilerepo_password }}"
- loop: "{{ lookup('dict', software,wantlist=True) }}"
- when: freediskspace | int > 5
- - name: execute powershell to get disk space
- win_command: "win_command: 'powershell.exe Get-PSDrive "{{ tmplocation[:1] | quote }}" | Select-Object Free | ConvertTo-Json"
- register: getpsdrive
- - name: Register freediskspace as a fact
- set_fact:
- freediskspace: "{{ (getpsdrive.stdout | from_json).Free // 1073741824 }}"
- - name: Create directory structure
- tags: basic
- win_file:
- path: "{{ tmplocation }}"
- state: directory
- - name: Download software
- win_get_url:
- url: "{{ item.value.url }}"
- dest: "{{ item.value.dst }}"
- force: no
- url_username: "{{ afilerepo_user }}"
- url_password: "{{ afilerepo_password }}"
- loop: "{{ lookup('dict', software,wantlist=True) }}"
- when: freediskspace | int > 5
- The error appears to have been in '/mnt/c/github/ansible-mdt/tasks/downloads.yml': line 2, column 16, but may
- be elsewhere in the file depending on the exact syntax problem.
- The offending line appears to be:
- - name: execute powershell to get disk space
- win_command: "win_command: 'powershell.exe Get-PSDrive "{{ tmplocation[:1] | quote }}" | Select-Object Free | ConvertTo-Json"
- ^ here
- We could be wrong, but this one looks like it might be an issue with
- missing quotes. Always quote template expression brackets when they
- start a value. For instance:
- with_items:
- - {{ foo }}
- Should be written as:
- with_items:
- - "{{ foo }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement