gpt4 book ai didi

python - Ansible:错误!任务中未检测到任何操作

转载 作者:太空宇宙 更新时间:2023-11-04 09:26:43 27 4
gpt4 key购买 nike

我收到以下错误消息:

fatal: [127.0.0.1]: FAILED! => {"failed": true, "reason": "ERROR! no action detected in task\n\nThe error appears to have been in '/etc/ansible/roles/user-manage/tasks/add-users.yml': line 8, column 4, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Add multiple users\n ^ here\n"}

这是它提示的我的剧本:

 - name: Add new group if it doesn't exist already
group:
name: "{{ item }}"
with_items:
- "{{ group_add }}"
when: group_add is defined

- name: Add multiple users
users:
name: "{{ item.users_name }}"
comment: "{{item.users_comment }}"
uid: "{{ item.users_uid }}"
group: "{{ item.users_group }}"
groups: "{{ item.users_groups }}"
shell: "{{ item.users_shell }}"
state: "{{ item.users_state }}"
append: yes
with_items:
- "{{ users_add }}"

- name: Add SSH key for user
authorized_key:
user: "{{ item.name }}"
key: "{{ lookup('file', '/etc/ansible/files/keys/{{ item.users_name }}.pub') }}"
with_items:
- "{{ users_add }}"

这只是昨晚的工作。我不确定是什么原因造成的。有什么想法吗?

最佳答案

没有users 模块。正确的名字是user .删除 s 即可。

关于python - Ansible:错误!任务中未检测到任何操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35586014/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com