{"id":50385255,"url":"https://github.com/stackhpc/ansible-role-cluster-infra","last_synced_at":"2026-05-30T14:31:14.562Z","repository":{"id":37752446,"uuid":"97966471","full_name":"stackhpc/ansible-role-cluster-infra","owner":"stackhpc","description":"Ansible Galaxy role for generating OpenStack infrastructure for Cluster-as-a-Service","archived":false,"fork":false,"pushed_at":"2022-08-03T08:02:44.000Z","size":111,"stargazers_count":6,"open_issues_count":3,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T22:50:16.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jinja","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":"2017-07-21T16:16:42.000Z","updated_at":"2022-07-27T14:28:04.000Z","dependencies_parsed_at":"2022-08-08T21:31:02.823Z","dependency_job_id":null,"html_url":"https://github.com/stackhpc/ansible-role-cluster-infra","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/stackhpc/ansible-role-cluster-infra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fansible-role-cluster-infra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fansible-role-cluster-infra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fansible-role-cluster-infra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fansible-role-cluster-infra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackhpc","download_url":"https://codeload.github.com/stackhpc/ansible-role-cluster-infra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhpc%2Fansible-role-cluster-infra/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:13.753Z","updated_at":"2026-05-30T14:31:14.556Z","avatar_url":"https://github.com/stackhpc.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"OpenStack Cluster-as-a-Service Infrastructure\n=============================================\n\nThis role generates software-defined OpenStack infrastructure that can\nbe used for generating complex application topologies on demand.\nA recent version of OpenStack Heat is used to achieve this.\n\nRequirements\n------------\n\nThe OpenStack APIs should be accessible from the target host.  OpenStack\nNewton or later is required.  Client credentials should have been set\nin the environment, or using the `clouds.yaml` format.\n\nIn terms of Python packages, the requirements are:\n- ansible\n- jmespath (required by `json_query` filter)\n\nRole Variables\n--------------\n\n`cluster_venv`: Optional path to a python virtualenv in which the python\n`shade` package is installed.\n\n`cluster_auth_type`: Optional name of the OpenStack authentication plugin to\nuse.\n\n`cluster_auth`: Optional dictionary containing authentication information.\n\n`cluster_cloud`: Optional name of the OpenStack client config cloud name to use.\n\n`cluster_state`: Desired state of the cluster, one of `present`, `absent`, or\n`query`.  The default value is `present`. If the value is `query`, the cluster\nwill not be updated, but its configuration will be queried and an Ansible\ninventory generated.\n\n`cluster_name`: Name to give the Heat stack\nIt defaults to `cluster`\n\n`cluster_environment_nodenet`: An environment file specifying the resource to\nuse for the per-node network resource, `Cluster::NodeNet`. *NOTE*: This option is\ndeprecated, in favour of resources for defining `nodenet_resource` within groups\nand a global default resource using `nodenet_resource` within `cluster_params`.\n\n`cluster_environment_instance`: An environment file specifying the resource to\nuse for the instances, `Cluster::Instance`. *NOTE*: This option is deprecated,\nin favour of resources for specific groups through adding a definition for\n`node_resource` to the group, and a global default resource through\ndefining `node_resource` whithin `cluster_params`.\n\n`cluster_environment`: A list of environment files to use when creating the\nHeat stack.\n\n`cluster_params`: Parameters that are passed in to the Heat stack.\n\n  * `cluster_prefix`: Name prefix to use for instance hostname construction.\n\n  * `cluster_groups`: JSON-structured list of node groups, each of which is\n     described by a dict, containing the following:\n\n    * `name`: A name to refer to this group\n    * `flavor`: The name or UUID of an instance flavor to use for deploying this group.\n    * `image`: The name or UUID of an image to use for deploying this group.\n    * `user`: The name of a cloud user for which SSH keys have been provisioned and\n      passwordless sudo has been configured.  Could be (for example), `centos`, `debian`\n      or `ubuntu`.\n    * `num_nodes`: The number of nodes to create within this group.\n    * `volume_size`: Optional size in GB of volumes used to boot instances in\n      this group when the `instance-w-volume.yaml` environment is used.\n    * `volume_type`: Optional type of volumes used to boot instances in this\n      group when the `instance-w-volume.yaml` environment is used.\n\n  * `cluster_keypair`: Name of an SSH key pair to use to access the instances.\n\n  * `cluster_az`: Name of the availability zone in which to create the\n    instances.\n\n  * `cluster_config_drive`: Whether to provide metadata via a config drive.\n    Default is `false`.\n\n  * `cluster_net`: JSON-structure list of networks, each of which is described\n    by a dict, containing the following:\n\n    * `net`: Name or UUID of a neutron network to attach the instances to.\n    * `subnet`: Name or UUID of a neutron subnet to attach the instances to.\n    * `security_groups`: Optional list of names or UUIDs of security groups to\n      add the instances' ports to.  Security groups can be present or absent\n      on each listed network.\n    * `floating_net`: Optional name or UUID of a neutron network to attach\n      floating IPs to when the `Cluster::NodeNet1WithFIP` or\n      `Cluster::NodeNet2WithFIP` resources are used.\n\n  * `node_resource`: A resource name from the library of custom node resource \n     names.  This resource type is used as a default for groups which do not\n     override with a specific node resource type.\n\n     Valid options include:\n\n    * `Cluster::Instance`: An instance with ephemeral storage only.\n      This is the default.\n    * `Cluster::InstanceWithVolume`: An instance provisioned with a Cinder volume.\n\n  * `nodenet_resource`: A resource name from the library of custom network \n    resources for node networking.  This resource type is used for groups that\n    don't specify a network configuration for instances of the group.\n\n    Valid options include:\n\n    * `Cluster::NodeNet1`: A single network with no floating IP associated.\n      This is the default.\n    * `Cluster::NodeNet1WithFIP`: A single network with floating IP allocated\n      and associated with the port.\n    * `Cluster::NodeNet1WithPreallocatedFIP`: A single network with floating IP\n      (taken from a pre-allocated and supplied list) and associated with the port.\n    * `Cluster::NodeNet2`: Two network interfaces.  The first two networks listed\n      in `cluster_net` are used.\n    * `Cluster::NodeNet2WithFIP`: Two network interfaces.  The first two networks listed\n      in `cluster_net` are used.  A floating IP will be allocated from the first network\n      and associated with the instance.\n    * `Cluster::NodeNet2WithFIPSRIOV`: Two network interfaces.  The first interface\n      has a floating IP attached (using the `floating_net` and `security_groups`).\n      The second interface is configured as an SR-IOV port resource, for\n      high-performance internal networking.  The first two networks listed\n      in `cluster_net` are used.\n    * `Cluster::NodeNet3`: Three network interfaces.  The first three networks listed\n      in `cluster_net` are used.\n\n  * `router_networks`: An optional list of IP subnet CIDRs that should be added as\n    permitted networks.  This is needed if a port is associated with a gateway node that\n    is performing IP routing between subnets.  These should match the format of `allowed_address_pairs`\n    [https://docs.openstack.org/heat/rocky/template_guide/openstack.html#OS::Neutron::Port-prop-allowed_address_pairs here].\n    A simple, permissive configuration for `router_networks` would be: \n    \n```\nrouter_networks:\n  - ip_address: \"0.0.0.0/0\"\n```\n\n`cluster_inventory`: After deployment, an inventory file is generated,\nwhich can be used in subsequent Ansible-driven configuration.\n\n`cluster_roles`: A set of group assignments to make in the Ansible inventory file\nthat is generated.  This parameter is a list of dicts of the form:\n\n  * `name`: Name of the group to define in the Ansible inventory.\n  * `groups`: A list of groups selected from the dict objects supplied to `cluster_groups`, above.\n\n`cluster_group_vars`: A dictionary mapping inventory groups to group variables\nto be defined for that group. The group variables for each group are defined as\na dictionary mapping variable names to their values.\n\n`cluster_environment_group`: An optional Ansible group name to which all\ncluster hosts and localhost will be added. This can be useful if there is a\nsingle group that represents an environment such as\ndevelopment/staging/production.\n\nDependencies\n------------\n\nThis role depends on the python `shade` package being installed on the target\nhost. The package may be installed in a python virtual environment, in which\ncase the path to the virtualenv should be specified in the `cluster_venv`\nvariable.\n\nThe [stackhpc.os-shade](https://galaxy.ansible.com/stackhpc/os-shade/) role may\nbe used to install the python `shade` package.\n\nExample Playbook\n----------------\n\nThe following playbook creates a Heat stack for a cluster containing a `login`\ngroup and a `compute` group.\n\n    ---\n    # This playbook uses the Ansible OpenStack modules to create a cluster\n    # using a number of baremetal compute node instances, and configure it\n    # for a SLURM partition\n    - hosts: openstack\n      roles:\n        - role: stackhpc.cluster-infra\n          cluster_name: \"openhpc\"\n          cluster_params:\n            cluster_prefix: \"ohpc\"\n            cluster_keypair: \"admin_rsa\"\n            cluster_net:\n              - net: \"internal\"\n                subnet: \"internal\"\n                floating_net: \"external\"\n                security_groups:\n                  - \"default\"\n                  - \"slurm\"\n            cluster_groups:\n              - name: \"login\"\n                flavor: \"compute-B\"\n                image: \"CentOS7-OpenHPC\"\n                num_nodes: 1\n                node_resource: \"Cluster::InstanceWithVolume\"\n                node_resource: \"Cluster::NodeNet1WithFIP\"\n              - name: \"compute\"\n                flavor: \"compute-A\"\n                image: \"CentOS7-OpenHPC\"\n                num_nodes: 16\n          cluster_group_vars:\n            cluster:\n              ansible_user: centos\n\nAuthor Information\n------------------\n\n- Stig Telfer (\u003cstig@stackhpc.com\u003e)\n- Bharat Kunwar (\u003cbharat@stackhpc.com\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackhpc%2Fansible-role-cluster-infra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackhpc%2Fansible-role-cluster-infra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackhpc%2Fansible-role-cluster-infra/lists"}