diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/hosts/README | 4 | ||||
-rwxr-xr-x | config/hosts/do_config.sh | 5 | ||||
-rwxr-xr-x | config/hosts/runner/do_runner.sh | 2 | ||||
-rw-r--r-- | config/hosts/runner/roles/sdmux/tasks/main.yml | 66 | ||||
-rw-r--r-- | config/hosts/runner/roles/system/tasks/main.yml | 35 | ||||
-rw-r--r-- | config/hosts/runner/roles/testlab/tasks/main.yml | 16 | ||||
-rw-r--r-- | config/hosts/runner/roles/user/tasks/main.yml | 25 | ||||
-rw-r--r-- | config/hosts/runner/runner.yml | 14 |
8 files changed, 165 insertions, 2 deletions
diff --git a/config/hosts/README b/config/hosts/README index e9d3bc5..9034737 100644 --- a/config/hosts/README +++ b/config/hosts/README @@ -26,5 +26,5 @@ Next step is to install ssh key in order to be able to run other scripts. To do that run script named 'installkey.sh'. It will execute ansible playbook 'installsshkey.yml' and you will have to enter password for specified user. -Now you can run script 'do_config.sh' which will execute ansible with playbook -for 'master' machine. +Now you can run script 'do_config.sh' which will execute ansible with playbooks +for 'master' and 'runner' machines. diff --git a/config/hosts/do_config.sh b/config/hosts/do_config.sh index 6d14ba6..fdce8c9 100755 --- a/config/hosts/do_config.sh +++ b/config/hosts/do_config.sh @@ -3,3 +3,8 @@ cd master ./do_master.sh cd .. + +cd runner +./do_runner.sh + +cd .. diff --git a/config/hosts/runner/do_runner.sh b/config/hosts/runner/do_runner.sh new file mode 100755 index 0000000..7e4c23c --- /dev/null +++ b/config/hosts/runner/do_runner.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ansible-playbook runner.yml --inventory-file=../hosts diff --git a/config/hosts/runner/roles/sdmux/tasks/main.yml b/config/hosts/runner/roles/sdmux/tasks/main.yml new file mode 100644 index 0000000..35d52d7 --- /dev/null +++ b/config/hosts/runner/roles/sdmux/tasks/main.yml @@ -0,0 +1,66 @@ +--- +# This role builds and installs sd-mux-ctrl project and all its dependencies + +- name: Install system tools + apt: "name={{ item }} state=present" + with_items: + - git + - pkg-config + +- name: Install build tools + apt: "name={{ item }} state=present" + with_items: + - gcc + - g++ + - make + - cmake + +- name: Install devel libraries + apt: "name={{ item }} state=present" + with_items: + - libpopt-dev + - libusb-1.0-0-dev + +- name: Install runtime libraries + apt: "name={{ item }} state=present" + with_items: + - libpopt0 + - libusb-1.0-0 + +- name: Clone sd-mux repo + git: + repo: git://git.tizen.org/tools/testlab/sd-mux + dest: ~/sd-mux + register: sdmuxclone + +- name: Create sd-mux build dir + file: + state: directory + path: ~/sd-mux/build + +- name: Clone libftdi1.2 repo + git: + repo: git://developer.intra2net.com/libftdi + dest: ~/libftdi1 + register: libftdiclone + +- name: Create libftdi1.2 build dir + file: + state: directory + path: ~/libftdi1/build + +- name: Build libftdi + command: "{{ item }} chdir=~/libftdi1/build" + with_items: + - cmake -DCMAKE_INSTALL_PREFIX="/usr" ../ + - make + - make install + when: libftdiclone.changed + +- name: Build sd-mux + command: "{{ item }} chdir=~/sd-mux/build" + with_items: + - cmake .. + - make + - make install + when: sdmuxclone.changed diff --git a/config/hosts/runner/roles/system/tasks/main.yml b/config/hosts/runner/roles/system/tasks/main.yml new file mode 100644 index 0000000..b7b7229 --- /dev/null +++ b/config/hosts/runner/roles/system/tasks/main.yml @@ -0,0 +1,35 @@ +--- +# This role configures system and installs needed packages + +- name: Add apt repository from Tizen + apt_repository: + repo: 'deb http://download.tizen.org/tools/archive/15.01/Ubuntu_14.04/ /' + +- name: Update packages info + apt: + update_cache: yes + force: yes + +- name: Upgrade packages + apt: + upgrade: full + force: yes + +- name: Install testlab-major dependencies + apt: "name={{ item }} state=present force=yes" + with_items: + - git + - pkg-config + - sdb + - bmap-tools + - uuid-runtime + - sshpass + - lockfile-progs + +- name: Instal build tools + apt: "name={{ item }} state=present force=yes" + with_items: + - gcc + - g++ + - make + - cmake diff --git a/config/hosts/runner/roles/testlab/tasks/main.yml b/config/hosts/runner/roles/testlab/tasks/main.yml new file mode 100644 index 0000000..b1ce839 --- /dev/null +++ b/config/hosts/runner/roles/testlab/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# This role does the job related to testlab-major + +- name: Prepare testlab-major directory + file: + path: /opt/testlab-major + state: directory + owner: "{{ username }}" + group: "{{ username }}" + +- name: Clone testlab-major repo + become: yes + become_user: "{{ username }}" + git: + repo: git://git.tizen.org/tools/testlab/major + dest: /opt/testlab-major diff --git a/config/hosts/runner/roles/user/tasks/main.yml b/config/hosts/runner/roles/user/tasks/main.yml new file mode 100644 index 0000000..51ab5e7 --- /dev/null +++ b/config/hosts/runner/roles/user/tasks/main.yml @@ -0,0 +1,25 @@ +--- +# This playbook creates and sets up a user + +- name: "Add group {{ username }}" + group: + name: "{{ username }}" + +# Create user +- name: "Add user {{ username }}" + user: + name: "{{ username }}" + groups: "{{ username }},sudo,plugdev" + home: "/home/{{ username }}" + +- name: Allow the user to be passwordless sudoer + lineinfile: + dest: /etc/sudoers + state: present + regexp: '^{{ username }}' + line: '{{ username }} ALL=(ALL) NOPASSWD: ALL' + +- name: Install ssh key for the user + authorized_key: + user: "{{ username }}" + key: "{{ lookup('file', '~/tmp/id_rsa.pub') }}" diff --git a/config/hosts/runner/runner.yml b/config/hosts/runner/runner.yml new file mode 100644 index 0000000..bd74707 --- /dev/null +++ b/config/hosts/runner/runner.yml @@ -0,0 +1,14 @@ +--- +# This playbook configures runner machine + +- hosts: runner + become: yes + become_method: sudo + vars: + username: pita # Prerelease Image Testing Automation + + roles: + - user + - system + - sdmux + - testlab |