summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filter_plugins/oo_filters.py38
-rw-r--r--inventory/byo/hosts.origin.example2
-rw-r--r--inventory/byo/hosts.ose.example2
-rw-r--r--playbooks/common/openshift-cluster/redeploy-certificates/ca.yml2
-rw-r--r--roles/etcd_server_certificates/meta/main.yml2
-rw-r--r--roles/openshift_certificate_expiry/library/openshift_cert_expiry.py5
-rw-r--r--roles/openshift_etcd_ca/meta/main.yml17
-rw-r--r--roles/openshift_etcd_ca/tasks/main.yml1
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py4
-rw-r--r--roles/openshift_facts/vars/main.yml1
-rw-r--r--roles/openshift_health_checker/openshift_checks/__init__.py10
-rw-r--r--roles/openshift_master_facts/filter_plugins/openshift_master.py6
12 files changed, 55 insertions, 35 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index ed6923687..a619f9ccb 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -1,26 +1,32 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
-# pylint: disable=no-name-in-module, import-error, wrong-import-order, ungrouped-imports
"""
Custom filters for use in openshift-ansible
"""
+import json
import os
import pdb
-import pkg_resources
-import re
-import json
-import yaml
import random
+import re
-from ansible import errors
from collections import Mapping
-from distutils.util import strtobool
-from distutils.version import LooseVersion
+# pylint no-name-in-module and import-error disabled here because pylint
+# fails to properly detect the packages when installed in a virtualenv
+from distutils.util import strtobool # pylint:disable=no-name-in-module,import-error
+from distutils.version import LooseVersion # pylint:disable=no-name-in-module,import-error
from operator import itemgetter
-from ansible.module_utils.six.moves.urllib.parse import urlparse
+
+import pkg_resources
+import yaml
+
+from ansible import errors
+# pylint no-name-in-module and import-error disabled here because pylint
+# fails to properly detect the packages when installed in a virtualenv
+from ansible.compat.six import string_types # pylint:disable=no-name-in-module,import-error
+from ansible.compat.six.moves.urllib.parse import urlparse # pylint:disable=no-name-in-module,import-error
+from ansible.module_utils._text import to_text
from ansible.parsing.yaml.dumper import AnsibleDumper
-from six import string_types
HAS_OPENSSL = False
try:
@@ -29,15 +35,6 @@ try:
except ImportError:
pass
-try:
- # ansible-2.2
- # ansible.utils.unicode.to_unicode is deprecated in ansible-2.2,
- # ansible.module_utils._text.to_text should be used instead.
- from ansible.module_utils._text import to_text
-except ImportError:
- # ansible-2.1
- from ansible.utils.unicode import to_unicode as to_text
-
def oo_pdb(arg):
""" This pops you into a pdb instance where arg is the data passed in
@@ -117,8 +114,7 @@ def oo_merge_hostvars(hostvars, variables, inventory_hostname):
raise errors.AnsibleFilterError("|failed expects variables is a dictionary")
if not isinstance(inventory_hostname, string_types):
raise errors.AnsibleFilterError("|failed expects inventory_hostname is a string")
- # pylint: disable=no-member
- ansible_version = pkg_resources.get_distribution("ansible").version
+ ansible_version = pkg_resources.get_distribution("ansible").version # pylint: disable=maybe-no-member
merged_hostvars = {}
if LooseVersion(ansible_version) >= LooseVersion('2.0.0'):
merged_hostvars = oo_merge_dicts(
diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example
index 6dec97fda..b9ffbf120 100644
--- a/inventory/byo/hosts.origin.example
+++ b/inventory/byo/hosts.origin.example
@@ -633,7 +633,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# Configure nodeIP in the node config
# This is needed in cases where node traffic is desired to go over an
# interface other than the default network interface.
-#openshift_node_set_node_ip=True
+#openshift_set_node_ip=True
# Force setting of system hostname when configuring OpenShift
# This works around issues related to installations that do not have valid dns
diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example
index 2b61e7d8d..10fc4d6f3 100644
--- a/inventory/byo/hosts.ose.example
+++ b/inventory/byo/hosts.ose.example
@@ -634,7 +634,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# Configure nodeIP in the node config
# This is needed in cases where node traffic is desired to go over an
# interface other than the default network interface.
-#openshift_node_set_node_ip=True
+#openshift_set_node_ip=True
# Force setting of system hostname when configuring OpenShift
# This works around issues related to installations that do not have valid dns
diff --git a/playbooks/common/openshift-cluster/redeploy-certificates/ca.yml b/playbooks/common/openshift-cluster/redeploy-certificates/ca.yml
index 2af699209..cbb4a2434 100644
--- a/playbooks/common/openshift-cluster/redeploy-certificates/ca.yml
+++ b/playbooks/common/openshift-cluster/redeploy-certificates/ca.yml
@@ -31,7 +31,7 @@
- name: Generate new etcd CA
hosts: oo_first_etcd
roles:
- - role: etcd_ca
+ - role: openshift_etcd_ca
etcd_peers: "{{ groups.oo_etcd_to_config | default([], true) }}"
etcd_ca_host: "{{ groups.oo_etcd_to_config.0 }}"
etcd_certificates_etcd_hosts: "{{ groups.oo_etcd_to_config | default([], true) }}"
diff --git a/roles/etcd_server_certificates/meta/main.yml b/roles/etcd_server_certificates/meta/main.yml
index b453f2bd8..98c913dba 100644
--- a/roles/etcd_server_certificates/meta/main.yml
+++ b/roles/etcd_server_certificates/meta/main.yml
@@ -13,4 +13,4 @@ galaxy_info:
- cloud
- system
dependencies:
-- role: etcd_ca
+- role: openshift_etcd_ca
diff --git a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py
index 33a4faf3e..c204b5341 100644
--- a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py
+++ b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py
@@ -10,8 +10,9 @@ import os
import subprocess
import yaml
-from six.moves import configparser
-
+# pylint import-error disabled because pylint cannot find the package
+# when installed in a virtualenv
+from ansible.module_utils.six.moves import configparser # pylint: disable=import-error
from ansible.module_utils.basic import AnsibleModule
try:
diff --git a/roles/openshift_etcd_ca/meta/main.yml b/roles/openshift_etcd_ca/meta/main.yml
new file mode 100644
index 000000000..d73d27356
--- /dev/null
+++ b/roles/openshift_etcd_ca/meta/main.yml
@@ -0,0 +1,17 @@
+---
+galaxy_info:
+ author: Tim Bielawa
+ description: Meta role around the etcd_ca role
+ company: Red Hat, Inc.
+ license: Apache License, Version 2.0
+ min_ansible_version: 2.2
+ platforms:
+ - name: EL
+ versions:
+ - 7
+ categories:
+ - cloud
+ - system
+dependencies:
+- role: openshift_etcd_facts
+- role: etcd_ca
diff --git a/roles/openshift_etcd_ca/tasks/main.yml b/roles/openshift_etcd_ca/tasks/main.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/roles/openshift_etcd_ca/tasks/main.yml
@@ -0,0 +1 @@
+---
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 8ea900e21..eeab8a99c 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -19,8 +19,8 @@ import struct
import socket
from distutils.util import strtobool
from distutils.version import LooseVersion
-from six import string_types, text_type
-from six.moves import configparser
+from ansible.module_utils.six import string_types, text_type
+from ansible.module_utils.six.moves import configparser
# ignore pylint errors related to the module_utils import
# pylint: disable=redefined-builtin, unused-wildcard-import, wildcard-import
diff --git a/roles/openshift_facts/vars/main.yml b/roles/openshift_facts/vars/main.yml
index 07f5100ad..053a4cfc8 100644
--- a/roles/openshift_facts/vars/main.yml
+++ b/roles/openshift_facts/vars/main.yml
@@ -2,7 +2,6 @@
required_packages:
- iproute
- python-dbus
- - python-six
- PyYAML
- yum-utils
diff --git a/roles/openshift_health_checker/openshift_checks/__init__.py b/roles/openshift_health_checker/openshift_checks/__init__.py
index 2c70438c9..50f26765b 100644
--- a/roles/openshift_health_checker/openshift_checks/__init__.py
+++ b/roles/openshift_health_checker/openshift_checks/__init__.py
@@ -2,13 +2,15 @@
Health checks for OpenShift clusters.
"""
+import operator
import os
+
from abc import ABCMeta, abstractmethod, abstractproperty
from importlib import import_module
-import operator
-import six
-from six.moves import reduce
+# pylint import-error disabled because pylint cannot find the package
+# when installed in a virtualenv
+from ansible.module_utils.six.moves import add_metaclass, reduce # pylint: disable=import-error, redefined-builtin
class OpenShiftCheckException(Exception):
@@ -16,7 +18,7 @@ class OpenShiftCheckException(Exception):
pass
-@six.add_metaclass(ABCMeta)
+@add_metaclass(ABCMeta)
class OpenShiftCheck(object):
"""A base class for defining checks for an OpenShift cluster environment."""
diff --git a/roles/openshift_master_facts/filter_plugins/openshift_master.py b/roles/openshift_master_facts/filter_plugins/openshift_master.py
index db24028cd..01806c97f 100644
--- a/roles/openshift_master_facts/filter_plugins/openshift_master.py
+++ b/roles/openshift_master_facts/filter_plugins/openshift_master.py
@@ -7,12 +7,16 @@ Custom filters for use in openshift-master
import copy
import sys
+# pylint import-error disabled because pylint cannot find the package
+# when installed in a virtualenv
from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error
from ansible import errors
from ansible.parsing.yaml.dumper import AnsibleDumper
from ansible.plugins.filter.core import to_bool as ansible_bool
-from six import string_types
+# pylint import-error disabled because pylint cannot find the package
+# when installed in a virtualenv
+from ansible.compat.six import string_types # pylint: disable=no-name-in-module,import-error
import yaml