- hosts: localhost tasks: - name: Set bind-address template: src: files/pterodactyl-mariadb-server.cnf.j2 dest: /etc/my.cnf.d/pterodactyl-mariadb-server.cnf owner: root group: root mode: '0644' vars: IPv4: "{{ansible_default_ipv4.address}}" - name: Create pterodactyl user mysql_user: name: pterodactyl password: "{{mysql_root_password}}" host: "{{ansible_default_ipv4.address}}" priv: '*.*:ALL,GRANT' state: present