Ask Your Question
0

Cannot solve mysql quest? help!

asked 2015-12-26 11:59:34 -0500

straticus1 gravatar image

updated 2015-12-27 21:28:31 -0500

lupin gravatar image

please help with the mysql quest, here is my site.pp:

node 'learning.puppetlabs.vm' {
  #Disable include ntp
  #include ntp 
class { 'ntp':
     servers => [
       'nist-time-server.eoni.com',
       'nist1-lv.ustiming.org',
       'ntp-nist.ldsbc.edu'
     ]
 }
 include ::mysql::server::account_security
class { '::mysql::server':
    root_password    => 'strongpassword',
    override_options => {
      'mysqld'       =>  { 'max_connections' => '2048' }, 
  mysql_database { 'lvm':
    ensure  => present,
    charset => 'utf-8',
    }
  mysql_user { 'lvm_user@localhost':
  ensure => present,
  }
  mysql_grant { 'lvm_user@localhost/lvm.*':
   ensure    => present,
   options   => ['GRANT'],
   prvileges => ['ALL'],
   table     => 'lvm.*',
   user      => 'lvm_user@localhost', }}
  }
 }
}

here is my error:

root@learning:~ # puppet parser validate /etc/puppetlabs/code/environments/production/manifests/site.pp Error: Could not parse for environment production: Syntax error at 'mysql_user' at /etc/puppetlabs/code/environments/production/manifests/site.pp:52:3 root@learning:~ # [4] 0:bash* Quest: Mysql - Progress: 4/5 Tasks.

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
0

answered 2015-12-27 21:46:28 -0500

Anandk gravatar image

updated 2015-12-27 21:50:39 -0500

Usually points to a syntax error in you manifests. From the looks of it there is maybe too many or too little brackets. Recheck your code again.

Try using this with your manifest:

puppet --parseonly
edit flag offensive delete link more

Comments

that is not a valid option for my puppet. I am using the learning VM. Where is the brace error? Or better yet, where are the answers to the quests?

straticus1 gravatar imagestraticus1 ( 2015-12-28 15:36:24 -0500 )edit
0

answered 2015-12-29 20:54:21 -0500

GregLarkin gravatar image

updated 2015-12-29 20:55:15 -0500

You have several problems with matching braces in your code. I would suggest going back and indenting everything consistently with closing braces on separate lines. Once you do that, you'll find the syntax error very quickly.

Keep using puppet parser validate on your code in order to figure out what to fix next after each correction.

edit flag offensive delete link more
0

answered 2015-12-31 04:03:18 -0500

YevgenyT gravatar image

Writing your code in IDE like Geppetto would help much is situations where you might miss a comma or bracket.

edit flag offensive delete link more
0

answered 2016-01-03 22:14:58 -0500

ITTech gravatar image

Stumbled on this too. The types (i.e. mysqluser, mysqldatabase, and mysql_grant) do not go into the class. Instead they go in at the node level. FYI- the last brace in the code box below kept falling out of the box.

node 'learning.puppetlabs.vm' {
 class { 'ntp':
     servers => [
           'nist-time-server.eoni.com',
               'nist1-lv.ustiming.org',
                   'ntp-nist.ldsbc.edu'
                     ]
 }
 class { '::mysql::server':
         root_password    => 'strongpassword',
         override_options => {
               'mysqld'   =>  { 'max_connections' => '1024' }
                             },
 }
 include ::mysql::server::account_security
 mysql_user { 'lvm_user@localhost':
       ensure => present,
         }
 mysql_database { 'lvm':
       ensure => present,
       charset => 'utf8',
                 }
mysql_grant { 'lvm_user@localhost/lvm.*':
       ensure => present,
       options => ['GRANT'],
       privileges => ['ALL'],
       table => 'lvm.*',
       user => 'lvm_user@localhost',
                         }

}

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-12-26 11:59:34 -0500

Seen: 199 times

Last updated: Dec 31 '15