blob: 97ae78734e53866503d345b2187dc941092672c1 [file] [log] [blame]
---
- hosts: all
remote_user: chrome-bot
become_user: root
become: yes
become_method: sudo
vars:
interface_templ: "./interfaces.j2"
expanded_interface: "/etc/network/interfaces"
vars_prompt:
- name: "interface"
prompt: "What is ethernet interface? If you don't know, run ifconfig first"
private: no
tasks:
- name: Update and Upgrade
apt: upgrade=dist update_cache=yes
- name: Install openssh-server
apt: name=openssh-server
# These are needed to run swarming
- name: Install libssl-dev
apt: name=libssl-dev
- name: Install openssl
apt: name=openssl
- name: Install time
apt: name=time
- name: Install build-essential
apt: name=build-essential
- name: Install swig
apt: name=swig
- name: Install python-m2crypto
apt: name=python-m2crypto
- name: Install ntpdate
apt: name=ntpdate
- name: Install python-pip
apt: name=python-pip
# These are needed to run our swarming tests
# These are needed for general use
- name: Install git
apt: name=git
- name: Install collectd, without the JDK
apt: name=collectd install_recommends=no
- name: generate chrome-bot ssh
user: name=chrome-bot generate_ssh_key=yes ssh_key_bits=2048 ssh_key_file=.ssh/id_rsa
- name: Get collectd config situated
copy: src=../common/collectd.conf dest=/etc/collectd/collectd.conf owner=root group=root mode=0644
- name: Start collectd
service: name=collectd state=restarted enabled=true
- name: create /b
file:
state: directory
path: /b
mode: 0777
owner: root
group: root
- name: Touch .boto
file:
path: /home/chrome-bot/.boto
owner: chrome-bot
group: chrome-bot
state: touch
mode: 0644
- name: make sudo reboot passwordless
lineinfile: dest=/etc/sudoers line="chrome-bot ALL=NOPASSWD:/sbin/shutdown -r now"
- name: disable wifi
command: nmcli radio wifi off
- name: enable auto-login
blockinfile:
dest: /etc/lightdm/lightdm.conf.d/50-myconfig.conf
create: yes
block: |
[SeatDefaults]
autologin-user=chrome-bot
- name: "Checking MAC pause support"
command: "/sbin/ethtool -A {{interface}}"
register: mac_pause
ignore_errors: True
# This takes the pre-existing /etc/network/interfaces template
# (which is a jinja2 template, as per ansible spec) and fills in
# the interface name.
- name: disable ethernet flow control
# mac_pause.rc means the return code from the previous command (mac_pause)
# The magic number 78 is returned when configuring MAC PAUSE is supported
# but no params were passed in (which we did intentionally above.)
# If MAC_PAUSE is not supported, something else will be returned
# (e.g. 77 "Operation not supported" )
when: mac_pause.rc == 78
template:
src: "{{interface_templ}}"
dest: "{{expanded_interface}}"
owner: root
group: root
mode: 0644
force: yes
backup: yes