Server IP : 85.214.239.14 / Your IP : 18.222.60.144 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/ansible_collections/community/skydive/plugins/modules/ |
Upload File : |
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2019, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { "metadata_version": "1.1", "status": ["preview"], "supported_by": "network", } DOCUMENTATION = r""" module: skydive_node author: - Sumit Jaiswal (@sjaiswal) short_description: Module which add nodes to Skydive topology description: - This module handles adding node to the Skydive topology. requirements: - skydive-client extends_documentation_fragment: - community.skydive.skydive options: name: description: - To define name for the node. required: true node_type: description: - To define type for the node. required: true host: description: - To define host for the node. required: false seed: description: - used to generate the UUID of the node default: '' metadata: description: - To define metadata for the node. required: false state: description: - State of the Skydive Node. If value is I(present) new node will be created else if it is I(absent) it will be deleted. default: present choices: - present - update - absent """ EXAMPLES = r""" - name: create tor node community.skydive.skydive_node: name: TOR node_type: fabric seed: TOR1 metadata: Model: Cisco 5300 state: present provider: endpoint: localhost:8082 username: admin password: admin - name: update tor node community.skydive.skydive_node: name: TOR node_type: host seed: TOR1 metadata: Model: Cisco 3400 state: update provider: endpoint: localhost:8082 username: admin password: admin - name: Delete the tor node community.skydive.skydive_node: name: TOR node_type: host seed: TOR1 metadata: Model: Cisco 3400 state: absent provider: endpoint: localhost:8082 username: admin password: admin """ RETURN = r""" # """ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.skydive.plugins.module_utils.network.skydive.api import ( skydive_node, ) def main(): """ Main entry point for module execution """ ib_spec = dict( name=dict(required=True, ib_req=True), node_type=dict(required=True, ib_req=True), host=dict(required=False, ib_req=True, default=""), seed=dict(required=False, ib_req=True, default=""), metadata=dict(required=False, ib_req=True, default=dict()), ) argument_spec = dict( provider=dict(required=False), state=dict(default="present", choices=["present", "update", "absent"]), ) argument_spec.update(ib_spec) argument_spec.update(skydive_node.provider_spec) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True ) skydive_obj = skydive_node(module) result = skydive_obj.run() module.exit_json(**result) if __name__ == "__main__": main()