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

Fix broken debug_level #5716

Merged
merged 1 commit into from Oct 11, 2017

Conversation

michaelgugino
Copy link
Contributor

Currently, debug_level is documented as a way to change
the debug output level for both masters and nodes.

debug_level does not currently have any effect.

This commit removes debug_level from openshift_facts
and properly sets openshift_master_debug_level and
openshift_node_debug_level to the value of debug_level
specified in the inventory.

This commit also reorganizes some set_fact tasks
needed during master upgrades to put all work-around
set-facts for undefined variables in one place, allowing
for easier cleanup in the future. This includes an
entry for openshift_master_debug_level.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1500164

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 10, 2017
@michaelgugino michaelgugino added the kind/bug Categorizes issue or PR as related to a bug. label Oct 10, 2017
Copy link
Member

@ashcrow ashcrow left a comment

Choose a reason for hiding this comment

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

LGTM

@ashcrow
Copy link
Member

ashcrow commented Oct 10, 2017

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 10, 2017
@ashcrow
Copy link
Member

ashcrow commented Oct 10, 2017

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 10, 2017
@@ -34,6 +9,11 @@
when:
- openshift.common.is_containerized | bool
Copy link
Member

Choose a reason for hiding this comment

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

What about to set both in the defaults/main.yml as:

containerized_svc_dir: "{{ '/etc/systemd/system' if openshift.common.is_containerized | bool else '/usr/lib/systemd/system' }}"
ha_svc_template_path: "{{ 'docker-cluster' if openshift.common.is_containerized | bool else 'native-cluster' }}"

? This way both variables can be overridden from the inventory file and there is only once place in the role where both variables are set.

- name: Init HA Service Info
set_fact:
containerized_svc_dir: "{{ containerized_svc_dir | default('/usr/lib/systemd/system') }}"
ha_svc_template_path: "{{ ha_svc_template_path | default('native-cluster') }}"
Copy link
Member

Choose a reason for hiding this comment

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

Both of them are defined in the defaults/main.yml. Why do they need to be re-defined again to their default values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this upgrade_facts.yml only executes during upgrades. The reasoning is mentioned in the comment at the top of the file.

@@ -1,4 +1,9 @@
---
# openshift_master_defaults_in_use is a workaround to detect if we are consuming
# the plays from the role or outside of the role.
openshift_master_defaults_in_use: True
Copy link
Member

Choose a reason for hiding this comment

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

Can you re-explaining the meaning of the variable? "if we are consuming the plays from the role" is confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

During upgrades, systemd_units.yml is included in a playbook outside the role. This means that the play is unable to consume the role's defaults/main.yml and vars/main.yml. We have to work around by setting facts for variables that would otherwise be defined. I'm using this because if 'openshift_master_defaults_in_use' is not defined, then that means someone is running the upgrade and the values in defaults/main.yml won't be detected.

@michaelgugino
Copy link
Contributor Author

bot, retest this please

@michaelgugino michaelgugino reopened this Oct 11, 2017
@openshift-merge-robot openshift-merge-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 11, 2017
@ingvagabund
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 11, 2017
@michaelgugino
Copy link
Contributor Author

I'm not see this job appear in Travis. It didn't appear travis ran this PR before I rebased it. Not sure what's going on with Travis.

Currently, debug_level is documented as a way to change
the debug output level for both masters and nodes.

debug_level does not currently have any effect.

This commit removes debug_level from openshift_facts
and properly sets openshift_master_debug_level and
openshift_node_debug_level to the value of debug_level
specified in the inventory.

This commit also reorganizes some set_fact tasks
needed during master upgrades to put all work-around
set-facts for undefined variables in one place, allowing
for easier cleanup in the future.  This includes an
entry for openshift_master_debug_level.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1500164
@michaelgugino michaelgugino reopened this Oct 11, 2017
@sdodson sdodson merged commit 7b5cc97 into openshift:master Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants