Giter Site home page Giter Site logo

resource_module_models's Introduction

Resource module models

resource_module_models's People

Contributors

adharshsrivatsr avatar ansible-zuul[bot] avatar arunsaravananbalachandran avatar ashwini-mhatre avatar chrisvanheuveln avatar cidrblock avatar danielmellado avatar divya-balasubramania avatar ganeshrn avatar gomathiselvis avatar javeedf avatar junousi avatar justjais avatar kb-perbyte avatar kerry-meyer avatar mingjunzhang2019 avatar nilashishc avatar pabelanger avatar pigriffin avatar priyamsahoo avatar qalthos avatar rohitthakur2590 avatar samccann avatar santhosh-kt avatar simon-nathans avatar stalabi1 avatar thenmozhi-gopal avatar trishnaguha avatar

Stargazers

 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  avatar

resource_module_models's Issues

Non Config Data in Ansible NRM Module

Can we define non-configurable attributes in the NRM model ?
if Yes, how do we achieve the same.
If No, is NRM scope is restricted only to configurable attributes ?

Resource Module Builder fails for Cisco IOS ios_static_route.yaml model

I was going to extend the config model for the Cisco IOS ios_static_routes model. I am following these instructions:
https://docs.ansible.com/ansible/latest/network/dev_guide/developing_resource_modules_network.html

However the resource module builder already fails with the existing model:
https://github.com/ansible-network/resource_module_models/blob/master/models/ios/static_route/ios_static_route.yaml


(venv) marehler@mac:~/github/resource_module_builder$ ansible-playbook -e rm_dest=~/Users/marehler/ansible_collections/Cisco/test \
                 -e structure=collection \
                 -e collection_org=cisco.ios \
                 -e collection_name=ios_static_routes \
                 -e model=~/Documents/Ansible/Modules/ios_static_routes/ios_static_route.yaml \
                 site.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks instead. This feature will be removed in version 2.16. Deprecation 
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

PLAY [localhost] ************************************************************************************************************************************

TASK [init : Ensure 'rm_dest' variable is set (see README.md)] **************************************************************************************
ok: [localhost] => {
    "changed": false
}

MSG:

All assertions passed

TASK [init : Ensure 'structure' variable is set and one of 'role' or 'collection' (see README.md)] **************************************************
ok: [localhost] => {
    "changed": false
}

MSG:

All assertions passed

TASK [init : Ensure the 'model' variable is set] ****************************************************************************************************
ok: [localhost] => {
    "changed": false
}

MSG:

All assertions passed

TASK [init : Include the model vars] ****************************************************************************************************************
fatal: [localhost]: FAILED! => {
    "ansible_facts": {
        "rm": {}
    },
    "ansible_included_var_files": [],
    "changed": false,
    "message": "We were unable to read either as JSON nor YAML, these are the errors we got from each:\nJSON: Expecting value: line 1 column 1 (char 0)\n\nSyntax Error while loading YAML.\n  could not find expected ':'\n\nThe error appears to be in '/Users/marehler/Documents/Ansible/Modules/ios_static_routes/ios_static_route.yaml': line 4, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n{\n  'metadata_version': '1.1',\n  ^ here\nThis one looks easy to fix. It seems that there is a value started\nwith a quote, and the YAML parser is expecting to see the line ended\nwith the same kind of quote. For instance:\n\n    when: \"ok\" in result.stdout\n\nCould be written as:\n\n   when: '\"ok\" in result.stdout'\n\nOr equivalently:\n\n   when: \"'ok' in result.stdout\"\n"
}

PLAY RECAP ******************************************************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Looking at some other Cisco IOS models, I recognized these have a different format and don't have the ANSIBLE_METADATA or DOCUMENTATION section. The resource module builder playbook fails for these models. Example:

<...>
TASK [init : Set the module documentation variable] *************************************************************************************************
fatal: [localhost]: FAILED! => {}

MSG:

The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'DOCUMENTATION'

The error appears to be in '/Users/marehler/github/resource_module_builder/roles/init/tasks/main.yml'    
<...>

I am new to Ansible module development, kindly asking for clarification and help.

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.