From: Michael Jeanson Date: Thu, 10 Sep 2015 18:21:02 +0000 (-0400) Subject: Basic ansible node provisionning X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3ea0152b9cf266cf1ea0ebaa3c2a475cd056b94a;p=lttng-ci.git Basic ansible node provisionning --- diff --git a/automation/ansible/ansible.cfg b/automation/ansible/ansible.cfg new file mode 100644 index 0000000..db1a3d4 --- /dev/null +++ b/automation/ansible/ansible.cfg @@ -0,0 +1,166 @@ +# config file for ansible -- http://ansible.com/ +# ============================================== + +# nearly all parameters can be overridden in ansible-playbook +# or with command line flags. ansible will read ANSIBLE_CONFIG, +# ansible.cfg in the current working directory, .ansible.cfg in +# the home directory or /etc/ansible/ansible.cfg, whichever it +# finds first + +[defaults] + +# some basic default values... + +hostfile = /etc/ansible/hosts +library = /usr/share/ansible +remote_tmp = $HOME/.ansible/tmp +pattern = * +forks = 5 +poll_interval = 15 +sudo_user = root +#ask_sudo_pass = True +#ask_pass = True +transport = smart +remote_port = 22 + +# additional paths to search for roles in, colon seperated +#roles_path = /etc/ansible/roles + +# uncomment this to disable SSH key host checking +#host_key_checking = False + +# change this for alternative sudo implementations +sudo_exe = sudo + +# what flags to pass to sudo +#sudo_flags = -H + +# SSH timeout +timeout = 10 + +# default user to use for playbooks if user is not specified +# (/usr/bin/ansible will use current user as default) +remote_user = root + +# logging is off by default unless this path is defined +# if so defined, consider logrotate +#log_path = /var/log/ansible.log + +# default module name for /usr/bin/ansible +#module_name = command + +# use this shell for commands executed under sudo +# you may need to change this to bin/bash in rare instances +# if sudo is constrained +#executable = /bin/sh + +# if inventory variables overlap, does the higher precedence one win +# or are hash values merged together? The default is 'replace' but +# this can also be set to 'merge'. +#hash_behaviour = replace + +# How to handle variable replacement - as of 1.2, Jinja2 variable syntax is +# preferred, but we still support the old $variable replacement too. +# Turn off ${old_style} variables here if you like. +#legacy_playbook_variables = yes + +# list any Jinja2 extensions to enable here: +#jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n + +# if set, always use this private key file for authentication, same as +# if passing --private-key to ansible or ansible-playbook +#private_key_file = /path/to/file + +# format of string {{ ansible_managed }} available within Jinja2 +# templates indicates to users editing templates files will be replaced. +# replacing {file}, {host} and {uid} and strftime codes with proper values. +ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host} + +# by default, ansible-playbook will display "Skipping [host]" if it determines a task +# should not be run on a host. Set this to "False" if you don't want to see these "Skipping" +# messages. NOTE: the task header will still be shown regardless of whether or not the +# task is skipped. +#display_skipped_hosts = True + +# by default (as of 1.3), Ansible will raise errors when attempting to dereference +# Jinja2 variables that are not set in templates or action lines. Uncomment this line +# to revert the behavior to pre-1.3. +#error_on_undefined_vars = False + +# set plugin path directories here, seperate with colons +action_plugins = /usr/share/ansible_plugins/action_plugins +callback_plugins = /usr/share/ansible_plugins/callback_plugins +connection_plugins = /usr/share/ansible_plugins/connection_plugins +lookup_plugins = /usr/share/ansible_plugins/lookup_plugins +vars_plugins = /usr/share/ansible_plugins/vars_plugins +filter_plugins = /usr/share/ansible_plugins/filter_plugins + +# don't like cows? that's unfortunate. +# set to 1 if you don't want cowsay support or export ANSIBLE_NOCOWS=1 +#nocows = 1 + +# don't like colors either? +# set to 1 if you don't want colors, or export ANSIBLE_NOCOLOR=1 +#nocolor = 1 + +# the CA certificate path used for validating SSL certs. This path +# should exist on the controlling node, not the target nodes +# common locations: +# RHEL/CentOS: /etc/pki/tls/certs/ca-bundle.crt +# Fedora : /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem +# Ubuntu : /usr/share/ca-certificates/cacert.org/cacert.org.crt +#ca_file_path = + +# the http user-agent string to use when fetching urls. Some web server +# operators block the default urllib user agent as it is frequently used +# by malicious attacks/scripts, so we set it to something unique to +# avoid issues. +#http_user_agent = ansible-agent + +[paramiko_connection] + +# uncomment this line to cause the paramiko connection plugin to not record new host +# keys encountered. Increases performance on new host additions. Setting works independently of the +# host key checking setting above. +#record_host_keys=False + +# by default, Ansible requests a pseudo-terminal for commands executed under sudo. Uncomment this +# line to disable this behaviour. +#pty=False + +[ssh_connection] + +# ssh arguments to use +# Leaving off ControlPersist will result in poor performance, so use +# paramiko on older platforms rather than removing it +#ssh_args = -o ControlMaster=auto -o ControlPersist=60s + +# The path to use for the ControlPath sockets. This defaults to +# "%(directory)s/ansible-ssh-%%h-%%p-%%r", however on some systems with +# very long hostnames or very long path names (caused by long user names or +# deeply nested home directories) this can exceed the character limit on +# file socket names (108 characters for most platforms). In that case, you +# may wish to shorten the string below. +# +# Example: +# control_path = %(directory)s/%%h-%%r +#control_path = %(directory)s/ansible-ssh-%%h-%%p-%%r + +# Enabling pipelining reduces the number of SSH operations required to +# execute a module on the remote server. This can result in a significant +# performance improvement when enabled, however when using "sudo:" you must +# first disable 'requiretty' in /etc/sudoers +# +# By default, this option is disabled to preserve compatibility with +# sudoers configurations that have requiretty (the default on many distros). +# +#pipelining = False + +# if True, make ansible use scp if the connection type is ssh +# (default is sftp) +#scp_if_ssh = True + +[accelerate] +accelerate_port = 5099 +accelerate_timeout = 30 +accelerate_connect_timeout = 5.0 diff --git a/automation/ansible/hosts b/automation/ansible/hosts new file mode 100644 index 0000000..2e33a16 --- /dev/null +++ b/automation/ansible/hosts @@ -0,0 +1,66 @@ +[hosts] +cloud01.internal.efficios.com +cloud02.internal.efficios.com +cloud03.internal.efficios.com +cloud04.internal.efficios.com +cloud05.internal.efficios.com +cloud06.internal.efficios.com +#cloud07.internal.efficios.com +#cloud08.internal.efficios.com + +[slave-armhf] +ci-slave-armhf-01 +ci-slave-armhf-02 + +[slave-powerpc] +ci-slave-powerpc-01 + +[slave-x32] +ci-slave-x32-02-01 +ci-slave-x32-02-02 +ci-slave-x32-02-03 +ci-slave-x32-02-04 +ci-slave-x32-03-01 +ci-slave-x32-03-02 +ci-slave-x32-03-03 +ci-slave-x32-03-04 +ci-slave-x32-04-01 +ci-slave-x32-04-02 +ci-slave-x32-04-03 +ci-slave-x32-04-04 +ci-slave-x32-05-01 +ci-slave-x32-05-02 +ci-slave-x32-05-03 +ci-slave-x32-05-04 +ci-slave-x32-06-01 +ci-slave-x32-06-02 +ci-slave-x32-06-03 +ci-slave-x32-06-04 + +[slave-x64] +ci-slave-x64-02-01 +ci-slave-x64-02-02 +ci-slave-x64-02-03 +ci-slave-x64-02-04 +ci-slave-x64-03-01 +ci-slave-x64-03-02 +ci-slave-x64-03-03 +ci-slave-x64-03-04 +ci-slave-x64-04-01 +ci-slave-x64-04-02 +ci-slave-x64-04-03 +ci-slave-x64-04-04 +ci-slave-x64-05-01 +ci-slave-x64-05-02 +ci-slave-x64-05-03 +ci-slave-x64-05-04 +ci-slave-x64-06-01 +ci-slave-x64-06-02 +ci-slave-x64-06-03 +ci-slave-x64-06-04 + +[slave:children] +slave-x32 +slave-x64 +slave-armhf +slave-powerpc diff --git a/automation/ansible/hosts.yml b/automation/ansible/hosts.yml new file mode 100644 index 0000000..f38a87e --- /dev/null +++ b/automation/ansible/hosts.yml @@ -0,0 +1,2 @@ +- hosts: hosts + roles: diff --git a/automation/ansible/playbooks/dist-upgrade.yml b/automation/ansible/playbooks/dist-upgrade.yml new file mode 100644 index 0000000..13cce73 --- /dev/null +++ b/automation/ansible/playbooks/dist-upgrade.yml @@ -0,0 +1,41 @@ +--- +- name: Dist upgrade and optionnal reboot + hosts: all + vars: + restart: 'no' + reboot_wait: 300 + + vars_prompt: + - name: reboot + prompt: "Enter 'yes' to reboot" + default: 'no' + private: no + + tasks: + - name: apt-get update + apt: update_cache=yes cache_valid_time=3600 + + - name: apt-get dist-upgrade + apt: upgrade=dist + + - name: apt-get autoremove + command: apt-get -y --purge autoremove + register: autoremove_output + changed_when: "'The following packages will be REMOVED' in autoremove_output.stdout" + + - name: reboot server + command: /sbin/reboot + async: 0 + poll: 0 + ignore_errors: true + when: reboot == "yes" + register: last_result + + - name: wait for the server to reboot + local_action: wait_for host={{ inventory_hostname }} + port=22 + delay=1 + timeout=300 + state=started + when: last_result.changed + sudo: false diff --git a/automation/ansible/roles/babeltrace/tasks/main.yml b/automation/ansible/roles/babeltrace/tasks/main.yml new file mode 100644 index 0000000..cd629fa --- /dev/null +++ b/automation/ansible/roles/babeltrace/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}.yml" + +- name: Define babeltrace_packages. + set_fact: + babeltrace_packages: "{{ __babeltrace_packages | list }}" + when: babeltrace_packages is not defined + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' diff --git a/automation/ansible/roles/babeltrace/tasks/setup-Debian.yml b/automation/ansible/roles/babeltrace/tasks/setup-Debian.yml new file mode 100644 index 0000000..01deb92 --- /dev/null +++ b/automation/ansible/roles/babeltrace/tasks/setup-Debian.yml @@ -0,0 +1,7 @@ +--- +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure babeltrace build dependencies are installed. + apt: "name={{ item }} state=installed" + with_items: babeltrace_packages diff --git a/automation/ansible/roles/babeltrace/tasks/setup-RedHat.yml b/automation/ansible/roles/babeltrace/tasks/setup-RedHat.yml new file mode 100644 index 0000000..283b5f5 --- /dev/null +++ b/automation/ansible/roles/babeltrace/tasks/setup-RedHat.yml @@ -0,0 +1,6 @@ +--- +- name: Ensure babeltrace build dependencies are installed. + yum: + name: "{{ item }}" + state: installed + with_items: babeltrace_packages diff --git a/automation/ansible/roles/babeltrace/vars/Debian.yml b/automation/ansible/roles/babeltrace/vars/Debian.yml new file mode 100644 index 0000000..f56aaf7 --- /dev/null +++ b/automation/ansible/roles/babeltrace/vars/Debian.yml @@ -0,0 +1,8 @@ +--- +__babeltrace_packages: + - libpopt-dev + - uuid-dev + - python3-dev + - python3-sphinx + - swig2.0 + - libglib2.0-dev diff --git a/automation/ansible/roles/babeltrace/vars/RedHat.yml b/automation/ansible/roles/babeltrace/vars/RedHat.yml new file mode 100644 index 0000000..67429a2 --- /dev/null +++ b/automation/ansible/roles/babeltrace/vars/RedHat.yml @@ -0,0 +1,3 @@ +--- +# TODO +__babeltrace_packages: diff --git a/automation/ansible/roles/common/tasks/main.yml b/automation/ansible/roles/common/tasks/main.yml new file mode 100644 index 0000000..d8c5382 --- /dev/null +++ b/automation/ansible/roles/common/tasks/main.yml @@ -0,0 +1,40 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}.yml" + +- name: Define common_packages. + set_fact: + common_packages: "{{ __common_packages | list }}" + when: common_packages is not defined + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' + +- name: Create sudoers.d directory. + file: + path: /etc/sudoers.d + owner: root + group: root + mode: 0755 + state: directory + +- name: Set includedir in /etc/sudoers. + lineinfile: + dest: /etc/sudoers + line: "#includedir /etc/sudoers.d" + state: present + validate: "/usr/sbin/visudo -cf %s" + +- name: Create jenkins sudoers file. + copy: + dest: "/etc/sudoers.d/jenkins" + content: "jenkins ALL=NOPASSWD: ALL" + mode: 0440 + owner: root + group: root + validate: "/usr/sbin/visudo -cf %s" diff --git a/automation/ansible/roles/common/tasks/setup-Debian.yml b/automation/ansible/roles/common/tasks/setup-Debian.yml new file mode 100644 index 0000000..878efd1 --- /dev/null +++ b/automation/ansible/roles/common/tasks/setup-Debian.yml @@ -0,0 +1,7 @@ +--- +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure common packages are installed. + apt: "name={{ item }} state=installed" + with_items: common_packages diff --git a/automation/ansible/roles/common/tasks/setup-RedHat.yml b/automation/ansible/roles/common/tasks/setup-RedHat.yml new file mode 100644 index 0000000..70f37de --- /dev/null +++ b/automation/ansible/roles/common/tasks/setup-RedHat.yml @@ -0,0 +1,6 @@ +--- +- name: Ensure common packages are installed. + yum: + name: "{{ item }}" + state: installed + with_items: common_packages diff --git a/automation/ansible/roles/common/vars/Debian.yml b/automation/ansible/roles/common/vars/Debian.yml new file mode 100644 index 0000000..ebd9b0d --- /dev/null +++ b/automation/ansible/roles/common/vars/Debian.yml @@ -0,0 +1,19 @@ +--- +__common_packages: + - sudo + - openjdk-7-jdk + - git + - vim + - tree + - htop + - build-essential + - clang + - automake + - autoconf + - libtool + - bison + - flex + - libtap-harness-archive-perl + - jq + - cppcheck + - python-virtualenv diff --git a/automation/ansible/roles/common/vars/RedHat.yml b/automation/ansible/roles/common/vars/RedHat.yml new file mode 100644 index 0000000..35f8482 --- /dev/null +++ b/automation/ansible/roles/common/vars/RedHat.yml @@ -0,0 +1,4 @@ +--- +# TODO +__common_packages: + - java-1.7.0-openjdk-headless diff --git a/automation/ansible/roles/liburcu/tasks/main.yml b/automation/ansible/roles/liburcu/tasks/main.yml new file mode 100644 index 0000000..867decb --- /dev/null +++ b/automation/ansible/roles/liburcu/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}.yml" + +- name: Define liburcu_packages. + set_fact: + liburcu_packages: "{{ __liburcu_packages | list }}" + when: liburcu_packages is not defined + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' diff --git a/automation/ansible/roles/liburcu/tasks/setup-Debian.yml b/automation/ansible/roles/liburcu/tasks/setup-Debian.yml new file mode 100644 index 0000000..58fdb62 --- /dev/null +++ b/automation/ansible/roles/liburcu/tasks/setup-Debian.yml @@ -0,0 +1,7 @@ +--- +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure liburcu build dependencies are installed. + apt: "name={{ item }} state=installed" + with_items: liburcu_packages diff --git a/automation/ansible/roles/liburcu/tasks/setup-RedHat.yml b/automation/ansible/roles/liburcu/tasks/setup-RedHat.yml new file mode 100644 index 0000000..4d60ebe --- /dev/null +++ b/automation/ansible/roles/liburcu/tasks/setup-RedHat.yml @@ -0,0 +1,6 @@ +--- +- name: Ensure liburcu build dependencies are installed. + yum: + name: "{{ item }}" + state: installed + with_items: liburcu_packages diff --git a/automation/ansible/roles/liburcu/vars/Debian.yml b/automation/ansible/roles/liburcu/vars/Debian.yml new file mode 100644 index 0000000..c597f60 --- /dev/null +++ b/automation/ansible/roles/liburcu/vars/Debian.yml @@ -0,0 +1,2 @@ +--- +__liburcu_packages: [] diff --git a/automation/ansible/roles/liburcu/vars/RedHat.yml b/automation/ansible/roles/liburcu/vars/RedHat.yml new file mode 100644 index 0000000..e6a75e7 --- /dev/null +++ b/automation/ansible/roles/liburcu/vars/RedHat.yml @@ -0,0 +1,3 @@ +--- +# TODO +__liburcu_packages: diff --git a/automation/ansible/roles/lttng-modules/tasks/main.yml b/automation/ansible/roles/lttng-modules/tasks/main.yml new file mode 100644 index 0000000..571bdb3 --- /dev/null +++ b/automation/ansible/roles/lttng-modules/tasks/main.yml @@ -0,0 +1,23 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}.yml" + +- name: Define lttng_modules_packages. + set_fact: + lttng_modules_packages: "{{ __lttng_modules_packages | list }}" + when: lttng_modules_packages is not defined + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' + +- name: checkout repo + git: repo=git://artifacts.internal.efficios.com/git/linux-stable.git + dest=/home/jenkins/gitcache/linux-stable.git + bare=yes + sudo: yes + sudo_user: jenkins diff --git a/automation/ansible/roles/lttng-modules/tasks/setup-Debian.yml b/automation/ansible/roles/lttng-modules/tasks/setup-Debian.yml new file mode 100644 index 0000000..0b90f5f --- /dev/null +++ b/automation/ansible/roles/lttng-modules/tasks/setup-Debian.yml @@ -0,0 +1,8 @@ +--- +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure lttng-modules build dependencies are installed. + apt: "name={{ item }} state=installed" + with_items: lttng_modules_packages + diff --git a/automation/ansible/roles/lttng-modules/tasks/setup-RedHat.yml b/automation/ansible/roles/lttng-modules/tasks/setup-RedHat.yml new file mode 100644 index 0000000..c4a3d55 --- /dev/null +++ b/automation/ansible/roles/lttng-modules/tasks/setup-RedHat.yml @@ -0,0 +1,6 @@ +--- +- name: Ensure lttng-modules build dependencies are installed. + yum: + name: "{{ item }}" + state: installed + with_items: lttng_modules_packages diff --git a/automation/ansible/roles/lttng-modules/vars/Debian.yml b/automation/ansible/roles/lttng-modules/vars/Debian.yml new file mode 100644 index 0000000..2b88bab --- /dev/null +++ b/automation/ansible/roles/lttng-modules/vars/Debian.yml @@ -0,0 +1,2 @@ +--- +__lttng_modules_packages: [] diff --git a/automation/ansible/roles/lttng-modules/vars/RedHat.yml b/automation/ansible/roles/lttng-modules/vars/RedHat.yml new file mode 100644 index 0000000..2b88bab --- /dev/null +++ b/automation/ansible/roles/lttng-modules/vars/RedHat.yml @@ -0,0 +1,2 @@ +--- +__lttng_modules_packages: [] diff --git a/automation/ansible/roles/lttng-tools/tasks/main.yml b/automation/ansible/roles/lttng-tools/tasks/main.yml new file mode 100644 index 0000000..e489481 --- /dev/null +++ b/automation/ansible/roles/lttng-tools/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}.yml" + +- name: Define lttng_tools_packages. + set_fact: + lttng_tools_packages: "{{ __lttng_tools_packages | list }}" + when: lttng_tools_packages is not defined + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' diff --git a/automation/ansible/roles/lttng-tools/tasks/setup-Debian.yml b/automation/ansible/roles/lttng-tools/tasks/setup-Debian.yml new file mode 100644 index 0000000..2b5750e --- /dev/null +++ b/automation/ansible/roles/lttng-tools/tasks/setup-Debian.yml @@ -0,0 +1,7 @@ +--- +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure lttng-tools build dependencies are installed. + apt: "name={{ item }} state=installed" + with_items: lttng_tools_packages diff --git a/automation/ansible/roles/lttng-tools/tasks/setup-RedHat.yml b/automation/ansible/roles/lttng-tools/tasks/setup-RedHat.yml new file mode 100644 index 0000000..3774b33 --- /dev/null +++ b/automation/ansible/roles/lttng-tools/tasks/setup-RedHat.yml @@ -0,0 +1,6 @@ +--- +- name: Ensure lttng-tools build dependencies are installed. + yum: + name: "{{ item }}" + state: installed + with_items: lttng_tools_packages diff --git a/automation/ansible/roles/lttng-tools/vars/Debian.yml b/automation/ansible/roles/lttng-tools/vars/Debian.yml new file mode 100644 index 0000000..d3d2107 --- /dev/null +++ b/automation/ansible/roles/lttng-tools/vars/Debian.yml @@ -0,0 +1,5 @@ +--- +__lttng_tools_packages: + - libpopt-dev + - libxml2-dev + - bash-completion diff --git a/automation/ansible/roles/lttng-tools/vars/RedHat.yml b/automation/ansible/roles/lttng-tools/vars/RedHat.yml new file mode 100644 index 0000000..4ea6f38 --- /dev/null +++ b/automation/ansible/roles/lttng-tools/vars/RedHat.yml @@ -0,0 +1,3 @@ +--- +# TODO +__lttng_tools_packages: diff --git a/automation/ansible/roles/lttng-ust/tasks/main.yml b/automation/ansible/roles/lttng-ust/tasks/main.yml new file mode 100644 index 0000000..9585275 --- /dev/null +++ b/automation/ansible/roles/lttng-ust/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}.yml" + +- name: Define lttng_ust_packages. + set_fact: + lttng_ust_packages: "{{ __lttng_ust_packages | list }}" + when: lttng_ust_packages is not defined + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' diff --git a/automation/ansible/roles/lttng-ust/tasks/setup-Debian.yml b/automation/ansible/roles/lttng-ust/tasks/setup-Debian.yml new file mode 100644 index 0000000..20b07ef --- /dev/null +++ b/automation/ansible/roles/lttng-ust/tasks/setup-Debian.yml @@ -0,0 +1,7 @@ +--- +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure lttng-ust build dependencies are installed. + apt: "name={{ item }} state=installed" + with_items: lttng_ust_packages diff --git a/automation/ansible/roles/lttng-ust/tasks/setup-RedHat.yml b/automation/ansible/roles/lttng-ust/tasks/setup-RedHat.yml new file mode 100644 index 0000000..78b8954 --- /dev/null +++ b/automation/ansible/roles/lttng-ust/tasks/setup-RedHat.yml @@ -0,0 +1,6 @@ +--- +- name: Ensure lttng-ust build dependencies are installed. + yum: + name: "{{ item }}" + state: installed + with_items: lttng_ust_packages diff --git a/automation/ansible/roles/lttng-ust/vars/Debian.yml b/automation/ansible/roles/lttng-ust/vars/Debian.yml new file mode 100644 index 0000000..6b14b8d --- /dev/null +++ b/automation/ansible/roles/lttng-ust/vars/Debian.yml @@ -0,0 +1,7 @@ +--- +__lttng_ust_packages: + - uuid-dev + - texinfo + - python3 + - liblog4j1.2-java + - default-jdk diff --git a/automation/ansible/roles/lttng-ust/vars/RedHat.yml b/automation/ansible/roles/lttng-ust/vars/RedHat.yml new file mode 100644 index 0000000..1e8ed60 --- /dev/null +++ b/automation/ansible/roles/lttng-ust/vars/RedHat.yml @@ -0,0 +1,3 @@ +--- +# TODO +__lttng_ust_packages: diff --git a/automation/ansible/roles/tracecompass/tasks/main.yml b/automation/ansible/roles/tracecompass/tasks/main.yml new file mode 100644 index 0000000..b53e0e6 --- /dev/null +++ b/automation/ansible/roles/tracecompass/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}.yml" + +- name: Define tracecompass_packages. + set_fact: + tracecompass_packages: "{{ __tracecompass_packages | list }}" + when: tracecompass_packages is not defined + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' diff --git a/automation/ansible/roles/tracecompass/tasks/setup-Debian.yml b/automation/ansible/roles/tracecompass/tasks/setup-Debian.yml new file mode 100644 index 0000000..38c9141 --- /dev/null +++ b/automation/ansible/roles/tracecompass/tasks/setup-Debian.yml @@ -0,0 +1,20 @@ +--- +- name: install pycurl package in order to use the apt_repository module + apt: pkg=python-pycurl state=present + +- name: Add OpenJDK ppa. + apt_repository: repo='ppa:openjdk-r/ppa' + +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure ubuntu-desktop is installed. + apt: "name=ubuntu-desktop install_recommends=no" + +- name: Ensure lightdm service is stopped. + service: name=lightdm state=stopped enabled=no + +- name: Ensure tracecompass build dependencies are installed. + apt: "name={{ item }} state=installed" + with_items: tracecompass_packages + diff --git a/automation/ansible/roles/tracecompass/tasks/setup-RedHat.yml b/automation/ansible/roles/tracecompass/tasks/setup-RedHat.yml new file mode 100644 index 0000000..04fd43a --- /dev/null +++ b/automation/ansible/roles/tracecompass/tasks/setup-RedHat.yml @@ -0,0 +1,6 @@ +--- +- name: Ensure tracecompass build dependencies are installed. + yum: + name: "{{ item }}" + state: installed + with_items: tracecompass_packages diff --git a/automation/ansible/roles/tracecompass/vars/Debian.yml b/automation/ansible/roles/tracecompass/vars/Debian.yml new file mode 100644 index 0000000..bb85ca3 --- /dev/null +++ b/automation/ansible/roles/tracecompass/vars/Debian.yml @@ -0,0 +1,12 @@ +--- +__tracecompass_packages: + - openjdk-7-jdk + - openjdk-8-jdk + - metacity + - xfonts-100dpi + - xfonts-75dpi + - xfonts-scalable + - xfonts-cyrillic + - xvfb + - x11-apps + - imagemagick diff --git a/automation/ansible/roles/tracecompass/vars/RedHat.yml b/automation/ansible/roles/tracecompass/vars/RedHat.yml new file mode 100644 index 0000000..f2b9ed6 --- /dev/null +++ b/automation/ansible/roles/tracecompass/vars/RedHat.yml @@ -0,0 +1,3 @@ +--- +# TODO +__tracecompass_packages: diff --git a/automation/ansible/site.yml b/automation/ansible/site.yml new file mode 100644 index 0000000..de0d5da --- /dev/null +++ b/automation/ansible/site.yml @@ -0,0 +1,6 @@ +--- +- include: hosts.yml +- include: slave-armhf.yml +- include: slave-powerpc.yml +- include: slave-x32.yml +- include: slave-x64.yml diff --git a/automation/ansible/slave-armhf.yml b/automation/ansible/slave-armhf.yml new file mode 100644 index 0000000..6cee629 --- /dev/null +++ b/automation/ansible/slave-armhf.yml @@ -0,0 +1,7 @@ +- hosts: slave-armhf + roles: + - common + - babeltrace + - liburcu + - lttng-ust + - lttng-tools diff --git a/automation/ansible/slave-powerpc.yml b/automation/ansible/slave-powerpc.yml new file mode 100644 index 0000000..f87cc00 --- /dev/null +++ b/automation/ansible/slave-powerpc.yml @@ -0,0 +1,7 @@ +- hosts: slave-powerpc + roles: + - common + - babeltrace + - liburcu + - lttng-ust + - lttng-tools diff --git a/automation/ansible/slave-x32.yml b/automation/ansible/slave-x32.yml new file mode 100644 index 0000000..e620adf --- /dev/null +++ b/automation/ansible/slave-x32.yml @@ -0,0 +1,9 @@ +- hosts: slave-x32 + roles: + - common + - babeltrace + - liburcu + - lttng-ust + - lttng-tools + - lttng-modules + - tracecompass diff --git a/automation/ansible/slave-x64.yml b/automation/ansible/slave-x64.yml new file mode 100644 index 0000000..4bfbbdf --- /dev/null +++ b/automation/ansible/slave-x64.yml @@ -0,0 +1,9 @@ +- hosts: slave-x64 + roles: + - common + - babeltrace + - liburcu + - lttng-ust + - lttng-tools + - lttng-modules + - tracecompass