我收到类似 ERROR 的错误!操作中的意外参数类型:<class 'ansible.parsing.yaml.objects.AnsibleSequence'>,当 运行 ansible
I am getting error like ERROR! unexpected parameter type in action: <class 'ansible.parsing.yaml.objects.AnsibleSequence'>, when running ansible
当我尝试在 ansible 中 运行 这段代码时,我收到类似
的错误
ERROR! unexpected parameter type in action: <class 'ansible.parsing.yaml.objects.AnsibleSequence'
The error appears to be in '/home/c22377/icoms1.yml': line 15, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
handlers:
- name: starting one time job
^ here
我需要使用处理程序,你能纠正我吗?
---
- hosts: catl
name: "checking file ran or not"
tasks:
- shell: tail -1 test/test.log|awk '{print ,,}'
register: result
- shell: date | awk '{print ,,}'
name: checking todays date
register: time
- debug:
msg: "{{ result.stdout }}"
when: result.stdout == time.stdout
notify: starting one time job
handlers:
- name: starting one time job
tasks:
- shell: date
更改自:
handlers:
- name: starting one time job
tasks:
- shell: date
至:
handlers:
- name: starting one time job
shell: date
当我尝试在 ansible 中 运行 这段代码时,我收到类似
的错误ERROR! unexpected parameter type in action: <class 'ansible.parsing.yaml.objects.AnsibleSequence'
The error appears to be in '/home/c22377/icoms1.yml': line 15, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
handlers:
- name: starting one time job
^ here
我需要使用处理程序,你能纠正我吗?
---
- hosts: catl
name: "checking file ran or not"
tasks:
- shell: tail -1 test/test.log|awk '{print ,,}'
register: result
- shell: date | awk '{print ,,}'
name: checking todays date
register: time
- debug:
msg: "{{ result.stdout }}"
when: result.stdout == time.stdout
notify: starting one time job
handlers:
- name: starting one time job
tasks:
- shell: date
更改自:
handlers:
- name: starting one time job
tasks:
- shell: date
至:
handlers:
- name: starting one time job
shell: date