Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
administratif:tooling:ansible [2025/09/26 11:52] – created remiadministratif:tooling:ansible [2025/09/26 14:02] (current) remi
Line 1: Line 1:
 +====== Ansible ======
 +
 +===== Ansible Environment =====
 +
 +To use Ansible, generally you create a "playbooks" directory in your /home/user/, then get the following filesystem inside :
 +
 +<code>
 +
 +playbooks:-> <role_name>.yml  (Playbooks to run, often matches the name of a single role you want to run, or 
 +                             another when you run several roles)
 +         |-> inventory.ini    (List of all servers to run playbooks on, with host specific variables)
 +         |-> isc_compute.ini  (Chacha Disco and Tango for example)
 +         |-> labs.ini         (Calypso lab nodes)
 +         |-> test.ini         (Custom list for testing)
 +         |-> users.yml        (The main source for users IDs and assignation of groups, since we don't have access
 +                             to the HES LDAP to manage groups ourselves there. Contains UID/GID, shell and pass
 +                             only for the default/rescue user)
 +         |-> ansible.cfg      (Ansible local configuration for your user : python interpreter version for example)
 +         |
 +         L-> roles:-> <rolename>:
 +                                |
 +                                L-> files:       (Contains all files needed for your playbook, ansible checks this
 +                                |        |        directory first when you reference a file)
 +                                |        L-> authorized_keys/remi.key
 +                                |        L-> remi_home.tar.gz
 +                                |
 +                                L-> handlers:    (Small repetitive tasks to be called in a playbook, like restart a
 +                                |               systemd service)
 +                                |           L-> restart_mysql_then_apache.yml
 +                                |
 +                                L-> tasks:       (Main dir for all tasks to run)
 +                                |        L-> main.yml    (The first task called when the role is run)
 +                                |        L-> isc3.yml    (Supplementary tasks you can call in your main task)
 +                                |
 +                                L-> vars:
 +                                        L-> Specific variable file for the role
 +               
 +</code>
 +
 +Ansible is made to run all playbooks using this "playbooks" dir as your working directory. From there all relative paths works as intended.
 +
 +You can use some pre-defined playbooks using the Galaxy store :
 +
 +<code>
 +# List installed roles :
 +ansible-galaxy collection list
 +
 +# Installs a role from prometheus space called prometheus too :
 +ansible-galaxy collection install prometheus.prometheus
 +</code>
 +
 +You can run playbooks simply like this :
 +
 +<code>
 +ansible-playbook -i labs.ini calypso-sys.yml
 +</code>
 +
 +Or with more options :
 +
 +<code>
 +# Run only on calypso0 and calypso1, import the users.yml variable file to have all users UID/GID, start the playbook at the step that runs the ISC2 task
 +ansible-playbook -i labs.ini calypso-sys.yml --limit calypso0,calypso1 --extra-vars='@users.yml' --start-at-task="Check or Add ISC2 users"
 +</code>
 +
 +
 +
 +
 +
 ===== Ansible playbooks ===== ===== Ansible playbooks =====
  
Line 16: Line 84:
          |          |
          L-> roles:-> calypso-sys:    (Configures all calypso worker nodes, with all          L-> roles:-> calypso-sys:    (Configures all calypso worker nodes, with all
-                  |                    users, software, and system configs) 
-                  |-> rumba-sys:      (Configures rumba master, with all 
                   |                    users, software, and system configs)                   |                    users, software, and system configs)
                   |-> isc_compute:    (Configures Disco and Chacha users, software and system configs)                   |-> isc_compute:    (Configures Disco and Chacha users, software and system configs)
                   |-> julia:          (Installs Julia for a user, since there are no system-wide install)                   |-> julia:          (Installs Julia for a user, since there are no system-wide install)
-                  |-> k8s:            (Configures Kubernetes on all Calypso nodes)       +                  |-> k8s:            (Configures Kubernetes on all Calypso nodes
 +                  |-> learn           (TODO: Started a playbook to configure from scratch a webserver with all  
 +                  |                    Moodle prerequisites, to rebuild Hannibal in minutes)       
                   |-> master-sys:     (Configures system configs specific on calypsomaster only)                   |-> master-sys:     (Configures system configs specific on calypsomaster only)
                   |-> munge:          (Needed to authenticate SLURM nodes on Calypso and ISC Compute)                   |-> munge:          (Needed to authenticate SLURM nodes on Calypso and ISC Compute)
                   |-> nvidia-cuda:    (Needed to allow servers to use Nvidia GPUs)                   |-> nvidia-cuda:    (Needed to allow servers to use Nvidia GPUs)
-                  |-> prometheus:     (TODO : Installs prometheus exporters and server, separate in 2 playbooks) +                  |-> prometheus:     (Empty, TODO : Installs prometheus exporters and server, separate in 2 
-                  |-> slurm_research: (TODO : redo all installation part from compilation +                  |                    playbooks) 
 +                  |-> rumba-sys     (Configures rumba master, with all 
 +                  |                    users, software, and system configs) 
 +                  |-> slurm_research_TODO: (Empty, TODO : redo all installation part from compilation  
 +                  |                    install, separate install from config) 
 +                  |-> slurm_calypso:  (Empty, TODO : redo all installation part from compilation
                   |                    install, separate install from config)                   |                    install, separate install from config)
-                  |-> slurm_calypso (TODO : redo all installation part from compilation +                  |-> slurm_calypso_old : (Old installation of SLURM using ubuntu outdated packages) 
-                                       install, separate install from config)+                  L-> vps:             (Installs or checks base system config / users for Hannibal/Hasdrubal)
 </code> </code>
  
Back to top