Skip to content

Instantly share code, notes, and snippets.

@zeitounator
Created May 24, 2023 15:26
Show Gist options
  • Save zeitounator/db82cbec4e65029df79cf2c23d5b0d49 to your computer and use it in GitHub Desktop.
Save zeitounator/db82cbec4e65029df79cf2c23d5b0d49 to your computer and use it in GitHub Desktop.
# Note: this is an exact copy/paste from the question
$ cat test.yml
- hosts: all
name: check patching
gather_facts: 'no'
tasks:
- name: Get list
win_shell: >-
(New-Object -ComObject
Microsoft.Update.Session).CreateupdateSearcher().Search(“IsHidden=0 and
IsInstalled=0”).Updates | Select-Object Title
register: List
- hosts: localhost
tasks:
- name: mail out
host: 1.1.1.1
port: 25
from: [email protected]
to: [email protected]
subject: patches
body: '(( hostvars[''????''][''List''].stdout_lines }}'
$ ansible-playbook test.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
ERROR! conflicting action statements: host, from
The error appears to be in '/tmp/test/test.yml': line 13, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: mail out
^ here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment