GPG Renderer

In the GPG Renderer lesson I'm having difficulty with by CentOS minion and the mysql_user.present function:
----------
ID: mysql_root_user
Function: mysql_user.present
Name: root
Result: False
Comment: MySQL Error 1142: SELECT command denied to user ''@'localhost' for table 'user'
Started: 23:40:45.612899
Duration: 12.25 ms
Changes:

my Ubuntu minion is able to apply the state without issue, but it looks like it may not be correctly retrieving the pillar data for the 'name' parameter of this function when applying the state to the CentOS minion. 

Any tips? Triple checked that everything matches the lesson and the entire mysql state worked fine prior to adding this data to pillar
  • post-author-pic
    Elle K
    12-10-2018

    Hey, Timothy! Can you share your pillar file and mysql_root_user state with me?

    Also, does Salt retreive the correct value when you run the following?:

    sudo salt 'minion2' pillar.get  mysql:root:name

  • post-author-pic
    thorner
    12-12-2018

    Hi, Elle! Thanks for the reply. I'm loving the course so far! I couldn't find a way to DM the files to you, so I'll post them below:

    Pillar file:

    #!yaml|gpg

    mysql:
    root:
    name: root
    password: |
    -----BEGIN PGP MESSAGE-----

    hQGMA1Phf4794bAjAQwA7TGIBS9NtPks1OmciOoDZdFfIO1zWjpovP7Mv2G0xwHe
    SJ5aquZxgTR9NUFmZVPiZQ8Hg6ym5MG1zZ+1FpgBroZ23MzxjFDP3CUe3/xomfdk
    b+FF84Js9Uk4x06P1JB9sp2fBfXdPkcCtAmpWpN3fRECEW5vQvss3x3gdXXnRIHI
    v9T2Tkes90B3DsvHx8FCEOz3V0LMI4wVCMXVlNAZUQVac2/d3ArZpc/fWEwjTAAD
    KSTN02CzBvTx8dIIUQPWr5xVFGG2dP4lgyrVGgyDh/YwoBFlpaECtURmn0FtZfY2
    Duz1+jJZ0N7iBYPSnJI++7e53FKaMFZU+vW/YAZVDlss4ggiA8S0D6PtFB+5xfxe
    MdVn4FOOuG1R11wMNCN0hOVeSHfCaDB5H57o4TLbiiBKPxyM4Rg857xp0WiR+1sU
    14GZr9SxEo9nfq4cA1WlWZ3O1KcKArI6VtWJsfrIcHfxYIxFn3JG8m0PDJxxFrx6
    oIEM755JNJF8uZVd3pMp0kMBCth4avCLjcXwhVCE7VnB+RFkoOoQqyLDjBeQIvlQ
    uRG1E7puCb4/XzEhtZx+ocU4sx1/qVaEemav3d6vGYXlqCOH
    =2PbK
    -----END PGP MESSAGE-----

    mysql_root_user:
    mysql_root_user:
    mysql_user.present:
    - name: {{ pillar['mysql']['root']['name'] }}
    - password: {{ pillar['mysql']['root']['password'] }}
    - host: localhost


    Also, it does look like salt is able to retrieve the correct name from pillar:

    gibl3t@salt:/srv/salt/mysql$ sudo salt 'minion2' pillar.get mysql:root:name
    minion2:
    root


Looking For Team Training?

Learn More