Ansible Playbook Percona 8.0 systemctl bootstrap failure

Hi All,

I have question regarding automation I’m doing a playbook to deploy Percona but when I try to start the bootstrap service it fail with the folowing error:

**Job for mysql@bootstrap.service failed because a timeout was exceeded.**
**See "systemctl status mysql@bootstrap.service" and "journalctl -xe" for details.**

****************************************************************************************
  - name: Bootstrap | ensure bootstrap service is started
    shell: systemctl start mysql@bootstrap.service 
    register: result
    retries: 3
    delay: 10
    until: result is not failed
****************************************************************************************

The weird thing here is if I start the service manually it work or if I retry it will start my cnf file is working, as I'm mentioning I can start the service manually or if I retry it on the playbook. 

My CNF J2.

> [client]
> socket=/var/lib/mysql/mysql.sock
> [mysqld]
> server-id=1
> datadir=/var/lib/mysql
> socket=/var/lib/mysql/mysql.sock
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
> skip-name-resolve = on
> default-authentication-plugin=mysql_native_password
> # Binary log expiration period is 604800 seconds, which equals 7 days
> binlog_expire_logs_seconds=604800
> ######## wsrep ###############
> # Path to Galera library
> wsrep_provider=/usr/lib64/galera4/libgalera_smm.so
> # Cluster connection URL contains IPs of nodes
> #If no IP is found, this implies that a new cluster needs to be created,
> #in order to do that you need to bootstrap this node
> wsrep_cluster_address=gcomm://{{percona_node_01_ip_address}},{{percona_node_02_ip_address}},{{percona_node_03_ip_address}}
> # In order for Galera to work correctly binlog format should be ROW
> binlog_format=ROW
> # Slave thread to use
> wsrep_slave_threads=8
> wsrep_log_conflicts
> # This changes how InnoDB autoincrement locks are managed and is a requirement for Galera
> innodb_autoinc_lock_mode=2
> # Node IP address
> wsrep_node_address={{percona_node_01_ip_address}}
> # Cluster name
> wsrep_cluster_name={{percona_cluster_name}}
> #If wsrep_node_name is not specified, then system hostname will be used
> wsrep_node_name={{percona_node_01_hostname}}
> #pxc_strict_mode allowed values: DISABLED,PERMISSIVE,ENFORCING,MASTER
> pxc_strict_mode=ENFORCING
> #PXC Encrypt Cluster Traffic
> pxc-encrypt-cluster-traffic=ON
> # SST method
> wsrep_sst_method=xtrabackup-v2

Hi, it’s possible you are hitting some Ansible timeout. Have you tried running the task asynchronously then polling for the result? Asynchronous actions and polling — Ansible Documentation

Thank you so much, that was the problem.

  • name: Bootstrap | ensure bootstrap service is started
    shell: systemctl start mysql@bootstrap.service
    async: 300
    poll: 5