Git Product home page Git Product logo

ansible-kong-module's People

Contributors

alza-bitz avatar toast38coza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-kong-module's Issues

Issue with ansible 2.0.2.0

Hello

I'm trying to use this module with Ansible 2.0.2.0 and i'm getting an error.

TASK [Register APIs] ***********************************************************
task path: /home/deploy/dynenvs/new.yml:132
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: zero length field name in format
fatal: [1337.staging.dev]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/home/deploy/.ansible/tmp/ansible-tmp-1463406901.38-217520438691928/kong_api\", line 3008, in <module>\n    main()\n  File \"/home/deploy/.ansible/tmp/ansible-tmp-1463406901.38-217520438691928/kong_api\", line 153, in main\n    response = api.add_or_update(**data)\n  File \"/home/deploy/.ansible/tmp/ansible-tmp-1463406901.38-217520438691928/kong_api\", line 47, in add_or_update\n    url = self.__url(\"/apis/\")\n  File \"/home/deploy/.ansible/tmp/ansible-tmp-1463406901.38-217520438691928/kong_api\", line 36, in __url\n    return \"{}{}\" . format (self.base_url, path)\nValueError: zero length field name in format\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}

My definition is:

- name: registrer instances in GW
  hosts: launched
  gather_facts: True
  vars:
    - kong_admin_base_url: "http://a.b.c.d:8001"
    - kong_base_url: "https://gw.dev"
  tasks:
    - name: Register APIs
      kong_api:
        kong_admin_uri: "{{ kong_admin_base_url }}"
        name: "mockbin"
        upstream_url: "http://mockbin.com"
        request_host: "mockbin.com"
        request_path: "/mockbin"
        strip_request_path: yes
        state: present

Am I doing something wrong?

Regards

M

Getting 'changed' instead of 'ok' on subsequent playbook executions, for kong_api

Hi there,

Thanks for creating this module, it's of great help to a project I'm currently working on.

It's working great for me, except I am seeing changed instead of an expected ok on repeated Ansible playbook executions for kong_api.

This is with no changes to the playbook or vars between runs.

My relevant playbook tasks look like this:

      - kong_api:
          kong_admin_uri: 111
          name: 222
          upstream_url: 333
          request_host: 444
          state: present
        register: kong_api
      - debug: var=kong_api

The output from debug is identical on each playbook run.

Thanks,

Alex.

Using config in Plugins module

Firstly, great work on the module. It's really helpful!

I'm having trouble following how I'm supposed to use the config parameter in the playbook. I've tried many different variations of syntax with no success. I want to enable the key-auth plugin with a custom key_names value โ€” the following is how I thought it might work:

...
    - name: Add key authentication
      kong_plugin:
        kong_admin_uri: "{{kong_admin_base_url}}"
        api_name: "test"
        plugin_name: "key-auth"
        config:
            key_names: "key"
        state: present

But when I try to run this I get the following error when checking the plugin was enabled properly:

TASK [Verify key auth was added] ***********************************************
fatal: [localhost]: FAILED! => {"changed": false, "connection": "close", "content": "Cannot GET /\n", "content_length": "13", "content_type": "text/html; charset=utf-8", "date": "Mon, 24 Oct 2016 16:22:24 GMT", "failed": true, "msg": "Status code was not [401]: HTTP Error 404: Not Found", "redirected": false, "status": 404, "url": "http://gateway.app/", "via": "kong/0.9.3", "x_content_type_options": "nosniff", "x_kong_proxy_latency": "0", "x_kong_upstream_latency": "26", "x_powered_by": "Express"}

As it turns out, the plugin wasn't enabled (probably due to the syntax / data type issues with the config).

Have you got any examples of how I can use this config bit? Thanks!

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.