Browse Source

Merge branch 'master' into upgrade33

Devan Goodwin 8 years ago
parent
commit
dd2506e325

+ 9 - 0
inventory/byo/hosts.aep.example

@@ -434,6 +434,15 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
 # Configure usage of openshift_clock role.
 #openshift_clock_enabled=true
 
+# OpenShift Per-Service Environment Variables
+# Environment variables are added to /etc/sysconfig files for
+# each OpenShift service: node, master (api and controllers).
+# API and controllers environment variables are merged in single
+# master environments.
+#openshift_master_api_env_vars={"ENABLE_HTTP2": "true"}
+#openshift_master_controllers_env_vars={"ENABLE_HTTP2": "true"}
+#openshift_node_env_vars={"ENABLE_HTTP2": "true"}
+
 # host group for masters
 [masters]
 aep3-master[1:3]-ansible.test.example.com

+ 9 - 0
inventory/byo/hosts.origin.example

@@ -439,6 +439,15 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
 # Configure usage of openshift_clock role.
 #openshift_clock_enabled=true
 
+# OpenShift Per-Service Environment Variables
+# Environment variables are added to /etc/sysconfig files for
+# each OpenShift service: node, master (api and controllers).
+# API and controllers environment variables are merged in single
+# master environments.
+#openshift_master_api_env_vars={"ENABLE_HTTP2": "true"}
+#openshift_master_controllers_env_vars={"ENABLE_HTTP2": "true"}
+#openshift_node_env_vars={"ENABLE_HTTP2": "true"}
+
 # host group for masters
 [masters]
 ose3-master[1:3]-ansible.test.example.com

+ 9 - 0
inventory/byo/hosts.ose.example

@@ -434,6 +434,15 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
 # Configure usage of openshift_clock role.
 #openshift_clock_enabled=true
 
+# OpenShift Per-Service Environment Variables
+# Environment variables are added to /etc/sysconfig files for
+# each OpenShift service: node, master (api and controllers).
+# API and controllers environment variables are merged in single
+# master environments.
+#openshift_master_api_env_vars={"ENABLE_HTTP2": "true"}
+#openshift_master_controllers_env_vars={"ENABLE_HTTP2": "true"}
+#openshift_node_env_vars={"ENABLE_HTTP2": "true"}
+
 # host group for masters
 [masters]
 ose3-master[1:3]-ansible.test.example.com

+ 2 - 0
playbooks/adhoc/uninstall.yml

@@ -143,11 +143,13 @@
     - registry\.qe\.openshift\.com/.*
     - registry\.access\..*redhat\.com/rhel7/etcd
     - docker.io/openshift
+    when: openshift_uninstall_images | default(True) | bool
 
   - shell:  "docker rmi -f {{ item.stdout_lines | join(' ') }}"
     changed_when: False
     failed_when: False
     with_items: "{{ images_to_delete.results }}"
+    when: openshift_uninstall_images | default(True) | bool
 
   - name: Remove sdn drop files
     file:

+ 1 - 2
playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml

@@ -4,12 +4,11 @@
   roles:
   - openshift_facts
   tasks:
-
   - set_fact:
       repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery' }}"
 
   - fail:
-      msg: Cannot upgrade Docker on Atomic hosts
+      msg: Cannot upgrade Docker on Atomic operating systems.
     when: openshift.common.is_atomic | bool
 
   - include: ../../../../common/openshift-cluster/upgrades/docker/upgrade_check.yml

+ 4 - 1
playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml

@@ -209,6 +209,9 @@
       msg: This upgrade playbook must be run on OpenShift Enterprise 3.1 or later
     when: deployment_type == 'atomic-openshift' and openshift.common.version | version_compare('3.1','<')
 
+- name: Verify docker upgrade targets
+  hosts: oo_masters_to_config:oo_nodes_to_config:oo_etcd_to_config
+  tasks:
   - name: Determine available Docker
     script: ../files/rpm_versions.sh docker
     register: g_docker_version_result
@@ -263,7 +266,7 @@
 - name: Backup etcd
   hosts: etcd_hosts_to_backup
   vars:
-    embedded_etcd: "{{ openshift.master.embedded_etcd }}"
+    embedded_etcd: "{{ hostvars[groups.oo_first_master.0].openshift.master.embedded_etcd }}"
     timestamp: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}"
   roles:
   - openshift_facts

+ 1 - 1
playbooks/common/openshift-master/config.yml

@@ -46,7 +46,7 @@
       openshift_hosted_metrics_duration: "{{ lookup('oo_option', 'openshift_hosted_metrics_duration') | default(7) }}"
     when: openshift_hosted_metrics_duration is not defined
   - set_fact:
-      openshift_hosted_metrics_resolution: "{{ lookup('oo_option', 'openshift_hosted_metrics_resolution') | default(10) }}"
+      openshift_hosted_metrics_resolution: "{{ lookup('oo_option', 'openshift_hosted_metrics_resolution') | default('10s', true) }}"
     when: openshift_hosted_metrics_resolution is not defined
   roles:
   - openshift_facts

+ 5 - 1
roles/openshift_examples/files/examples/v1.2/infrastructure-templates/enterprise/metrics-deployer.yaml

@@ -97,7 +97,11 @@ parameters:
   name: HAWKULAR_METRICS_HOSTNAME
   required: true
 -
-  description: "If set to true the deployer will try and delete all the existing components before trying to redeploy."
+  description: "Can be set to: 'deploy' to perform an initial deployment; 'refresh' to delete and redeploy all components but to keep persisted data and routes; 'redeploy' to delete and redeploy everything (losing all data in the process)"
+  name: MODE
+  value: "deploy"
+-
+  description: "(Deprecated) Turns 'deploy' mode into 'redeploy' mode, deleting and redeploying everything (losing all data in the process)"
   name: REDEPLOY
   value: "false"
 -

+ 1 - 1
roles/openshift_facts/library/openshift_facts.py

@@ -1777,7 +1777,7 @@ class OpenShiftFacts(object):
                 metrics=dict(
                     deploy=False,
                     duration=7,
-                    resolution=10,
+                    resolution='10s',
                     storage=dict(
                         kind=None,
                         volume=dict(

+ 6 - 0
roles/openshift_master/templates/atomic-openshift-master.j2

@@ -9,6 +9,12 @@ AWS_ACCESS_KEY_ID={{ openshift.cloudprovider.aws.access_key }}
 AWS_SECRET_ACCESS_KEY={{ openshift.cloudprovider.aws.secret_key }}
 {% endif %}
 
+{% if 'api_env_vars' in openshift.master or 'controllers_env_vars' in openshift.master -%}
+{% for key, value in openshift.master.api_env_vars.items() | default([]) | union(openshift.master.controllers_env_vars.items() | default([])) -%}
+{{ key }}={{ value }}
+{% endfor -%}
+{% endif -%}
+
 # Proxy configuration
 # See https://docs.openshift.com/enterprise/latest/install_config/install/advanced_install.html#configuring-global-proxy
 {% if 'http_proxy' in openshift.common %}

+ 6 - 0
roles/openshift_master/templates/native-cluster/atomic-openshift-master-api.j2

@@ -9,6 +9,12 @@ AWS_ACCESS_KEY_ID={{ openshift.cloudprovider.aws.access_key }}
 AWS_SECRET_ACCESS_KEY={{ openshift.cloudprovider.aws.secret_key }}
 {% endif %}
 
+{% if 'api_env_vars' in openshift.master -%}
+{% for key, value in openshift.master.api_env_vars.items() -%}
+{{ key }}={{ value }}
+{% endfor -%}
+{% endif -%}
+
 # Proxy configuration
 # See https://docs.openshift.com/enterprise/latest/install_config/install/advanced_install.html#configuring-global-proxy
 {% if 'http_proxy' in openshift.common %}

+ 6 - 0
roles/openshift_master/templates/native-cluster/atomic-openshift-master-controllers.j2

@@ -9,6 +9,12 @@ AWS_ACCESS_KEY_ID={{ openshift.cloudprovider.aws.access_key }}
 AWS_SECRET_ACCESS_KEY={{ openshift.cloudprovider.aws.secret_key }}
 {% endif %}
 
+{% if 'controllers_env_vars' in openshift.master -%}
+{% for key, value in openshift.master.controllers_env_vars.items() -%}
+{{ key }}={{ value }}
+{% endfor -%}
+{% endif -%}
+
 # Proxy configuration
 # See https://docs.openshift.com/enterprise/latest/install_config/install/advanced_install.html#configuring-global-proxy
 {% if 'http_proxy' in openshift.common %}

+ 2 - 0
roles/openshift_master_facts/tasks/main.yml

@@ -78,3 +78,5 @@
       image_policy_config: "{{ openshift_master_image_policy_config | default(None) }}"
       dynamic_provisioning_enabled: "{{ openshift_master_dynamic_provisioning_enabled | default(None) }}"
       max_requests_inflight: "{{ openshift_master_max_requests_inflight | default(None) }}"
+      api_env_vars: "{{ openshift_master_api_env_vars | default(None) }}"
+      controllers_env_vars: "{{ openshift_master_controllers_env_vars | default(None) }}"

+ 1 - 1
roles/openshift_metrics/README.md

@@ -21,7 +21,7 @@ From this role:
 | openshift_hosted_metrics_storage_volume_size    | 10Gi                  | Metrics volume size                                         |
 | openshift_hosted_metrics_storage_nfs_options    | *(rw,root_squash)     | NFS options for configured exports.                         |
 | openshift_hosted_metrics_duration               | 7                     | Metrics query duration                                      |
-| openshift_hosted_metrics_resolution             | 10                    | Metrics resolution                                          |
+| openshift_hosted_metrics_resolution             | 10s                   | Metrics resolution                                          |
 
 
 From openshift_common:

+ 11 - 0
roles/openshift_node/tasks/main.yml

@@ -26,6 +26,7 @@
       proxy_mode: "{{ openshift_node_proxy_mode | default('iptables') }}"
       local_quota_per_fsgroup: "{{ openshift_node_local_quota_per_fsgroup | default(None) }}"
       dns_ip: "{{ openshift_dns_ip | default(none) | get_dns_ip(hostvars[inventory_hostname])}}"
+      env_vars: "{{ openshift_node_env_vars | default(None) }}"
 
 # We have to add tuned-profiles in the same transaction otherwise we run into depsolving
 # problems because the rpms don't pin the version properly. This was fixed in 3.1 packaging.
@@ -91,6 +92,16 @@
   notify:
   - restart node
 
+- name: Configure Node Environment Variables
+  lineinfile:
+    dest: /etc/sysconfig/{{ openshift.common.service_type }}-node
+    regexp: "^{{ item.key }}="
+    line: "{{ item.key }}={{ item.value }}"
+    create: true
+  with_dict: "{{ openshift.node.env_vars | default({}) }}"
+  notify:
+  - restart node
+
 - name: Additional storage plugin configuration
   include: storage_plugins/main.yml
 

+ 5 - 5
roles/openshift_node_dnsmasq/tasks/main.yml

@@ -3,15 +3,16 @@
   command: >
     systemctl show NetworkManager
   register: nm_show
-  
+  changed_when: false
+
 - name: Set fact using_network_manager
   set_fact:
     network_manager_active: "{{ True if 'ActiveState=active' in nm_show.stdout else False }}"
-    
+
 - name: Install dnsmasq
   action: "{{ ansible_pkg_mgr }} name=dnsmasq state=installed"
   when: not openshift.common.is_atomic | bool
-  
+
 - name: Install dnsmasq configuration
   template:
     src: origin-dns.conf.j2
@@ -20,8 +21,7 @@
 # Dynamic NetworkManager based dispatcher
 - include: ./network-manager.yml
   when: network_manager_active | bool
-  
+
 # Relies on ansible in order to configure static config
 - include: ./no-network-manager.yml
   when: not network_manager_active | bool
-