Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Switch to geerlingguy.k8s_manifests role #131

Closed
geerlingguy opened this issue Dec 28, 2018 · 8 comments
Closed

Switch to geerlingguy.k8s_manifests role #131

geerlingguy opened this issue Dec 28, 2018 · 8 comments

Comments

@geerlingguy
Copy link
Owner

See: https://github.com/geerlingguy/ansible-role-k8s_manifests

Shouldn't require much rearchitecture, but it should simplify things a bit.

@geerlingguy
Copy link
Owner Author

Need to fix something upstream first: geerlingguy/ansible-role-k8s_manifests#2

@geerlingguy
Copy link
Owner Author

Also ran into: geerlingguy/ansible-role-k8s_manifests#3

@geerlingguy
Copy link
Owner Author

From ansible/ansible#43637

Argh, I might have to finally bite the bullet and start using virtualenv, after years of pushing it off (I hate having an environment manager to manage my environment...).

I've been continually bitten by this weird behavior, even after making sure I install openshift in all the versions of Python I've installed locally. And for this particular playbook (see #131), I have the playbook run against remote servers, but want to include one role and run it locally.

I might also fix this by running the k8s stuff in a separate play, with connection: local instead of using import_role with delegate_to: localhost...

@geerlingguy
Copy link
Owner Author

Switching to a separate play with connection: local didn't seem to work either :/

@geerlingguy
Copy link
Owner Author

Following @willthames advice here (ansible/ansible#43637 (comment)), I added the task:

  pre_tasks:
    - python_requirements_facts:
        dependencies: openshift
    - fail:

Then I got the output (with -vvv) from the nodes:

ok: [kube3] => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "dependencies": [
                "openshift"
            ]
        }
    }, 
    "mismatched": {}, 
    "not_found": [
        "openshift"
    ], 
    "python": "/usr/bin/python", 
    "python_system_path": [
        "/tmp/ansible_python_requirements_facts_payload_Rs_w8u/ansible_python_requirements_facts_payload.zip", 
        "", 
        "/usr/lib/python2.7", 
        "/usr/lib/python2.7/plat-x86_64-linux-gnu", 
        "/usr/lib/python2.7/lib-tk", 
        "/usr/lib/python2.7/lib-old", 
        "/usr/lib/python2.7/lib-dynload", 
        "/usr/local/lib/python2.7/dist-packages", 
        "/usr/lib/python2.7/dist-packages"
    ], 
    "python_version": "2.7.13 (default, Sep 26 2018, 18:42:22) \n[GCC 6.3.0 20170516]", 
    "valid": {}
}

And here's the output from local:

ok: [127.0.0.1] => changed=false 
  invocation:
    module_args:
      dependencies:
      - openshift
  mismatched: {}
  not_found: []
  python: /usr/local/opt/python@2/bin/python2.7
  python_system_path:
  - /var/folders/mt/rp7cb3s95qzfkrh1dk_8ckfc0000gn/T/ansible_python_requirements_facts_payload_k8WSc0/ansible_python_requirements_facts_payload.zip
  - ''
  - /usr/local/lib/python2.7/site-packages
  - /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
  - /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7
  - /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
  - /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
  - /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
  - /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
  - /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
  - /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
  - /Users/jgeerling/Library/Python/2.7/lib/python/site-packages
  - /usr/local/lib/python2.7/site-packages
  python_version: |-
    2.7.15 (default, Jul 17 2018, 19:41:20)
    [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]
  valid:
    openshift:
      desired: null
      installed: 0.8.1

So... uh... wth?

@geerlingguy
Copy link
Owner Author

Opened new upstream Ansible issue: k8s module throwing 'This module requires the OpenShift Python client. Try pip install openshift'.

Adding debug info there.

@geerlingguy
Copy link
Owner Author

Got it all fixed up... final test in a few minutes on the Pi cluster... which is partially disassembled right now due to my PoE HAT conversion!

@geerlingguy
Copy link
Owner Author

geerlingguy commented Jan 4, 2019

PR: #137

I like: +97 −249

geerlingguy added a commit that referenced this issue Jan 4, 2019
geerlingguy added a commit that referenced this issue Jan 4, 2019
Fixes #131: Switch to using geerlingguy.k8s_manifests role.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant