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

ordering-api-with-pki-after-package #311

Closed
BrianAI opened this issue Jun 14, 2017 · 6 comments
Closed

ordering-api-with-pki-after-package #311

BrianAI opened this issue Jun 14, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@BrianAI
Copy link

BrianAI commented Jun 14, 2017

Expected Behavior

I can configure a module that installs the icinga2 client, configures the zones and generates the PKI key / gets it signed.

Current Behavior

I need to run the puppet module twice due to the pki generation trying before the icinga2 binary exists.

See here:

Notice: /Stage[main]/Pp_icinga2::Client/Package[nagios-plugins-all]/ensure: created
Error: Could not find command 'icinga2'
Error: /Stage[main]/Icinga2::Feature::Api/Exec[icinga2 pki create key]/returns: change from notrun to 0 failed: Could not find command 'icinga2'
Notice: /Stage[main]/Icinga2::Install/File[/etc/icinga2]/ensure: created
Notice: /Stage[main]/Icinga2::Install/Package[icinga2]/ensure: created

On the second run, this works perfectly fine. i've tried ordering with require, or -> and it errors out. here is my manifest:

  `$icinga_master = '[redacted]'
  ) {

  package { 'nagios-plugins-all':
    ensure   => 'latest',
  }

  class { '::icinga2':
    manage_repo => true,
    confd     => false,
    features  => ['checker','mainlog'],
  }

  class { '::icinga2::feature::api':
    pki             => 'icinga2',
    ca_host         => $icinga_master,
    ticket_salt     => '[redacted]',
    accept_config   => true,
    accept_commands => true,
    endpoints       => {
      'NodeName'     => {},
      $icinga_master => {}
    },
    zones           => {
      'ZoneName' => {
        'endpoints' => ['NodeName'],
        'parent'    => 'master',
      },
      'master'      => {
        'endpoints' => [$icinga_master],
      }
    },
  }
}

Thanks!! :)

@lbetz lbetz self-assigned this Jun 19, 2017
@lbetz lbetz added the question label Jun 19, 2017
@lbetz
Copy link
Contributor

lbetz commented Jun 19, 2017

I don't know why but the ordering of your puppet run is wrong. The packages['icinga2'] resource has to be apply before creating the cert request with the command icinga2. What kind of os or distribution you used?

@BrianAI
Copy link
Author

BrianAI commented Jun 19, 2017

We use centOs 6/7, and puppet 3 ( latest version available) and I should note I've tried to force ordering (since I saw the same issue in the output up top) but that just causes a dependency loop :(

@lbetz
Copy link
Contributor

lbetz commented Jun 19, 2017

Ok strange. I have to tested with puppet 3 again.

@lbetz lbetz added bug and removed question labels Jun 20, 2017
@lbetz lbetz added this to the v1.3.0 milestone Jun 20, 2017
@lbetz
Copy link
Contributor

lbetz commented Jun 20, 2017

It's an ordering problem with puppet 3. I hope I can fix it in the evening (UTC+2) today.

@BrianAI
Copy link
Author

BrianAI commented Jun 20, 2017

Great! Thanks for checking it out :) look forward to it

@lbetz lbetz changed the title Running 2x for client due to PKI issue ordering-api-with-pki-after-package Jun 20, 2017
@lbetz
Copy link
Contributor

lbetz commented Jun 20, 2017

merge to master.

@lbetz lbetz closed this as completed Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants