Team, моя playbook выходит из строя ниже, и мой звонок - простая проверка. Я пытаюсь два вызова, один с kubectl, который работает, а другой с k8s, который не удается .. не может избавиться от ошибки SSL.
- name: "Fetch all nodes from clusters using kubectl."
shell: "kubectl get nodes --no-headers | awk '{print $1}'"
register: k8s_nodes
failed_when: k8s_nodes.rc == 1
- debug:
var: k8s_nodes.stdout_lines
- name: Fetch all Nodes with k8s Module
k8s:
service: "{{ lookup('k8s', kind='Node') }}"
validate_certs: no
kubeconfig: $WORKSPACE
host:
- name: "Validate k8s Versions Client & Server: K8s Module"
k8s_raw:
validate:
verify_ssl: no
TASK [3_validations_on_ssh : Fetch all Nodes with Module] **************
2019-10-18 12:48:05,647 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),)': /api/v1/nodes
fatal: [target1]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'k8s'. Error was a <class 'urllib3.exceptions.MaxRetryError'>, original message: HTTPSConnectionPool(host='test.test.com', port=443): Max retries exceeded with url: /api/v1/nodes (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))"}
TASK [2_k8s_validations : Validate k8s Versions Client & Server: K8s Module] ***************
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/Users/testu/.ansible/tmp/ansible-tmp-1571350592.160616-18304147566041/AnsiballZ__k8s_raw.py:18: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses\n import imp\nTraceback (most recent call last):\n File \"/Users/testu/.ansible/tmp/ansible-tmp-1571350592.160616-18304147566041/AnsiballZ__k8s_raw.py\", line 114, in <module>\n _ansiballz_main()\n File \"/Users/testu/.ansible/tmp/ansible-tmp-1571350592.160616-18304147566041/AnsiballZ__k8s_raw.py\", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/Users/testu/.ansible/tmp/ansible-tmp-1571350592.160616-18304147566041/AnsiballZ__k8s_raw.py\", line 49, in invoke_module\n imp.load_module('__main__', mod, module, MOD_DESC)\n File \"/usr/local/Cellar/ansible/2.8.5/libexec/lib/python3.7/imp.py\", line 234, in load_module\n return load_source(name, filename, file)\n File \"/usr/local/Cellar/ansible/2.8.5/libexec/lib/python3.7/imp.py\", line 169, in load_source\n module = _exec(spec, sys.modules[name])\n File \"<frozen importlib._bootstrap>\", line 630, in _exec\n File \"<frozen importlib._bootstrap_external>\", line 728, in exec_module\n File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n File \"/var/folders/qq/t_5mbv151fxfq9_vdgyvcvg8yz98pj/T/ansible_k8s_raw_payload_uh_ndv1g/__main__.py\", line 258, in <module>\n File \"/var/folders/qq/t_5mbv151fxfq9_vdgyvcvg8yz98pj/T/ansible_k8s_raw_payload_uh_ndv1g/__main__.py\", line 254, in main\n File \"/var/folders/qq/t_5mbv151fxfq9_vdgyvcvg8yz98pj/T/ansible_k8s_raw_payload_uh_ndv1g/ansible_k8s_raw_payload.zip/ansible/module_utils/k8s/raw.py\", line 160, in execute_module\nAttributeError: 'NoneType' object has no attribute 'endswith'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}