EERROR! conflicting action statements: user, update_password

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: yes

ERROR! 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 )))

Ran through debug

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: always

See docs, params of that module should be one level down:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like