{"id":50385157,"url":"https://github.com/stackhpc/mellanox-switch","last_synced_at":"2026-05-30T14:31:03.773Z","repository":{"id":37749914,"uuid":"138607761","full_name":"stackhpc/mellanox-switch","owner":"stackhpc","description":"Ansible role for managing configuration of Mellanox switches running MLNX-OS","archived":false,"fork":false,"pushed_at":"2023-10-31T13:18:58.000Z","size":17,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T22:50:20.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackhpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2018-06-25T14:39:56.000Z","updated_at":"2023-11-23T12:17:19.000Z","dependencies_parsed_at":"2022-08-08T21:31:00.292Z","dependency_job_id":null,"html_url":"https://github.com/stackhpc/mellanox-switch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/stackhpc/mellanox-switch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fmellanox-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fmellanox-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fmellanox-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fmellanox-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackhpc","download_url":"https://codeload.github.com/stackhpc/mellanox-switch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fmellanox-switch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33696681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-30T14:31:03.705Z","updated_at":"2026-05-30T14:31:03.767Z","avatar_url":"https://github.com/stackhpc.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Mellanox Switch\n===============\n\nThis role configures Mellanox switches running MLNX-OS using the\n[expect](http://docs.ansible.com/ansible/latest/modules/expect_module.html)\nAnsible module.\n\nThis role will install the python `expect` package to the system site packages\non the local machine.\n\nRequirements\n------------\n\nThe switches should be configured to allow SSH access.\n\nRole Variables\n--------------\n\n`mellanox_switch_provider` is authentication provider information,\nsimilar to the `provider` argument to the `dellos` modules. It should be a dict\ncontaining the following fields:\n\n- `host`: the host or IP address of the switch.\n- `username`: the username with which to access the switch via SSH.\n- `auth_pass`: the password with which to authenticate.\n\n`mellanox_switch_config` is a list of configuration lines to apply to\nthe switch, and defaults to an empty list.\n\n`mellanox_switch_interface_config` contains interface configuration.\nIt is a dict mapping switch interface names to configuration dicts. Each dict\nmay contain the following items:\n\n- `description` - a description to apply to the interface.\n- `config` - a list of per-interface configuration.\n\nDependencies\n------------\n\nNone\n\nExample Playbook\n----------------\n\nThe following playbook configures hosts in the `mellanox-switches` group.  It\nassumes host variables for each switch holding the host, username and\npasswords.  It applies global configuration for VLAN 42, and enables two\nethernet interfaces as access mode switchports.\n\n    ---\n    - name: Ensure Mellanox switches are configured\n      hosts: mellanox-switches\n      gather_facts: no\n      roles:\n        - role: stackhpc.mellanox-switch\n          mellanox_switch_provider:\n            host: \"{{ switch_host }}\"\n            username: \"{{ switch_user }}\"\n            auth_pass: \"{{ switch_auth_pass }}\"\n          mellanox_switch_config:\n            - \"vlan 42\"\n            - \"exit\"\n          mellanox_switch_interface_config:\n            ethernet 1/1:\n              description: server-1\n              config:\n                - \"no shutdown\"\n                - \"switchport mode access\"\n            ethernet 1/2:\n              description: server-2\n              config:\n                - \"no shutdown\"\n                - \"switchport mode access\"\n\nAuthor Information\n------------------\n\n- Mark Goddard (\u003cmark@stackhpc.com\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackhpc%2Fmellanox-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackhpc%2Fmellanox-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackhpc%2Fmellanox-switch/lists"}