--- /dev/null
+Teuthology
+==========
+
+This role is used to manage the main teuthology node in a lab, e.g.
+``teuthology.front.sepia.ceph.com``.
+
+It currently depends on the ``sudo`` and ``users`` roles.
+
+It also does the following:
+
+- Install dependencies required for ``teuthology``
+- Create the ``teuthology`` and ``teuthworker`` users which are used for
+ scheduling and executing tests, respectively
+- Clone ``teuthology`` repos into ``~/src/teuthology_master`` under those user accounts
+- Run ``teuthology``'s ``bootstrap`` script
+
+It currently does NOT do these things:
+
+- Manage crontab entries
+- Manage ``teuthology-worker`` processes
+- Run ``teuthology-nuke --stale``
--- /dev/null
+---
+teuthology_users:
+ # for scheduling tests
+ - teuthology
+ # for executing tests
+ - teuthworker
+
+teuthology_repo: https://github.com/ceph/teuthology.git
--- /dev/null
+---
+- name: Include package type specific vars.
+ include_vars: "apt_systems.yml"
+ tags:
+ - always
+
+- name: Install packages via apt
+ apt:
+ name: "{{ item }}"
+ state: latest
+ update_cache: yes
+ cache_valid_time: 600
+ with_items: "{{ teuthology_extra_packages }}"
+ tags:
+ - packages
--- /dev/null
+---
+- include: apt_systems.yml
+ when: ansible_pkg_mgr == "apt"
+
+# Yum systems support is not implemented yet.
+- include: yum_systems.yml
+ when: ansible_pkg_mgr == "yum"
+
+# Set up the different users that teuthology uses
+- include: setup_users.yml
--- /dev/null
+---
+- name: Create users
+ user:
+ name: "{{ item }}"
+ state: present
+ shell: /bin/bash
+ with_items: "{{ teuthology_users }}"
+ tags:
+ - user
+
+- name: Clone the teuthology repo
+ git:
+ repo: "{{ teuthology_repo }}"
+ dest: /home/{{ item }}/src/teuthology_master
+ sudo_user: "{{ item }}"
+ with_items: "{{ teuthology_users }}"
+ tags:
+ - repos
+
+- name: Run bootstrap
+ shell: NO_CLOBBER=true ./bootstrap
+ args:
+ chdir: /home/{{ item }}/src/teuthology_master/
+ sudo_user: "{{ item }}"
+ with_items: "{{ teuthology_users }}"
+ register: bootstrap
+ changed_when: bootstrap.stdout_lines[-1]|length > 60
+
+- name: Add teuthology scripts to PATH
+ lineinfile:
+ dest: /home/{{ item }}/.profile
+ regexp: teuthology_master
+ line: 'PATH="$HOME/src/teuthology_master/virtualenv/bin:$PATH"'
+ sudo_user: "{{ item }}"
+ with_items: "{{ teuthology_users }}"
+
+- name: Ensure teuthology is usable
+ shell: "./teuthology --version"
+ args:
+ chdir: /home/{{ item }}/src/teuthology_master/virtualenv/bin/
+ sudo_user: "{{ item }}"
+ with_items: "{{ teuthology_users }}"
+ changed_when: false
--- /dev/null
+---
+- fail:
+ msg: "yum systems are not supported at this time"
--- /dev/null
+---
+teuthology_extra_packages:
+ # The following packages are requirements for bootstrapping teuthology
+ - git-all
+ - python-dev
+ - python-pip
+ - python-virtualenv
+ - libevent-dev
+ - python-libvirt
+ - beanstalkd
+ # The following packages are requirements for running teuthology
+ - libmysqlclient-dev
+ - libffi-dev
+ - libssl-dev
+ - libyaml-dev