Skip to content

Commit

Permalink
Check in with apt-repos, automount, cloud9, firmware, make-kpkg, sabn…
Browse files Browse the repository at this point in the history
…zbd.
  • Loading branch information
rektide committed Nov 27, 2012
1 parent 2b217d3 commit 46ffe46
Show file tree
Hide file tree
Showing 14 changed files with 137 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apt-repos.pb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: all
sudo: True
tasks:
- copy: src=files/mate.list dest=/etc/apt/source.list.d/
25 changes: 25 additions & 0 deletions automount-cifs.pb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- hosts: all
sudo: True
vars_files:
- private/automount-cifs/xone.downloads
- private/automount-cifs/xone.x1
- private/automount-cifs/map
tasks:
- template: src=files/automount-cifs/srv.automount dest=/etc/systemd/system/mnt-smb-${item.srv}-${item.share}.automount
with_items: ${remotes}
register: has_automount
- template: src=files/automount-cifs/srv.mount dest=/etc/systemd/system/mnt-smb-${item.srv}-${item.share}.mount
with_items: ${remotes}
register: has_mount
- template: src=files/automount-cifs/srv.creds dest=/root/.cifscred-${item.srv}-${item.share} mode=0400
with_items: ${remotes}
register: has_creds
- shell: systemctl daemon-reload
only_if: ${has_mount.changed} or ${has_automount.changed}
- shell: systemctl enable mnt-smb-${item.srv}-${item.share}.automount
with_items: ${remotes}
only_if: ${has_automount.changed}
- shell: systemctl reload-or-restart mnt-smb-${item.srv}-${item.share}.automount
with_items: ${remotes}
only_if: ${has_automount.changed}
34 changes: 34 additions & 0 deletions cloud9.pb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
- hosts: all
sudo: True
vars:
user: cloud9
srv:
host: 0.0.0.0
port: 3232
user: ${user}
repo: https://github.com/ajaxorg/cloud9.git
dest: /srv/cloud9
npm_opts: --node-dir=/usr/src/node
tasks:
- user: name=${user} system=true home=/srv/cloud9
- file: owner=${user} group=root state=directory path=${dest}
- file: owner=${user} group=root state=directory path=${dest}/workspace
- shell: which sm; echo $?
register: has_sm
- shell: npm ${npm_opts} install sm
only_if: ${has_sm.rc} > 0
- git: repo=${repo} dest=${dest}/webapp
register: has_webapp
- shell: chown ${user} ${dest}/webapp
only_if: ${has_webapp.changed}
- shell: chdir=${dest}/webapp sudo -u ${user} sm install
only_if: ${has_webapp.changed}
- shell: chown ${user} ${dest}/webapp
only_if: ${has_webapp.changed}
- template: owner=root group=root src=files/cloud9/cloud9.service dest=/etc/systemd/system/cloud9.service
register: has_service
- shell: systemctl enable cloud9.service
only_if: ${has_service.changed}
- shell: systemctl restart cloud9.service
only_if: ${has_service.changed} or ${has_webapp.changed}
6 changes: 6 additions & 0 deletions examples-private/automount-cifs/host.share1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
cifs_host_share1:
srv: host
share: share1
user: alice
password: isnotsecure
6 changes: 6 additions & 0 deletions examples-private/automount-cifs/host.share2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
cifs_host_share2:
srv: host
share: share2
user: bob
password: alsonotsecure
4 changes: 4 additions & 0 deletions examples-private/automount-cifs/map
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
remotes:
- $cifs_host_share1
- $cifs_host_share2
15 changes: 15 additions & 0 deletions examples-private/sabnzbd.vars
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# sabnzb configuration
sab_user: joe
sab_password: tryharderjoe
sab_port: 9090
sab_api_key: 1d111111d
sab_nzb_key: 2d222222d
# newsgroup service
srv: news.yoyodyne.net
srv_user: [email protected]
srv_password: notanybetter
# nzbmatrix
m_user: lurker
m_apikey: 33c33c33c33c33

5 changes: 5 additions & 0 deletions firmware.pb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: all
tasks:
- name: install
apt: state=latest pkg=firmware-atheros,firmware-brcm80211,firmware-iwlwifi,firmware-libertas,firmware-ralink,firmware-realtek
3 changes: 3 additions & 0 deletions handlers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: restart-sabnzbd
service: name=sabnzbdplus state=restarted
10 changes: 10 additions & 0 deletions make-kpkg.pb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- hosts: all
sudo: True
tasks:
- name: install kernel-package main deps
apt: state=latest pkg=binutils,build-essential,debianutils,gettext,make,module-init-tools,po-debconf,util-linux
- name: install make-kpkg
apt: state=latest pkg=kernel-package,bzip2,initramfs-tools,fakeroot
- name: install busybox extras
apt: state=latest pkg=busybox-static
1 change: 1 addition & 0 deletions private/SENSITIVE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please copy in files from ../example-private and modify them. Do not check anything in in this directory: it holds sensitive configuration information.
16 changes: 16 additions & 0 deletions sabnzbd.pb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- hosts: all
sudo: True
vars_files:
- private/sabnzbd.vars
handlers:
- include: handlers.yaml
tasks:
- apt: state=latest pkg=sabnzbdplus
- user: name=sabnzbd home=/srv/nzb shell=/bin/false system=true
- file: state=directory path=/srv/nzb/~queue~ owner=sabnzbd group=daemon mode=0777
- file: state=directory path=/srv/nzb/.sabnzbd owner=sabnzbd group=daemon mode=0770
- copy: src=files/sabnzbd/sabnzbdplus.default dest=/etc/default/sabnzbdplus
notify: restart-sabnzbd
- template: src=files/sabnzbd/sabnzbd.ini dest=/srv/nzb/.sabnzbd/sabnzbd.ini owner=sabnzbd group=daemon mode=0660
notify: restart-sabnzbd
3 changes: 3 additions & 0 deletions tasks/services.tasks
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: reload cloud9
action: systemd reload-or-try-restart cloud9.service
4 changes: 4 additions & 0 deletions tasks/xdg.tasks
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: install xdg utils
apt: pkg=xdg-user-dirs
- name: register XDG_

0 comments on commit 46ffe46

Please sign in to comment.