Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mika Viinamäki committed Sep 17, 2017
0 parents commit 846361a
Show file tree
Hide file tree
Showing 11 changed files with 187 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.retry
9 changes: 9 additions & 0 deletions inventories/testing/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[dedicab]
192.168.1.88

[dedicab:vars]
ansible_user=stepmania
ansible_ssh_pass=hulbhulb
ansible_become_pass=hulbhulb
ansible_become_method=su
ansible_become_user=root
4 changes: 4 additions & 0 deletions roles/lightdm/files/custom.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Seat:*]
greeter-hide-users=false
autologin-user=stepmania
autologin-session=xfce
24 changes: 24 additions & 0 deletions roles/lightdm/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
- name: Install LightDM
apt:
package: lightdm

- name: Install LightDM configuration
copy:
src: files/custom.conf
dest: /usr/share/lightdm/lightdm.conf.d/99_custom.conf

- name: Create nopasswdlogin group
group:
name: nopasswdlogin

- name: Add stepmania to nopasswdlogin group
user:
name: stepmania
groups: nopasswdlogin
append: yes

- name: Enable passwordless login in PAM
lineinfile:
path: /etc/pam.d/lightdm
line: "auth sufficient pam_succeed_if.so user ingroup nopasswdlogin"
insertafter: "#%PAM-1.0"
9 changes: 9 additions & 0 deletions roles/piuio/files/dkms.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PACKAGE_NAME=piuio
PACKAGE_VERSION={{ PIUIO_VERSION }}
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
BUILT_MODULE_LOCATION="mod/"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/mod"
CLEAN="true"
DEST_MODULE_LOCATION[0]=/extra
REMAKE_INITRD=yes
AUTOINSTALL=yes
39 changes: 39 additions & 0 deletions roles/piuio/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
- set_fact: PIUIO_VERSION=v1.0

- name: Install DKMS
apt:
package: dkms

- name: Get source
git:
repo: https://github.com/djpohly/piuio
dest: /usr/src/piuio-{{ PIUIO_VERSION }}
version: "{{ PIUIO_VERSION }}"
register: source

- name: Add DKMS configuration
template:
src: files/dkms.conf
dest: /usr/src/piuio-{{ PIUIO_VERSION }}/dkms.conf
register: config

- name: Remove old from DKMS
shell: dkms remove -m piuio -v {{ PIUIO_VERSION }} --all || true
when: config.changed or source.changed

- name: Add to DKMS
shell: dkms add -m piuio -v {{ PIUIO_VERSION }}
when: config.changed or source.changed

- name: Build and install module
shell: dkms build -m piuio -v {{ PIUIO_VERSION }} && dkms install -m piuio -v {{PIUIO_VERSION}}
when: config.changed or source.changed

- name: Enable kernel module
modprobe:
name: piuio

- name: Add to list of automatically load kernel modules
copy:
content: "piuio"
dest: /etc/modules-load.d/piuio.conf
6 changes: 6 additions & 0 deletions roles/stepmania/files/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

pasuspender /stepmania/stepmania

# wait until enter is pressed
read -p "Press enter to continue"
8 changes: 8 additions & 0 deletions roles/stepmania/files/stepmania.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Stepmania
Path=/stepmania
Exec=/home/stepmania/start-stepmania.sh
Terminal=true
Icon=/stepmania/icons/hicolor/256x256/apps/stepmania-ssc.png
71 changes: 71 additions & 0 deletions roles/stepmania/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## MAIN BUILD

- name: Install Git
apt:
package: git

- name: Install Stepmania build dependencies
apt:
package: cmake,build-essential,mesa-common-dev,libglu1-mesa-dev,libglew1.5-dev,libxtst-dev,libxrandr-dev,libpng-dev,libjpeg-dev,zlib1g-dev,libbz2-dev,libogg-dev,libvorbis-dev,libc6-dev,yasm,libasound-dev,libpulse-dev,binutils-dev,libgtk2.0-dev,libmad0-dev,libudev-dev,libva-dev

- name: Fetch Stepmania source
git:
repo: https://github.com/Kauhsa/stepmania
dest: /stepmania
version: sync-start
register: source

# -DWITH_MINIMAID=OFF required so we don't get a complain about -fPIC,
# see https://github.com/stepmania/stepmania/issues/1352
- name: Run CMake
shell: cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release .. -DWITH_MINIMAID=OFF && cmake .. -DWITH_MINIMAID=OFF
args:
chdir: /stepmania/Build
when: source.changed

- name: Compile Stepmania
shell: make -j$(nproc --all)
args:
chdir: /stepmania/Build
when: source.changed

## STARTUP SCRIPT

- name: Copy startup script
copy:
src: files/start.sh
dest: /home/stepmania/start-stepmania.sh
mode: 0755

## THEME

- name: Make sure theme directory exists
file:
path: /home/stepmania/.stepmania-5.0/Themes
state: directory
owner: stepmania
group: stepmania
recurse: yes

- name: Get Simply Love, McKylä edition
git:
repo: https://github.com/Kauhsa/Simply-Love-SM5
dest: /home/stepmania/.stepmania-5.0/Themes/Simply-Love-SM5
version: makkyla
become_user: stepmania

## ICONS

- name: Add Stepmania icon to desktop
copy:
src: files/stepmania.desktop
dest: /home/stepmania/Desktop/stepmania.desktop
mode: 0755
owner: stepmania
group: stepmania

- name: Add link to Songs to Desktop
file:
src: /home/stepmania/.stepmania-5.0/Songs
dest: /home/stepmania/Desktop/Songs
state: link
9 changes: 9 additions & 0 deletions roles/utils/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: Install utility packages
apt:
package: sudo,chromium,vim,htop

- name: Make sure user stepmania is in sudo group
user:
name: stepmania
groups: sudo
append: yes
7 changes: 7 additions & 0 deletions site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- hosts: all
become: true
roles:
- lightdm
- piuio
- stepmania
- utils

0 comments on commit 846361a

Please sign in to comment.