Skip to content

Latest commit

 

History

History

samples

The samples

In this folder some examples and templates are given. What is shown here is actually, what you would need to supply for ansible-cluster to work.

The environment

The first start script already sets the needed environment variables which are listed below

  • CLUSTER_ACCOUNTING
  • CLUSTER_CONFIG
  • CLUSTER_GROUPS
  • CLUSTER_PARTITIONS
  • CLUSTER_SSH_LIMITS
  • CLUSTER_USERS

Those variables should point to your own configurations, which are explained below.

The ansible-cluster inventory

In order to use ansible-cluster some host variables and host groups need to be defined. In cluster_hosts_example some examples are shown. Instead of having all of the variables in a single file, the inventory can be split up into many files. Please take a look at the official 'Ansible documentation' on the inventory.

Examples and Templates

config_template.yml

config_template.yml represents the main configuration file, meaning this is where most of the variables for the ansible-cluster cluster are defined. In config_template.yml all needed and used variables can be seen with example settings.

groups_example.yml

In groups_example.yml all groups for user accounts can be defined, a few examples are shown in groups_example.yml. Those groups can be deployed via

ansible-playbook playbooks/sync_users.yml

Please have a look at usertool which can generate such files.

partition_config_example.yml

In partition_config_example.yml are the partitions of a Slurm cluster defined, have a look at partition_config_example.yml for examples.

slurm_accounts_example.yml

ansible-cluster uses accouting in Slurm to restrict accesses to cluster nodes. For that, some accounts have to be created in Slurm. Examples are shown in slurm_accounts_example.yml and can be added to the Slurm cluster via

ansible-playbook playbooks/slurm_accounting.yml

ssh_access_limits_example.yml

These Ansible variables are used in the common role inside the limit_ssh.yml play. Any cluster node being defined here is automatically restricted to the following

AllowUsers {{ssh_anywhere}} {{ssh_access_limits[ansible_hostname]}}

So this play essentially sets the AllowUsers line in the sshd_config of a system.

users_example.yml

In users_example.yml all user accounts eligible for using the cluster are defined, a few examples analogue to the groups are shown in users_example.yml. Those users can be deployed via

ansible-playbook playbooks/sync_users.yml

and please have a look at usertool which can generate such files.