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

(PE-19438) Stop passing -c to upgrades from MEEP #2

Conversation

highb
Copy link

@highb highb commented Feb 27, 2017

Prior to this commit we were essentially always passing in a config
to the installer during upgrades because we typically provide some
sort of custom answers for many tests. This meant that we were not
really testing upgrades without a config file being passed in.
This commit updates the beaker to not pass in a config/-c option
on upgrades from a MEEP install. In order to pass in the custom answers,
I have instead made use of the update_pe_conf method to inject the
answers.

if opts[:upgrade] && use_meep?(host['previous_pe_ver'])
# merge answers into pe.conf
update_pe_conf(opts[:answers])
update_pe_conf(opts[:custom_answers])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpartlow Looking at how this method works, do we also need to perform a puppet run on the PE infra nodes in order to propagate the pe.conf before upgrade?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed this morning, and determined that we should sync the conf.d dir with beaker since that is the currently documented process, and work on syncing automatically as a stretch goal.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where should we do the sync with Beaker?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think it would make sense to do it right here? I should probably add a condition that only does update_pe_conf on the master, and then SCPs the pe.conf over on any other node.

@@ -450,7 +450,15 @@ def do_install hosts, opts = {}
else
prepare_host_installer_options(host)
register_feature_flags!(opts)
generate_installer_conf_file_for(host, hosts, opts)

if opts[:upgrade] && use_meep?(host['previous_pe_ver'])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opts[:type] == :upgrade

???

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So our upgrade cases are:

  • from 2016.2.0+ (post-meep)
    • Beaker runs the installer such that we make use of recovery
  • from < 2016.2.0 (pre-meep)
    • Beaker creates a fresh pe.conf using beaker-answers, as if we were doing an install

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I guess just checking opts[:upgrade] worked because I was testing upgrades from 2017.1 and that version just ignored the next flag.

As for the upgrade cases, that matches up with my expectations. Perhaps I should make that a comment for future us.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@highb thinking again about the <2016.2.0 cases. In the real world, we expect recover configuration to still produce a working pe.conf, right? Ideally we should test that. The blocking point for us is that we need to put the feature_flag in pe.conf. What happens if we just create a pe.conf with the feature flag in it and then continue to without a pe.conf specified for puppet-enterprise-installer, and let recover configuration do its thing?

@@ -133,7 +133,7 @@ def installer_cmd(host, opts)

# If there are no answer overrides, and we are doing an upgrade from 2016.2.0,
# we can assume there will be a valid pe.conf in /etc that we can re-use.
if opts[:answers].nil? && opts[:custom_answers].nil? && opts[:type] == :upgrade && !version_is_less(opts[:HOSTS][host.name][:pe_ver], '2016.2.0')
if opts[:type] == :upgrade && use_meep?(host[:previous_pe_ver])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment needs updating too I think.

@highb highb force-pushed the dont_provide_answer_file_for_meep_upgrade branch 3 times, most recently from 0c54ff5 to cdf964b Compare March 3, 2017 23:33
Prior to this commit we were essentially always passing in a config
to the installer during upgrades because we typically provide some
sort of custom answers for many tests. This meant that we were not
really testing upgrades without a config file being passed in.
This commit updates the beaker to not pass in a config/`-c` option
on upgrades from a MEEP install. In order to pass in the custom answers,
I have instead made use of the `update_pe_conf` method to inject the
answers.
@highb highb force-pushed the dont_provide_answer_file_for_meep_upgrade branch from cdf964b to d6b725a Compare March 3, 2017 23:51
@jpartlow
Copy link
Owner

jpartlow commented Mar 9, 2017

@highb some of the do_install specs need to be fixed up to account for the additional commands being run.

@@ -450,9 +452,36 @@ def do_install hosts, opts = {}
else
prepare_host_installer_options(host)
register_feature_flags!(opts)
generate_installer_conf_file_for(host, hosts, opts)

enterprise_path = '/etc/puppetlabs/enterprise'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic in do_install is already very cluttered. Let's take those whole new if/else block and move it out to a descriptive method taking host, hosts, opt.

Might want to do the same for the scp_from call as well for clarity.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd, the github emails for this PR went to my personal mail. Maybe because it's not under the puppetlabs namespace.

Making more descriptive methods sounds like a good idea here, I'll do that and see what's happening with the specs.

Brandon High added 2 commits March 9, 2017 15:58
The `do_install` method was getting a bit cluttered with too many
levels of logic, so I've moved the pe.conf setup steps out
into their own method, `setup_pe_conf`
The new functionality in `do_install` to copy the `conf.d` folder
@@ -37,6 +37,7 @@ module PEUtils
MEEP_DATA_DIR = '/etc/puppetlabs/enterprise'
PE_CONF_FILE = "#{MEEP_DATA_DIR}/conf.d/pe.conf"
NODE_CONF_PATH = "#{MEEP_DATA_DIR}/conf.d/nodes"
BEAKER_MEEP_TMP = "pe_conf"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpartlow Oh yeah, is there a beaker tmp dir I could be using for this?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is on the test executor itself.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, hopefully pe_conf is a self-explanatory enough directory name.

@jpartlow
Copy link
Owner

This was pulled directly into puppetlabs#59 and then I recreated the pe-modules-next branch.

@jpartlow jpartlow closed this Mar 14, 2017
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.

2 participants