diff options
-rw-r--r-- | .github/ISSUE_TEMPLATE.md | 21 | ||||
-rw-r--r-- | LICENSE (renamed from LICENSE.md) | 14 | ||||
-rw-r--r-- | filter_plugins/oo_filters.py | 15 | ||||
-rw-r--r-- | inventory/byo/hosts.origin.example | 5 | ||||
-rw-r--r-- | inventory/byo/hosts.ose.example | 5 | ||||
-rw-r--r-- | openshift-ansible.spec | 3 | ||||
-rw-r--r-- | playbooks/adhoc/uninstall.yml | 72 | ||||
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 9 | ||||
-rw-r--r-- | roles/openshift_hosted/README.md | 1 | ||||
-rw-r--r-- | roles/openshift_hosted/tasks/router/router.yml | 4 | ||||
-rw-r--r-- | roles/openshift_master/tasks/main.yml | 6 | ||||
-rw-r--r-- | roles/openshift_metrics/README.md | 1 | ||||
-rw-r--r-- | roles/openshift_node/tasks/main.yml | 4 | ||||
-rw-r--r-- | roles/openshift_node/tasks/systemd_units.yml | 2 |
14 files changed, 111 insertions, 51 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..627fa13eb --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,21 @@ +[provide a description of the issue] + +##### Version +[if you're operating from a git clone provide the output of `git describe`] +[if you're running from playbooks installed via RPM or atomic-openshift-utils `rpm -q atomic-openshift-utils openshift-ansible`] +[Your version of ansible, `ansible --version`] + + +##### Steps To Reproduce +1. [step 1] +2. [step 2] + +##### Current Result + +##### Expected Result + +##### Additional Information +[The exact command you ran] +[Your operating system and version, ie: RHEL 7.2, Fedora 23] +[Your inventory file] +[visit https://docs.openshift.org/latest/welcome/index.html] @@ -1,4 +1,5 @@ -Apache License + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -175,17 +176,6 @@ Apache License END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - Copyright 2014 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index 7b4eb59c8..1c12f2e07 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -735,13 +735,14 @@ class FilterModule(object): if 'hosted' in hostvars['openshift']: for component in hostvars['openshift']['hosted']: if 'storage' in hostvars['openshift']['hosted'][component]: - kind = hostvars['openshift']['hosted'][component]['storage']['kind'] - create_pv = hostvars['openshift']['hosted'][component]['storage']['create_pv'] - create_pvc = hostvars['openshift']['hosted'][component]['storage']['create_pvc'] - if kind != None and create_pv and create_pvc: - volume = hostvars['openshift']['hosted'][component]['storage']['volume']['name'] - size = hostvars['openshift']['hosted'][component]['storage']['volume']['size'] - access_modes = hostvars['openshift']['hosted'][component]['storage']['access_modes'] + params = hostvars['openshift']['hosted'][component]['storage'] + kind = params['kind'] + create_pv = params['create_pv'] + create_pvc = params['create_pvc'] + if kind not in [None, 'object'] and create_pv and create_pvc: + volume = params['volume']['name'] + size = params['volume']['size'] + access_modes = params['access_modes'] persistent_volume_claim = dict( name="{0}-claim".format(volume), capacity=size, diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example index 41ed237f7..8b3a6e403 100644 --- a/inventory/byo/hosts.origin.example +++ b/inventory/byo/hosts.origin.example @@ -149,6 +149,9 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', #openshift_cloudprovider_openstack_tenant_name=tenant_name #openshift_cloudprovider_openstack_region=region #openshift_cloudprovider_openstack_lb_subnet_id=subnet_id +# +# GCE +#openshift_cloudprovider_kind=gce # Project Configuration #osm_project_request_message='' @@ -364,6 +367,8 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', # # Override metricsPublicURL in the master config for cluster metrics # Defaults to https://hawkular-metrics.{{openshift_master_default_subdomain}}/hawkular/metrics +# Currently, you may only alter the hostname portion of the url, alterting the +# `/hawkular/metrics` path will break installation of metrics. #openshift_hosted_metrics_public_url=https://hawkular-metrics.example.com/hawkular/metrics # Configure the multi-tenant SDN plugin (default is 'redhat/openshift-ovs-subnet') diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example index 71e1ebb03..af653f850 100644 --- a/inventory/byo/hosts.ose.example +++ b/inventory/byo/hosts.ose.example @@ -148,6 +148,9 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', #openshift_cloudprovider_openstack_tenant_name=tenant_name #openshift_cloudprovider_openstack_region=region #openshift_cloudprovider_openstack_lb_subnet_id=subnet_id +# +# GCE +#openshift_cloudprovider_kind=gce # Project Configuration #osm_project_request_message='' @@ -363,6 +366,8 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', # # Override metricsPublicURL in the master config for cluster metrics # Defaults to https://hawkular-metrics.{{openshift_master_default_subdomain}}/hawkular/metrics +# Currently, you may only alter the hostname portion of the url, alterting the +# `/hawkular/metrics` path will break installation of metrics. #openshift_hosted_metrics_public_url=https://hawkular-metrics.example.com/hawkular/metrics diff --git a/openshift-ansible.spec b/openshift-ansible.spec index 5042743f8..dd16f7dc0 100644 --- a/openshift-ansible.spec +++ b/openshift-ansible.spec @@ -91,7 +91,8 @@ popd # Base openshift-ansible files %files -%doc LICENSE.md README* +%doc README* +%license LICENSE %dir %{_datadir}/ansible/%{name} %{_datadir}/ansible/%{name}/library %ghost %{_datadir}/ansible/%{name}/playbooks/common/openshift-master/library.rpmmoved diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml index cd569937c..789f66b14 100644 --- a/playbooks/adhoc/uninstall.yml +++ b/playbooks/adhoc/uninstall.yml @@ -22,6 +22,7 @@ - set_fact: is_containerized: "{{ is_atomic or containerized | default(false) | bool }}" +# Stop services on all hosts prior to removing files. - hosts: nodes become: yes tasks: @@ -35,6 +36,46 @@ - origin-node failed_when: false +- hosts: masters + become: yes + tasks: + - name: Stop services + service: name={{ item }} state=stopped + with_items: + - atomic-enterprise-master + - atomic-openshift-master + - atomic-openshift-master-api + - atomic-openshift-master-controllers + - openshift-master + - openshift-master-api + - openshift-master-controllers + - origin-master + - origin-master-api + - origin-master-controllers + - pcsd + failed_when: false + +- hosts: etcd + become: yes + tasks: + - name: Stop services + service: name={{ item }} state=stopped + with_items: + - etcd + failed_when: false + +- hosts: lb + become: yes + tasks: + - name: Stop services + service: name={{ item }} state=stopped + with_items: + - haproxy + failed_when: false + +- hosts: nodes + become: yes + tasks: - name: unmask services command: systemctl unmask "{{ item }}" changed_when: False @@ -181,6 +222,7 @@ - /etc/systemd/system/openvswitch.service - /etc/systemd/system/origin-node-dep.service - /etc/systemd/system/origin-node.service + - /etc/systemd/system/origin-node.service.wants - /run/openshift-sdn - /var/lib/atomic-enterprise - /var/lib/openshift @@ -196,22 +238,6 @@ - hosts: masters become: yes tasks: - - name: Stop services - service: name={{ item }} state=stopped - with_items: - - atomic-enterprise-master - - atomic-openshift-master - - atomic-openshift-master-api - - atomic-openshift-master-controllers - - openshift-master - - openshift-master-api - - openshift-master-controllers - - origin-master - - origin-master-api - - origin-master-controllers - - pcsd - failed_when: false - - name: unmask services command: systemctl unmask "{{ item }}" changed_when: False @@ -306,12 +332,6 @@ - hosts: etcd become: yes tasks: - - name: Stop services - service: name={{ item }} state=stopped - with_items: - - etcd - failed_when: false - - name: unmask services command: systemctl unmask "{{ item }}" changed_when: False @@ -346,7 +366,7 @@ - /etc/etcd - /etc/systemd/system/etcd_container.service - # Intenationally using rm command over file module because if someone had mounted a filesystem + # Intenationally using rm command over file module because if someone had mounted a filesystem # at /var/lib/etcd then the contents was not removed correctly - name: Remove etcd data shell: rm -rf /var/lib/etcd/* @@ -357,12 +377,6 @@ - hosts: lb become: yes tasks: - - name: Stop services - service: name={{ item }} state=stopped - with_items: - - haproxy - failed_when: false - - name: unmask services command: systemctl unmask "{{ item }}" changed_when: False diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index bdc7d3947..b2d007ec9 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -1036,6 +1036,8 @@ def build_kubelet_args(facts): if facts['cloudprovider']['kind'] == 'openstack': kubelet_args['cloud-provider'] = ['openstack'] kubelet_args['cloud-config'] = [cloud_cfg_path + '/openstack.conf'] + if facts['cloudprovider']['kind'] == 'gce': + kubelet_args['cloud-provider'] = ['gce'] if kubelet_args != {}: facts = merge_facts({'node': {'kubelet_args': kubelet_args}}, facts, [], []) return facts @@ -1054,6 +1056,8 @@ def build_controller_args(facts): if facts['cloudprovider']['kind'] == 'openstack': controller_args['cloud-provider'] = ['openstack'] controller_args['cloud-config'] = [cloud_cfg_path + '/openstack.conf'] + if facts['cloudprovider']['kind'] == 'gce': + controller_args['cloud-provider'] = ['gce'] if controller_args != {}: facts = merge_facts({'master': {'controller_args': controller_args}}, facts, [], []) return facts @@ -1072,6 +1076,8 @@ def build_api_server_args(facts): if facts['cloudprovider']['kind'] == 'openstack': api_server_args['cloud-provider'] = ['openstack'] api_server_args['cloud-config'] = [cloud_cfg_path + '/openstack.conf'] + if facts['cloudprovider']['kind'] == 'gce': + api_server_args['cloud-provider'] = ['gce'] if api_server_args != {}: facts = merge_facts({'master': {'api_server_args': api_server_args}}, facts, [], []) return facts @@ -1433,6 +1439,9 @@ def set_proxy_facts(facts): builddefaults['http_proxy'] = common['http_proxy'] if 'https_proxy' not in builddefaults and 'https_proxy' in common: builddefaults['https_proxy'] = common['https_proxy'] + # make no_proxy into a list if it's not + if 'no_proxy' in builddefaults and isinstance(builddefaults['no_proxy'], basestring): + builddefaults['no_proxy'] = builddefaults['no_proxy'].split(",") if 'no_proxy' not in builddefaults and 'no_proxy' in common: builddefaults['no_proxy'] = common['no_proxy'] if 'git_http_proxy' not in builddefaults and 'http_proxy' in builddefaults: diff --git a/roles/openshift_hosted/README.md b/roles/openshift_hosted/README.md index 102728820..328f800bf 100644 --- a/roles/openshift_hosted/README.md +++ b/roles/openshift_hosted/README.md @@ -22,6 +22,7 @@ From this role: | openshift_hosted_router_registryurl | 'openshift3/ose-${component}:${version}' | The image to base the OpenShift router on. | | openshift_hosted_router_replicas | Number of nodes matching selector | The number of replicas to configure. | | openshift_hosted_router_selector | region=infra | Node selector used when creating router. The OpenShift router will only be deployed to nodes matching this selector. | +| openshift_hosted_router_name | router | The name of the router to be created. | | openshift_hosted_registry_registryurl | 'openshift3/ose-${component}:${version}' | The image to base the OpenShift registry on. | | openshift_hosted_registry_replicas | Number of nodes matching selector | The number of replicas to configure. | | openshift_hosted_registry_selector | region=infra | Node selector used when creating registry. The OpenShift registry will only be deployed to nodes matching this selector. | diff --git a/roles/openshift_hosted/tasks/router/router.yml b/roles/openshift_hosted/tasks/router/router.yml index e18b9781c..0cad19c34 100644 --- a/roles/openshift_hosted/tasks/router/router.yml +++ b/roles/openshift_hosted/tasks/router/router.yml @@ -70,6 +70,10 @@ {% if openshift.hosted.router.registryurl | default(none) is not none -%} --images='{{ openshift.hosted.router.registryurl }}' {% endif -%} + {% if openshift.hosted.router.name | default(none) is not none -%} + {{ openshift.hosted.router.name }} + {% endif -%} + register: openshift_hosted_router_results changed_when: "'service exists' not in openshift_hosted_router_results.stdout" failed_when: "openshift_hosted_router_results.rc != 0 and 'service exists' not in openshift_hosted_router_results.stdout and 'deployment_config' not in openshift_hosted_router_results.stderr and 'service' not in openshift_hosted_router_results.stderr" diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 6259fd996..d8a4aa9bb 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -202,6 +202,10 @@ when: openshift_master_ha | bool and openshift.master.cluster_method == 'native' and inventory_hostname == openshift_master_hosts[0] register: start_result +- set_fact: + master_api_service_status_changed: "{{ start_result | changed }}" + when: openshift_master_ha | bool and openshift.master.cluster_method == 'native' and inventory_hostname == openshift_master_hosts[0] + - pause: seconds: 15 when: openshift_master_ha | bool and openshift.master.cluster_method == 'native' @@ -216,7 +220,7 @@ - set_fact: master_api_service_status_changed: "{{ start_result | changed }}" - when: openshift_master_ha | bool and openshift.master.cluster_method == 'native' + when: openshift_master_ha | bool and openshift.master.cluster_method == 'native' and inventory_hostname != openshift_master_hosts[0] # A separate wait is required here for native HA since notifies will # be resolved after all tasks in the role. diff --git a/roles/openshift_metrics/README.md b/roles/openshift_metrics/README.md index 7f95a2a40..30a0a608d 100644 --- a/roles/openshift_metrics/README.md +++ b/roles/openshift_metrics/README.md @@ -16,6 +16,7 @@ From this role: | Name | Default value | | |-------------------------------------------------|-----------------------|-------------------------------------------------------------| | openshift_hosted_metrics_deploy | `False` | If metrics should be deployed | +| openshift_hosted_metrics_public_url | null | Hawkular metrics public url | | openshift_hosted_metrics_storage_nfs_directory | `/exports` | Root export directory. | | openshift_hosted_metrics_storage_volume_name | `metrics` | Metrics volume within openshift_hosted_metrics_volume_dir | | openshift_hosted_metrics_storage_volume_size | `10Gi` | Metrics volume size | diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index f49e97745..995169dd6 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -34,6 +34,10 @@ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-node{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }},tuned-profiles-{{ openshift.common.service_type }}-node{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }} state=present" when: not openshift.common.is_containerized | bool +- name: Set atomic-guest tuned profile + command: "tuned-adm profile atomic-guest" + when: openshift.common.is_atomic | bool + - name: Install sdn-ovs package action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-sdn-ovs{{ openshift_pkg_version | oo_image_tag_to_rpm_version(include_dash=True) }} state=present" when: openshift.common.use_openshift_sdn and not openshift.common.is_containerized | bool diff --git a/roles/openshift_node/tasks/systemd_units.yml b/roles/openshift_node/tasks/systemd_units.yml index 38dc98c07..98ef1ffd4 100644 --- a/roles/openshift_node/tasks/systemd_units.yml +++ b/roles/openshift_node/tasks/systemd_units.yml @@ -60,7 +60,7 @@ - regex: '^HTTPS_PROXY=' line: "HTTPS_PROXY={{ openshift.common.https_proxy }}" - regex: '^NO_PROXY=' - line: "NO_PROXY={{ openshift.common.no_proxy | join(',') }}" + line: "NO_PROXY={{ openshift.common.no_proxy | join(',') }},{{ openshift.common.portal_net }},{{ hostvars[groups.oo_first_master.0].openshift.master.sdn_cluster_network_cidr }}" when: "{{ openshift.common.http_proxy is defined and openshift.common.http_proxy != '' }}" notify: - restart node |