config management - raeker/ARC-Wiki-Test GitHub Wiki

Advanced Research Computing : Config Management

Ansible Configuration management for various systems and services

Style Guide

This is the preliminary style guide for writing Ansible playbooks and roles.

General

  • YAML files - files should use 2 space indents and end in .yml

Variables

  • Use jinja variable syntax and use space around the variable name Example: {{ var }}
  • Variable Naming - Variable names should adhere to the Ansible style guide: lower-case and separated by underscores. If it is a role variable, then the variable should be prefixed by the role name.
  • Examples: cluster_type, moab_version
  • Role Naming - Role names should be written in (lower) camel case
  • Example: torqueServer
  • Use YAML style blocks
  • Good:
  • - file: dest: "{{ test }}" src: "./foo.txt" mode: 0770 state: present user: "root" group: "wheel"
  • Bad: - file: > dest={{ test }} src=./foo.txt mode=0770 state=present user=root group=wheel

Ansible facts

  • ansible_hostname
  • Short host of the host
  • ansible_fqdn
  • Fully qualified hostname

ARC-TS variables

  • cluster_type
  • hpc, hadoop, storage
  • inventory
  • Inventory type. One of: prod, dev
  • dns_domain
  • Network domain (e.g. arc-ts.umich.edu) ~
⚠️ **GitHub.com Fallback** ⚠️