Salt Stack : Requisites - Having a problem w/mysql_restart sls

When I issue:

sudo salt 'minion2' state.sls mysql.server,mysql.config,mysql.restart
test=true
I understand why it is erroring on it, but not sure how to fix it.
any suggestions appreciated.


 ID: mysql_restart

Function: module.wait

Name: service.restart

Result: False

Comment: The following requisites were not found:

watch:

id: mysql_server_config

Started: 18:02:19.748933

Duration: 0.019 ms

     Changes:


  • post-author-pic
    Elle K
    01-14-2019

    Hi there! Can you supply the server.sls and restart.sls files?

  • post-author-pic
    John C
    01-15-2019

    Hi Elle


    cat server.sls
    mysql_server_install
      pkg.installed:
        - name: mariadb-server
    ***********************************
     cat restart.sls
    mysql_restart:
      module.wait:
        - name: service.restart
        - m_name: mariadb
        - watch:
          - mysql_server_config






  • post-author-pic
    Elle K
    01-16-2019

    Ah, I'm sorry: Can you also include the config.sls file?

  • post-author-pic
    John C
    01-16-2019

    Here you go.. thank you.
    FYI the formatting and spacing are lost when I paste to the ticket.

    $ cat config.sls

    include:

      - mysql.restart

    mysql_server-config:

       file.managed:

        - name: /etc/my.conf.d/server.cnf

        - source: salt://mysql/files/server.cnf

        - require:

          - pkg: mariadb-server

  • post-author-pic
    Elle K
    01-18-2019

    I see the problem! You have a dash instead of an underscore between the server_config part of the mysql_server_config name declaration.

    Just update that and you should be good to go. :)

  • post-author-pic
    John C
    01-22-2019

    Thank you that was it..

    I must have looked at that 20 times and missed it

Looking For Team Training?

Learn More