Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting manage_repo to false breaks server install #38

Merged
merged 9 commits into from
Jan 16, 2015

Conversation

genebean
Copy link

You have this chunk of code in zabbix::web

# Check if manage_repo is true.
  if $manage_repo {
    if ! defined(Class['zabbix::repo']) {
      class { 'zabbix::repo':
        zabbix_version => $zabbix_version,
      }
    }
  } # END if $manage_repo

but nothing that ensures it runs before the this chunk in the same file:

default : {
      package { "zabbix-web-${db}":
        ensure  => $zabbix_package_state,
        before  => [
          File['/etc/zabbix/web/zabbix.conf.php'],
          Package['zabbix-web']
        ],
        require => Class['zabbix::repo'],
      }

This causes the following error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Package[zabbix-web-mysql] { require => Class[Zabbix::Repo] }, because Class[Zabbix::Repo] doesn't seem to be in the catalog

I see how to fix this and will be submitting a pull request shortly but wanted to go ahead and list it as a bug in case anyone else is effected by this.

…done in zabbix::repo so that it only runs if repos are being managed. This makes requiring the class or including the class work even if not managing the repos.
@genebean
Copy link
Author

While testing the fix for this I found another bug that I will try to also address:

Error: Parameter name failed on Mysql_user[zabbix-server@localhost]: Database user zabbix-server@localhost must be properly quoted, invalid character: '-'     
Wrapped exception:                                                                                                                                             
Database user zabbix-server@localhost must be properly quoted, invalid character: '-'                                                                          

@genebean
Copy link
Author

When viewing the changes to zabbix::repo it is much easier if you disable showing changes in whitespace.

@dj-wasabi
Copy link
Contributor

Thanks!
Before I approve, did you also look at the rspec tests? They fail on my machine with this pull request. If you don't have experience with it, please tell me than I'll fix it (No worries ;-)). But I need to fix it first before approving this request.

Kind regards,
Werner

@genebean
Copy link
Author

I've done a little rspec before, what is your test environment? AKA, version of puppet, version of ruby, etc? is bundle exec rake rspec your test command? I added a Travis-CI config file to help with testing to the branch I am working on. Is this what you see test wise too? https://travis-ci.org/genebean/puppet-zabbix

@genebean
Copy link
Author

it seems you call a file named spec/spec.opts in your rspec but that is not in the repo. I am going to manually make one for now just so the tests will run...

@genebean
Copy link
Author

So, I have gathered that I should call bundle exec rake spec to utilize the fixtures but seem to be missing something. Can you share what your testing setup is and, if you have one, your Vagrantfile?

Also, once this is setup the way it needs to be, I'll go back and squash my commits so that only useful ones show up as opposed to having multiple ones where I am hacking on Travis's setup and the like.

@dj-wasabi
Copy link
Contributor

Hi Genebean,

At the moment, I'm running the 'rake spec' command locally on my Mac, as I'm developing on the mac. I'am however busy with my internal Jenkins instance to run the 'rake spec' automatically with every push I make. It takes some time though. I was testing with puppet 3.4.3 and ruby 2.0.0 and just upgraded to puppet 3.7.3 on my mac. (And I just noticed with the new puppet I have an error.. :-))

Kind regards,
Werner

@genebean
Copy link
Author

Thanks. I have a Mac too so I will try it there and see what happens.

@genebean
Copy link
Author

In the process of looking at this I found in some of my tests that the zabbix-server process is trying to start too soon. I think this can be resolved via commit genebean/puppet-zabbix@1b89db8

As for the tests, I haven't had a chance to try on my Mac but any help you could give would be greatly appreciated.

@f0
Copy link
Contributor

f0 commented Jan 15, 2015

+1

dj-wasabi added a commit that referenced this pull request Jan 16, 2015
setting manage_repo to false breaks server install
@dj-wasabi dj-wasabi merged commit bd4cc4b into voxpupuli:master Jan 16, 2015
@dj-wasabi
Copy link
Contributor

Thanks! Will take a look at the rspecs.. no worries ;-)

@genebean
Copy link
Author

Awesome

@dj-wasabi
Copy link
Contributor

Updated the rspec tests, work now. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants