【发布时间】:2021-01-08 22:52:27
【问题描述】:
所以我正在尝试运行一个小剧本来测试此处记录的 openssl_certificate 模块:https://docs.ansible.com/ansible/2.7/modules/openssl_certificate_module.html
我的剧本:
---
- name: play to run opensll verification
hosts: localhost
tasks:
- name: Running OpenSSL Module.
openssl_certificate:
path: "bleh.crt"
provider: assertonly
valid_in: "{{ (20*3600*24) | int }}"
register: VALIDATION_OUTPUT
ignore_errors: true
基本上我想看看证书在给定的时间范围内是否有效。但是,当我运行时
ansible-playbook openssl_test.yml
我明白了:
ERROR! 'openssl_certificate' is not a valid attribute for a Play
The error appears to be in '/path/to/my/yaml/openssl_test.yml': line 6, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: Running OpenSSL Module.
^ here
我在这里做错了什么?我敢肯定这是小事。
【问题讨论】:
-
你的缩进错误;它应该在
tasks:下,但您将其作为顶级列表项,而剧本中的顶级项是 Plays
标签: ssl ansible yaml ssl-certificate