Skip to content

Instantly share code, notes, and snippets.

@justinstoller
Created June 9, 2015 04:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinstoller/65d879f7e942a0353b80 to your computer and use it in GitHub Desktop.
Save justinstoller/65d879f7e942a0353b80 to your computer and use it in GitHub Desktop.
legacy_opts = {
:default_action => 'gem_install',
:version => (ENV['PUPPET_VERSION'] || '3.8.1'),
}
aio_opts = {
:default_action => 'gem_install',
:version => (ENV['PUPPET_AGENT_VERSION'] || '1.1.0'),
}
hosts_of_type = hosts.group_by {|host| host['type'] }
if hosts_of_type['foss']
install_puppet_on(hosts_of_type['foss'], legacy_opts)
end
if hosts_of_type['aio']
install_puppet_agent_on(hosts_of_type['aio'], aio_opts)
end
if hosts_of_type['pe']
install_pe_on(hosts_of_type['pe'])
end
@justinstoller
Copy link
Author

Do we care about installing a master with AIO? Updating the above with something like:

  if hosts_of_type['aio']
    install_puppet_agent_on(hosts_of_type['aio'], aio_opts)

    if hosts_of_type['aio'].include? master
      install_package(master, 'puppetserver')
    end
  end

Should install Puppet Server on the master, if one exists, and its an "aio" host.

@justinstoller
Copy link
Author

Note, there's a lot of, "a 3.x PE agent needs to talk to a 3.x PE master, BUT a FOSS 3.x agent shouldn't talk to a 3.x master, BUT a FOSS 4.x should talk to a PE 4.x master, AND a PE 4.x master should talk to a PE 3.x master". However I don't know how many of those scenarios are actually valid to module workflows should be accounted for in the spec_helper or should be guarded against in the spec helper.

@justinstoller
Copy link
Author

I think it might be better to say,
3.x FOSS agents are valid by themselves (or with a webrick "master") only
4.x FOSS agents (AIO) are valid by themselves, with a 4.x FOSS master (puppetserver), or a PE 4.x master
4.x PE hosts can be by themselves or with AIO agents
PE and FOSS (non-AIO) can never be together however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment