{"id":22330172,"url":"https://github.com/ddymko/ansible-slurm","last_synced_at":"2026-01-06T07:32:12.640Z","repository":{"id":265474486,"uuid":"875418694","full_name":"ddymko/ansible-slurm","owner":"ddymko","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-22T23:50:57.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T00:24:35.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddymko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-19T23:21:37.000Z","updated_at":"2025-03-22T23:51:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"a89866f1-5a9b-4de8-9d31-3d7959449d7f","html_url":"https://github.com/ddymko/ansible-slurm","commit_stats":null,"previous_names":["ddymko/ansible-slurm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddymko%2Fansible-slurm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddymko%2Fansible-slurm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddymko%2Fansible-slurm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddymko%2Fansible-slurm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddymko","download_url":"https://codeload.github.com/ddymko/ansible-slurm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245605708,"owners_count":20643030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-12-04T04:06:20.539Z","updated_at":"2026-01-06T07:32:12.598Z","avatar_url":"https://github.com/ddymko.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conclave-Ansible\n\n## Overview\n\nConclave-Ansible is an Ansible-based automation project designed to configure and manage a cluster environment. This project includes roles for setting up various services such as Docker, Prometheus, Grafana, Slurm, and more.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Table of Contents](#table-of-contents)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Playbooks](#playbooks)\n  - [Roles](#roles)\n- [Configuration](#configuration)\n  - [SSH Key](#ssh-key)\n  - [Prometheus](#prometheus)\n  - [Docker](#docker)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Prerequisites\n\n- Ansible 2.9 or higher\n- Access to the control node and worker nodes\n- SSH access configured for Ansible to connect to the nodes\n\n## Installation\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/yourusername/conclave-ansible.git\n    cd conclave-ansible\n    ```\n\n2. Install required Ansible roles:\n    ```sh\n    ansible-galaxy install -r requirements.yml\n    ```\n\n## Usage\n\n### Playbooks\n\n- **Configure Control Node**: This playbook configures the control node with various roles.\n    ```sh\n    ansible-playbook playbook.yml --limit control-node\n    ```\n\n- **Configure Worker Nodes**: This playbook configures the worker nodes.\n    ```sh\n    ansible-playbook playbook.yml --limit workers\n    ```\n\n### Roles\n\n- **ssh-key**: Manages SSH keys.\n- **common**: Common configurations for all nodes.\n- **conclave-backend**: Backend configurations for Conclave. This role performs a `git pull` of the Conclave backend repository, which requires GitHub to have access to the machine's SSH key.\n- **munge**: Installs and configures Munge.\n- **mariadb**: Installs and configures MariaDB.\n- **slurmdbd**: Installs and configures SlurmDBD.\n- **slurmctl**: Installs and configures Slurm Controller.\n- **slurmd**: Installs and configures Slurm Daemons.\n- **slurmrestd**: Installs and configures Slurm REST API.\n- **nginx**: Installs and configures Nginx.\n- **slurm-exporter**: Installs and configures Slurm Exporter.\n- **docker**: Installs and configures Docker, Prometheus, Node Exporter, and Grafana.\n\n## Configuration\n\n### Inventory\n\nThe inventory file defines the hosts and groups of hosts that Ansible will manage. In this project, the inventory is defined in the `inventory/nodes` file.\n\n#### Example Inventory\n\nThe `inventory/nodes` file contains the following groups and hosts:\n\n```ini\n[control-node]\nsmn01 ansible_host=192.168.4.194 hostname=smn01 cpus=4 realmemory=3195\n\n[workers]\nswn04 ansible_host=192.168.4.199 hostname=swn04 cpus=4 realmemory=3695\nswn05 ansible_host=192.168.4.135 hostname=swn05 cpus=4 realmemory=3695\nswn02 ansible_host=192.168.4.208 hostname=swn02 cpus=4 realmemory=3695\nswn03 ansible_host=192.168.4.178 hostname=swn03 cpus=4 realmemory=3695\n```\n\n- **control-node**: This group contains the control node, which is responsible for managing the cluster.\n- **workers**: This group contains the worker nodes, which perform the tasks assigned by the control node.\n\nEach host entry includes:\n- `ansible_host`: The IP address of the host.\n- `hostname`: The hostname of the host.\n- `cpus`: The number of CPUs available on the host.\n- `realmemory`: The amount of memory available on the host in MB.\n\nBy organizing hosts into groups, you can apply different roles and configurations to different sets of hosts in your playbooks.\n\n### SSH Key\n\nThe `ssh-key` role is responsible for managing SSH keys across the nodes. This role ensures that the necessary SSH keys are distributed and configured correctly for secure communication between the control node and worker nodes.\n\n#### Configuration\n\nTo configure the `ssh-key` role, you need to provide your SSH keys. Place your private key and public key in the `roles/ssh-key/files` directory with the filenames `private-key` and `public-key`, respectively.\n\n#### Usage\n\nTo apply the `ssh-key` role, include it in your playbook as shown below:\n\n```yaml\n- name: Configure SSH keys\n  hosts: all\n  become: yes\n  roles:\n    - ssh-key\n```\n\nThis will ensure that the specified SSH key is distributed to all nodes in the inventory, allowing for secure and passwordless SSH access.\n\nThe `ssh-key` role performs the following tasks:\n- Ensures the `/root/.ssh` directory exists with the correct permissions.\n- Copies the provided private key to `/root/.ssh/id_rsa`.\n- Copies the provided public key to `/root/.ssh/id_rsa.pub`.\n\nHere is an example of the tasks defined in the `ssh-key` role:\n\n```yaml\n- name: Ensure /root/.ssh directory exists\n  file:\n    path: /root/.ssh\n    state: directory\n    mode: '0700'\n    owner: root\n    group: root\n\n- name: Copy private key to /root/.ssh/id_rsa\n  copy:\n    src: files/private-key\n    dest: /root/.ssh/id_rsa\n    owner: root\n    group: root\n    mode: '0600'\n\n- name: Copy public key to /root/.ssh/id_rsa.pub\n  copy:\n    src: files/public-key\n    dest: /root/.ssh/id_rsa.pub\n    owner: root\n    group: root\n    mode: '0644'\n```\n\nBy following these steps, you can ensure that your SSH keys are properly set up and distributed across your nodes.\n\n### Prometheus\n\nThe Prometheus configuration is managed through the `prometheus.yml` file. The template for this file is located at `roles/docker/templates/prometheus.yml.j2`.\n\nExample configuration:\n```yaml\nglobal:\n  scrape_interval: 5s\n  evaluation_interval: 5s\n\nscrape_configs:\n  - job_name: \"prometheus\"\n    static_configs:\n      - targets: [\"localhost:9090\"]\n\n  - job_name: \"node\"\n    static_configs:\n      - targets: [\"smn01:9100\", \"swn02:9100\", \"swn03:9100\", \"swn04:9100\"]\n\n  - job_name: 'slurm-scraper'\n    scrape_interval: 30s\n    scrape_timeout: 30s\n    static_configs:\n        - targets: ['smn01:9092']\n\n  - job_name: 'slurm_exporter'\n    scrape_interval: 30s\n    scrape_timeout: 30s\n    static_configs:\n        - targets: ['smn01:9341']\n\n  - job_name: \"grafana\"\n    static_configs:\n      - targets: [\"grafana:3000\"]\n```\n\n### Docker\n\nDocker setup can be controlled via variables in the playbook. For example:\n```yaml\n- role: docker\n  vars:\n    perform_docker_setup: true\n    perform_prometheus_setup: true\n    perform_node_exporter_setup: true\n    perform_grafana_setup: false\n    perform_slurm_exporter_setup: false\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and create a pull request with your changes.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddymko%2Fansible-slurm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddymko%2Fansible-slurm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddymko%2Fansible-slurm/lists"}