diff --git a/admin/files/hosts b/admin/files/hosts new file mode 100644 index 00000000..55eb3dc3 --- /dev/null +++ b/admin/files/hosts @@ -0,0 +1,3 @@ +127.0.0.1 localhost +::1 localhost +255.255.255.255 broadcasthost diff --git a/common/ssh/Ms2ger.pub b/admin/files/ssh/Ms2ger.pub similarity index 100% rename from common/ssh/Ms2ger.pub rename to admin/files/ssh/Ms2ger.pub diff --git a/common/ssh/ajeffrey.pub b/admin/files/ssh/ajeffrey.pub similarity index 100% rename from common/ssh/ajeffrey.pub rename to admin/files/ssh/ajeffrey.pub diff --git a/common/ssh/aneeshusa.pub b/admin/files/ssh/aneeshusa.pub similarity index 100% rename from common/ssh/aneeshusa.pub rename to admin/files/ssh/aneeshusa.pub diff --git a/common/ssh/avadacatavra.pub b/admin/files/ssh/avadacatavra.pub similarity index 100% rename from common/ssh/avadacatavra.pub rename to admin/files/ssh/avadacatavra.pub diff --git a/common/ssh/edunham.pub b/admin/files/ssh/edunham.pub similarity index 100% rename from common/ssh/edunham.pub rename to admin/files/ssh/edunham.pub diff --git a/common/ssh/emilio.pub b/admin/files/ssh/emilio.pub similarity index 100% rename from common/ssh/emilio.pub rename to admin/files/ssh/emilio.pub diff --git a/common/ssh/gw.pub b/admin/files/ssh/gw.pub similarity index 100% rename from common/ssh/gw.pub rename to admin/files/ssh/gw.pub diff --git a/common/ssh/jack.pub b/admin/files/ssh/jack.pub similarity index 100% rename from common/ssh/jack.pub rename to admin/files/ssh/jack.pub diff --git a/common/ssh/jdm.pub b/admin/files/ssh/jdm.pub similarity index 100% rename from common/ssh/jdm.pub rename to admin/files/ssh/jdm.pub diff --git a/common/ssh/larsberg.pub b/admin/files/ssh/larsberg.pub similarity index 100% rename from common/ssh/larsberg.pub rename to admin/files/ssh/larsberg.pub diff --git a/common/ssh/manishearth.pub b/admin/files/ssh/manishearth.pub similarity index 100% rename from common/ssh/manishearth.pub rename to admin/files/ssh/manishearth.pub diff --git a/common/ssh/mbrubeck.pub b/admin/files/ssh/mbrubeck.pub similarity index 100% rename from common/ssh/mbrubeck.pub rename to admin/files/ssh/mbrubeck.pub diff --git a/common/ssh/mwu.pub b/admin/files/ssh/mwu.pub similarity index 100% rename from common/ssh/mwu.pub rename to admin/files/ssh/mwu.pub diff --git a/common/ssh/notriddle.pub b/admin/files/ssh/notriddle.pub similarity index 100% rename from common/ssh/notriddle.pub rename to admin/files/ssh/notriddle.pub diff --git a/common/ssh/nox.pub b/admin/files/ssh/nox.pub similarity index 100% rename from common/ssh/nox.pub rename to admin/files/ssh/nox.pub diff --git a/common/ssh/pcwalton.pub b/admin/files/ssh/pcwalton.pub similarity index 100% rename from common/ssh/pcwalton.pub rename to admin/files/ssh/pcwalton.pub diff --git a/common/ssh/simonsapin.pub b/admin/files/ssh/simonsapin.pub similarity index 100% rename from common/ssh/simonsapin.pub rename to admin/files/ssh/simonsapin.pub diff --git a/admin/init.sls b/admin/init.sls index f11cf433..e9a8f5a4 100644 --- a/admin/init.sls +++ b/admin/init.sls @@ -1,3 +1,5 @@ +{% from tpldir ~ '/map.jinja' import admin %} + admin-packages: pkg.installed: - pkgs: @@ -8,3 +10,26 @@ admin-packages: {% else %} - mobile-shell {% endif %} + +{% if grains['os'] != 'MacOS' %} +UTC: + timezone.system +{% endif %} + +/etc/hosts: + file.managed: + - user: root + {% if grains['os'] == 'MacOS' %} + - group: wheel + {% elif grains['os'] == 'Ubuntu' %} + - group: root + {% endif %} + - mode: 644 + - source: salt://{{ tpldir }}/files/hosts + +{% for ssh_user in admin.ssh_users %} +sshkey-{{ ssh_user }}: + ssh_auth.present: + - user: root + - source: salt://{{ tpldir }}/files/ssh/{{ ssh_user }}.pub +{% endfor %} diff --git a/admin/map.jinja b/admin/map.jinja new file mode 100644 index 00000000..3d1ea2e4 --- /dev/null +++ b/admin/map.jinja @@ -0,0 +1,22 @@ +{% + set admin = { + 'ssh_users': [ + 'ajeffrey', + 'aneeshusa', + 'avadacatavra', + 'edunham', + 'emilio', + 'gw', + 'jack', + 'jdm', + 'larsberg', + 'manishearth', + 'mbrubeck', + 'Ms2ger', + 'mwu', + 'notriddle', + 'pcwalton', + 'simonsapin' + ] + } +%} diff --git a/buildbot/master/init.sls b/buildbot/master/init.sls index 97a6b6e4..19285a9e 100644 --- a/buildbot/master/init.sls +++ b/buildbot/master/init.sls @@ -1,5 +1,8 @@ {% from 'common/map.jinja' import common %} +include: + - python + buildbot-master: pip.installed: - pkgs: diff --git a/buildbot/slave/init.sls b/buildbot/slave/init.sls index 6faf2e69..2263d6d9 100644 --- a/buildbot/slave/init.sls +++ b/buildbot/slave/init.sls @@ -1,5 +1,8 @@ {% from 'common/map.jinja' import common %} +include: + - python + buildbot-slave-dependencies: pip.installed: - pkgs: diff --git a/common/init.sls b/common/init.sls index 6210a870..fccc2436 100644 --- a/common/init.sls +++ b/common/init.sls @@ -1,65 +1,7 @@ {% from tpldir ~ '/map.jinja' import common %} -python2: - pkg.installed: - - pkgs: - - python - {% if grains['os'] == 'MacOS' %} - - refresh: True - {% endif %} - -python3: - pkg.installed: - - pkgs: - - python3 - -{% if grains['os'] == 'Ubuntu' %} -python2-dev: - pkg.installed: - - pkgs: - - python-dev -{% endif %} - -pip: - pkg.installed: - - pkgs: - {% if grains['os'] == 'Ubuntu' %} - - python-pip - {% elif grains['os'] == 'MacOS' %} - - python # pip is included with python in homebrew - {% endif %} - - reload_modules: True - -# virtualenv == 14.0.6 package creates virtualenv and virtualenv-3.5 executables -# note that the version of the second may change between virtualenv versions -virtualenv: - pip.installed: - - pkgs: - - virtualenv == 14.0.6 - - require: - - pkg: pip - servo: user.present: - fullname: Tom Servo - shell: /bin/bash - home: {{ common.servo_home }} - -{% if grains['os'] != 'MacOS' %} -UTC: - timezone.system -{% endif %} - -{% for hostname, ip in common.hosts.items() %} -host-{{ hostname }}: - host.present: - - name: {{ hostname }} - - ip: {{ ip }} -{% endfor %} - -{% for ssh_user in common.ssh_users %} -sshkey-{{ ssh_user }}: - ssh_auth.present: - - user: root - - source: salt://{{ tpldir }}/ssh/{{ ssh_user }}.pub -{% endfor %} diff --git a/common/map.jinja b/common/map.jinja index b2b231d2..7addfe9b 100644 --- a/common/map.jinja +++ b/common/map.jinja @@ -2,49 +2,12 @@ set common = salt['grains.filter_by']({ 'defaults': { 'servo_home': '/home/servo', - 'hosts': { - 'servo-master': '96.126.125.232', - 'servo-linux1': '66.228.48.56', - 'servo-linux2': '173.255.201.95', - 'servo-linux3': '45.79.167.177', - 'servo-linux-android1': '72.14.176.110', - 'servo-mac1': '208.52.161.130', - 'servo-mac3': '63.135.170.19', - }, - 'ssh_users': [ - 'ajeffrey', - 'aneeshusa', - 'avadacatavra', - 'edunham', - 'emilio', - 'gw', - 'jack', - 'jdm', - 'larsberg', - 'manishearth', - 'mbrubeck', - 'Ms2ger', - 'mwu', - 'notriddle', - 'pcwalton', - 'simonsapin' - ] }, - 'Darwin': { + 'MacOS': { 'servo_home': '/Users/servo' } }, base='defaults', - grain='kernel' - ) -%} -{% - set homebrew = salt['grains.filter_by']({ - 'defaults': {}, - 'Darwin': { 'user': 'administrator' } - }, - base='defaults', - merge=salt.pillar.get('homebrew', {}), - grain='kernel' + grain='os' ) %} diff --git a/homu/init.sls b/homu/init.sls index e77720fb..d4369597 100644 --- a/homu/init.sls +++ b/homu/init.sls @@ -1,5 +1,8 @@ {% from tpldir ~ '/map.jinja' import homu %} +include: + - python + homu-debugging-packages: pkg.installed: - pkgs: diff --git a/intermittent-tracker/init.sls b/intermittent-tracker/init.sls index 2fa56c3d..77b45dd0 100644 --- a/intermittent-tracker/init.sls +++ b/intermittent-tracker/init.sls @@ -1,5 +1,8 @@ {% from tpldir ~ '/map.jinja' import tracker %} +include: + - python + tracker-debugging-packages: pip.installed: - pkgs: diff --git a/python/init.sls b/python/init.sls new file mode 100644 index 00000000..929f4b2f --- /dev/null +++ b/python/init.sls @@ -0,0 +1,38 @@ +python2: + pkg.installed: + - pkgs: + - python + {% if grains['os'] == 'MacOS' %} + - refresh: True + {% endif %} + +python3: + pkg.installed: + - pkgs: + - python3 + +{% if grains['os'] == 'Ubuntu' %} +python2-dev: + pkg.installed: + - pkgs: + - python-dev +{% endif %} + +pip: + pkg.installed: + - pkgs: + {% if grains['os'] == 'Ubuntu' %} + - python-pip + {% elif grains['os'] == 'MacOS' %} + - python # pip is included with python in homebrew + {% endif %} + - reload_modules: True + +# virtualenv == 14.0.6 package creates virtualenv and virtualenv-3.5 executables +# note that the version of the second may change between virtualenv versions +virtualenv: + pip.installed: + - pkgs: + - virtualenv == 14.0.6 + - require: + - pkg: pip diff --git a/servo-build-dependencies/android.sls b/servo-build-dependencies/android.sls index 1c855714..75bf9010 100644 --- a/servo-build-dependencies/android.sls +++ b/servo-build-dependencies/android.sls @@ -1,6 +1,9 @@ {% from 'common/map.jinja' import common %} {% from tpldir ~ '/map.jinja' import android %} +include: + - python + {% if '64' in grains['cpuarch'] %} enable-i386-architecture: file.managed: diff --git a/servo-build-dependencies/init.sls b/servo-build-dependencies/init.sls index 1c5ce789..1404dd3e 100644 --- a/servo-build-dependencies/init.sls +++ b/servo-build-dependencies/init.sls @@ -1,38 +1,39 @@ -{% from 'common/map.jinja' import homebrew %} +include: + - python servo-dependencies: pkg.installed: - pkgs: + - ccache - cmake - git - - ccache - {% if grains['kernel'] == 'Darwin' %} + {% if grains['os'] == 'MacOS' %} - autoconf@2.13 - automake - - pkg-config - - openssl - - freetype - ffmpeg + - freetype + - openssl + - pkg-config - yasm - {% else %} - - libglib2.0-dev - - libgl1-mesa-dri - - libgles2-mesa-dev + {% elif grains['os'] == 'Ubuntu' %} + - autoconf2.13 - freeglut3-dev + - gperf + - libavcodec-dev + - libavformat-dev + - libavutil-dev + - libbz2-dev + - libdbus-glib-1-dev - libfreetype6-dev - - xorg-dev + - libgl1-mesa-dri + - libglib2.0-dev + - libgles2-mesa-dev + - libosmesa6-dev - libssl-dev - - libbz2-dev + - xorg-dev + - xpra - xserver-xorg-input-void - xserver-xorg-video-dummy - - xpra - - libosmesa6-dev - - gperf - - autoconf2.13 - - libdbus-glib-1-dev - - libavformat-dev - - libavcodec-dev - - libavutil-dev {% endif %} pip.installed: - pkgs: @@ -54,8 +55,10 @@ multiverse: file.exists: - require: - pkgrepo: multiverse + {% if salt['pillar.get']('fully_managed', True) %} - require_in: - file: /etc/apt/sources.list.d + {% endif %} ttf-mscorefonts-installer: debconf.set: