--- - vars: mysql_parameters: &mysql_params login_user: '{{ mysql_user }}' login_password: '{{ mysql_password }}' login_host: '{{ mysql_host }}' login_port: '{{ mysql_primary_port }}' block: - name: Issue-121 | Setup | Get server certificate copy: content: "{{ lookup('pipe', \"openssl s_client -starttls mysql -connect {{ mysql_host }}:3307 -showcerts 2>/dev/null - # Issue-121 | Create user with both REQUIRESSL privilege and an incompatible # tls_requires option # mysql_user: # <<: *mysql_params # name: "{{ user_name_1 }}" # host: '{{ gateway_addr }}' # password: "{{ user_password_1 }}" # priv: '*.*:SELECT,CREATE USER,REQUIRESSL,GRANT' # tls_requires: # X509: # - name: Issue-121 | Create same user again without REQUIRESSL privilege # mysql_user: # <<: *mysql_params # name: "{{ user_name_1 }}" # password: "{{ user_password_1 }}" # priv: '*.*:SELECT,CREATE USER,GRANT' # tls_requires: # X509: # register: result # - name: Issue-121 | Assert that create same user again without REQUIRESSL is not changed # assert: # that: result is not changed - name: Issue-121 | Teardown | Drop mysql user mysql_user: <<: *mysql_params name: '{{ item }}' host_all: true state: absent with_items: - "{{ user_name_1 }}" - "{{ user_name_2 }}"