Full Ganglia Configuration as a Playbook

You can do all the steps by executing the following playbook (you must change it to match your cluster.)

---
- name: Install gmond in the master node
  hosts: master

  tasks:
    - name: Install Ganglia gmetad and webfrontend
      yum:
        name: ['ganglia-gmond', 'ganglia-gmetad', 'ganglia-web']
        state: latest

    - name: Configure Ganglia gmetad daemon
      copy:
        src: gmetad.conf
        dest: /etc/ganglia/gmetad.conf

    - name: Configure Ganglia gmond daemon
      copy:
        src: gmond.conf
        dest: /etc/ganglia/gmond.conf

    - name: Configure /ganglia in webserver
      copy:
        src: ganglia.conf
        dest: /etc/httpd/conf.d/ganglia.conf

    - name: Enable and Restart Ganglia gmetad daemon
      service: name={{item}} enabled=yes state=restarted
      with_items:
        - gmond
        - gmetad
        - httpd

- name: Install ganglia in masters
  hosts: compute

  tasks:
    - name: Install Ganglia gmond daemon
      yum:
        name: ganglia-gmond
        state: latest

    - name: Configure Ganglia gmond daemon
      copy:
        src: gmond.conf
        dest: /etc/ganglia/gmond.conf
        owner: root
        group: root
        mode: "u=rw,g=r,o=r"
        force: yes

    - name: Enable and Restart Ganglia gmond daemon
      service:
        name: gmond
        enabled: yes
        state: restarted

...

The files gmetad.conf, gmond.conf and ganglia.conf must be in the playbook’s path.