I decided to write a simple script, but something went wrong, I hope for your help.
---
- name: Reset root password, disable users hosts: all become: yes become_user: root vars: vault_ansible_production_root_password: 123456 tasks: - name: Reset root password user: name: root password: "{{vault_ansible_production_root_password}}" update_password: always - name: Disable user accounts user: name: "*" state: absent uid: ">=1000" remove: yesERROR! conflicting action statements: user, update_password
The error appears to be in '/etc/an_script/work.yml': line 8, column 7, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks: - name: Reset root password ^ here PS
I'm just starting, please don't throw too many tomatoes )))
1 Answer
Indentation's wrong.
With your current code, "user" and "update_password" are at the same level: Ansible doesn't know which one is the plugin to call: conflicting statement
Try this instead:
tasks:
- name: Reset root password user: name: root password: "{{vault_ansible_production_root_password}}" update_password: alwaysSee docs, params of that module should be one level down: