For example,
-
debconf requires the command line debconf tools.
-
mysql_db requires
python-mysqldb
(for apt) orMySQL-python
(for yum).
-
System modules / debconf: Configure a .deb package.
-
Database modules / mysql_db: Add or remove MySQL databases from a remote host.
-
Database modules / mysql_user: Adds or removes a user from a MySQL database.
Raw SQL statements vs Ansible mysql_*
modules.
How to make the debconf
step idempotent?
The first time of successful execution, the output is:
TASK: [auto set root password for mysql] **************************************
changed: [default] => (item=mysql-server/root_password)
changed: [default] => (item=mysql-server/root_password_again)
But after that, the output should not be in the "changed" state again. It should be either in the "ok" state:
TASK: [auto set root password for mysql] **************************************
ok: [default]
ok: [default]
or even better, in the "skippping" state:
TASK: [auto set root password for mysql] **************************************
skipping: [default]
skipping: [default]