mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
683 B
YAML
28 lines
683 B
YAML
5 years ago
|
---
|
||
|
|
||
|
- name: Set root password
|
||
|
mysql_user:
|
||
|
name: root
|
||
|
password: '{{ root_password }}'
|
||
|
login_user: root
|
||
|
login_password: '{{ root_password }}'
|
||
|
check_implicit_admin: yes
|
||
|
login_unix_socket: '{{ mysql_socket }}'
|
||
|
register: result
|
||
|
|
||
|
- name: assert root password is changed
|
||
|
assert: { that: "result.changed == true" }
|
||
|
|
||
|
- name: Set root password again
|
||
|
mysql_user:
|
||
|
name: root
|
||
|
password: '{{ root_password }}'
|
||
|
login_user: root
|
||
|
login_password: '{{ root_password }}'
|
||
|
check_implicit_admin: yes
|
||
|
login_unix_socket: '{{ mysql_socket }}'
|
||
|
register: result
|
||
|
|
||
|
- name: Assert root password is not changed
|
||
|
assert: { that: "result.changed == false" }
|