Git Product home page Git Product logo

Comments (12)

stephan2012 avatar stephan2012 commented on August 29, 2024

After creating the directory manually, installation succeeds:

# mkdir -p -m 0755 /usr/lib/python2.7/site-packages/ansible/module_utils/network/netscaler
# python install.py 
Ansible path is /usr/lib/python2.7/site-packages/ansible
Ansible extras path is /usr/lib/python2.7/site-packages/ansible/modules/network
Copying documentation fragments to /usr/lib/python2.7/site-packages/ansible/utils/module_docs_fragments
Copying netscaler.py to /usr/lib/python2.7/site-packages/ansible/module_utils/network/netscaler
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/__init__.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_action.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_policy.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_vserver.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_lb_monitor.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_lb_vserver.py
Copying /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_nitro_request.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_save_config.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_server.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_service.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_servicegroup.py
Overwriting /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_ssl_certkey.py
Could not find units tests dir
Could not find integration tests dir

However, it then fails with

TASK [Suspend loadbalancing for server] ********************************************************************************************************************************************
task path: /home/austermuehle/ansible/roles/common/tasks/suspend-loadbalancing.yml:7
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 130, in run
    res = self._execute()
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 528, in _execute
    result = self._handler.run(task_vars=variables)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/normal.py", line 45, in run
    results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars, wrap_async=wrap_async))
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/__init__.py", line 633, in _execute_module
    (module_style, shebang, module_data, module_path) = self._configure_module(module_name=module_name, module_args=module_args, task_vars=task_vars)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/__init__.py", line 165, in _configure_module
    environment=final_environment)
  File "/usr/lib/python2.7/site-packages/ansible/executor/module_common.py", line 869, in modify_module
    environment=environment)
  File "/usr/lib/python2.7/site-packages/ansible/executor/module_common.py", line 695, in _find_module_utils
    recursive_finder(module_name, b_module_data, py_module_names, py_module_cache, zf)
  File "/usr/lib/python2.7/site-packages/ansible/executor/module_common.py", line 564, in recursive_finder
    [os.path.join(p, *py_pkg_name[:-1]) for p in module_utils_paths])
ImportError: No module named __init__

fatal: [hseecpels3vp]: FAILED! => {
    "msg": "Unexpected failure during module execution.", 
    "stdout": ""
}

The task in playbook looks like this:

- name: "Suspend loadbalancing for server"
  delegate_to: hostname
  run_once: true
  netscaler_server:
    nsip: '{{ nsc_hostname }}'
    nitro_user: '{{ nsc_api_username }}'
    nitro_pass: '{{ nsc_api_password }}'
    nitro_protocol: https
    name: '{{ ansible_nodename }}'
    state: present
    disabled: yes
    graceful: yes

from ansible-collection-netscaleradc.

chiradeep avatar chiradeep commented on August 29, 2024
  • you do not need to install from this repository, if you are on version 2.4 (it should be part of Ansible itself). It has been merged with Ansible 2.4
  • if you do install (for example, to obtain a fix not in the main Ansible repo), you should use 'sudo python install'.

from ansible-collection-netscaleradc.

stephan2012 avatar stephan2012 commented on August 29, 2024

The reason for trying v1.1 is indeed an included fix. I installed via python install.py which lead to the error reported above.

from ansible-collection-netscaleradc.

chiradeep avatar chiradeep commented on August 29, 2024

Please try with 'sudo'

from ansible-collection-netscaleradc.

stephan2012 avatar stephan2012 commented on August 29, 2024

Did it as root. :-)

from ansible-collection-netscaleradc.

chiradeep avatar chiradeep commented on August 29, 2024
  • Looks like it changed from module_utils to just modules:
39c39
<     module_utils_path = os.path.join(ansible_path, 'modules', 'network', 'netscaler')
---
>     module_utils_path = os.path.join(ansible_path, 'module_utils', 'network', 'netscaler')

from ansible-collection-netscaleradc.

giorgos-nikolopoulos avatar giorgos-nikolopoulos commented on August 29, 2024

There was a change in the module utils path in ansible 2.5.0 which is the development version.

The PR fixes that by taking into account the ansible version for the installation path. Should now work with both ansible 2.4 and 2.5

@stephan2012 Let me know if this works out for you.

from ansible-collection-netscaleradc.

giorgos-nikolopoulos avatar giorgos-nikolopoulos commented on August 29, 2024

Actually there is the complication that the import statements within the modules' code will now reference the wrong path.

So a conditional is now needed in the import statements.

The refactor of the code was done by the core ansible maintainers.
Changing it again would probably not be acceptable given the fact they themselves did not consider this.

My suggestion is to work with ansible 2.5.0 .

from ansible-collection-netscaleradc.

stephan2012 avatar stephan2012 commented on August 29, 2024

Thanks @giorgos-nikolopoulos. Will test after xmas (around 28th).

from ansible-collection-netscaleradc.

giorgos-nikolopoulos avatar giorgos-nikolopoulos commented on August 29, 2024

We added a backport branch which makes the necessary changes in the modules to run under ansible 2.4.

This branch contains all the latest changes in master and we will keep updating it for any new changes.

from ansible-collection-netscaleradc.

stephan2012 avatar stephan2012 commented on August 29, 2024

Works, thanks. Sorry for my late reply.

from ansible-collection-netscaleradc.

l3ender avatar l3ender commented on August 29, 2024

I am facing the same issue as it seems the Netscaler module was removed from Ansible in 2.8 (notes).

I am trying to install using a virtualenv.

-> python install.py
Ansible path is /Users/ross/repos/citrix-adc-ansible-modules/venv/lib/python3.7/site-packages/ansible
Module utils directory (/Users/ross/repos/citrix-adc-ansible-modules/venv/lib/python3.7/site-packages/ansible/module_utils/network/netscaler) does not exist
-> ansible --version
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a
rapidly changing source of code and can become unstable at any point.
ansible 2.11.0.dev0
  config file = None
  configured module search path = ['/Users/ross/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/ross/repos/citrix-adc-ansible-modules/venv/lib/python3.7/site-packages/ansible
  ansible collection location = /Users/ross/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/ross/repos/citrix-adc-ansible-modules/venv/bin/ansible
  python version = 3.7.6 (default, Dec 30 2019, 19:38:26) [Clang 11.0.0 (clang-1100.0.33.16)]

from ansible-collection-netscaleradc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.