Execution
Date 18 Sep 2024 12:32:27 +0100
Duration 00:01:22.22
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.2 / 1.7.2
Python 3.10.10
Summary
1 Hosts
17 Tasks
17 Results
1 Plays
1 Files
0 Records

Task result details


Field Value
changed
False
cmd
set -o pipefail
my_root_pass=$(pwgen -s 20 | head -1)
cat > /root/mysql_secure_install.sql << EOF
ALTER USER 'root'@'localhost' IDENTIFIED BY '$my_root_pass';
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DROP DATABASE IF EXISTS test;
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
FLUSH PRIVILEGES;
EOF
mysql -sfu root < /root/mysql_secure_install.sql; rm -f /root/mysql_secure_install.sql
echo -e "[mysql]\nuser=\"root\"\npassword=\"$my_root_pass\"\n" > /root/.my.cnf
delta
0:00:00.025431
end
2024-09-18 11:33:12.990756
invocation
{
    "module_args": {
        "_raw_params": "set -o pipefail\nmy_root_pass=$(pwgen -s 20 | head -1)\ncat > /root/mysql_secure_install.sql << EOF\nALTER USER 'root'@'localhost' IDENTIFIED BY '$my_root_pass';\nDELETE FROM mysql.user WHERE User='';\nDELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');\nDROP DATABASE IF EXISTS test;\nDELETE FROM mysql.db WHERE Db='test' OR Db='test\\\\_%';\nFLUSH PRIVILEGES;\nEOF\nmysql -sfu root < /root/mysql_secure_install.sql; rm -f /root/mysql_secure_install.sql\necho -e \"[mysql]\\nuser=\\\"root\\\"\\npassword=\\\"$my_root_pass\\\"\\n\" > /root/.my.cnf\n",
        "_uses_shell": true,
        "argv": null,
        "chdir": null,
        "creates": null,
        "executable": "/bin/bash",
        "expand_argument_vars": true,
        "removes": null,
        "stdin": null,
        "stdin_add_newline": true,
        "strip_empty_ends": true
    }
}
msg

rc
0
start
2024-09-18 11:33:12.965325
stderr

stderr_lines
[]
stdout

stdout_lines
[]