fanne
fanne

Reputation: 1

use saltstack state.sls to install mysql but not return

I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this.

my saltstack file code in github saltstack file

install mysql salt code:

[root@salt_master srv]# cat salt/base/lnmp_yum/mysql/mysql_install.sls 
repo_init:
  file.managed:
    - name: /etc/yum.repos.d/mysql-{{pillar['mysql_version']}}.repo
    - source: salt://lnmp_yum/mysql/files/mysql-{{pillar['mysql_version']}}.repo
    - user: root
    - group: root
    - mode: 644

mysql_install:
  pkg.installed:
    - names:
      - mysql
      - mysql-server
      - mysql-devel
    - require:
      - file: repo_init    

  service.running:
    - name: mysqld
    - enable: True

after run cmd:

salt 'lnmp_base' state.sls lnmp_yum.mysql.mysql_install -l debug

always print log:

[DEBUG   ] Checking whether jid 20170526144936867490 is still running
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'salt_master_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] Passing on saltutil error. This may be an error in saltclient. 'retcode'
[DEBUG   ] Checking whether jid 20170526144936867490 is still running
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'salt_master_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] Passing on saltutil error. This may be an error in saltclient. 'retcode'
[DEBUG   ] Checking whether jid 20170526144936867490 is still running
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/master', 'salt_master_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] Passing on saltutil error. This may be an error in saltclient. 'retcode'

when i look salt node server, mysql already installed and start,but salt master server always print log, no exit.

I searched for days, but I could not solve it.

the same question when i install jboss.

Thanks in advance.

Upvotes: 0

Views: 488

Answers (1)

RabidCicada
RabidCicada

Reputation: 126

Two thoughts occur to me:

  1. I think mysql has a basic configuration ncurses gui that requires user input to configure (Set default password etc). If I remember that correctly then your salt state is still running and waiting for a human to type at the screen. You can fix this by feeding it an answer/config file. Stolen shamelesly from another post:
sudo debconf-set-selections <<< 'mysql-server-5.6 mysql-server/root_password password your_password'
sudo debconf-set-selections <<< 'mysql-server-5.6 mysql-server/root_password_again password your_password'
sudo apt-get -y install mysql-server-5.6
  1. The other is that it may simply take longer than your salt timeout default for a task. That can be configured in salt at the salt cmd line with -t or the config file (forget which setting)

Upvotes: 1

Related Questions