From 14eecc3b71bcc5012b04bb1de70a027ddd5dae7d Mon Sep 17 00:00:00 2001 From: Zachary Seguin Date: Wed, 6 Jul 2016 16:41:16 -0400 Subject: [PATCH] Some fixes from re-installing office terminals --- .gitignore | 3 ++- distribute-ncmpcpp.yml | 9 +++++++++ files/ncmpcpp | 8 ++++++++ roles/common/tasks/main.yml | 3 +++ roles/general-use-gui/tasks/main.yml | 4 +++- roles/generate-hosts/tasks/main.yml | 6 +++--- update-hosts.yml | 6 +++--- 7 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 distribute-ncmpcpp.yml create mode 100755 files/ncmpcpp diff --git a/.gitignore b/.gitignore index fc2af5a..d6a3a25 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ logs/ *.log *.pyc generate-hosts/ -*.retry \ No newline at end of file +generate-hosts-*/ +*.retry diff --git a/distribute-ncmpcpp.yml b/distribute-ncmpcpp.yml new file mode 100644 index 0000000..a398ec8 --- /dev/null +++ b/distribute-ncmpcpp.yml @@ -0,0 +1,9 @@ +--- +- hosts: office + become: yes + become_method: sudo + tasks: + - name: Copy ncmpcpp + copy: src={{ item.src }} dest={{ item.dest }} backup=no mode=0755 + with_items: + - { src: 'files/ncmpcpp', dest: '/usr/local/bin/ncmpcpp' } diff --git a/files/ncmpcpp b/files/ncmpcpp new file mode 100755 index 0000000..e2ce288 --- /dev/null +++ b/files/ncmpcpp @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [[ `hostname -f` = nullsleep.csclub.uwaterloo.ca ]]; then + MPD_HOST="/var/run/mpd/socket" /usr/bin/ncmpcpp "$@" +else + ssh nullsleep.csclub.uwaterloo.ca -t ncmpcpp "$@" +fi + diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 6aecb41..2c07dda 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -9,6 +9,9 @@ - "deb http://debian.csclub.uwaterloo.ca/ {{ ansible_distribution_release }} main" - "deb-src http://debian.csclub.uwaterloo.ca/ {{ ansible_distribution_release }} main" +- name: Correct permisions on debian_csclub_uwaterloo_ca.list + file: path=/etc/apt/sources.list.d/debian_csclub_uwaterloo_ca.list mode=0644 + - name: Update apt and packages (if just installed unlikely) package: update_cache=yes upgrade=safe diff --git a/roles/general-use-gui/tasks/main.yml b/roles/general-use-gui/tasks/main.yml index 1770c41..88418d2 100644 --- a/roles/general-use-gui/tasks/main.yml +++ b/roles/general-use-gui/tasks/main.yml @@ -107,6 +107,8 @@ apt: name={{ item }} state=latest with_items: - xmobar + - i3blocks + - dzen2 - name: Install lockers apt: name={{ item }} state=latest @@ -253,4 +255,4 @@ - name: Install misc tools apt: name={{ item }} state=latest with_items: - - workrave \ No newline at end of file + - workrave diff --git a/roles/generate-hosts/tasks/main.yml b/roles/generate-hosts/tasks/main.yml index 95a54ea..ed24ab1 100644 --- a/roles/generate-hosts/tasks/main.yml +++ b/roles/generate-hosts/tasks/main.yml @@ -2,12 +2,12 @@ - name: update hosts connection: local become: no - git: repo=~git/public/hosts.git dest=generate-hosts + git: repo=~git/public/hosts.git dest=generate-hosts-{{ ansible_hostname }} - name: generate hosts file connection: local become: no - shell: generate-hosts/generate-hosts.py < generate-hosts/hosts.in > generate-hosts/hosts + shell: generate-hosts-{{ ansible_hostname }}/generate-hosts.py < generate-hosts-{{ ansible_hostname }}/hosts.in > generate-hosts-{{ ansible_hostname }}/hosts - name: copy hosts file - copy: src=generate-hosts/hosts dest=/etc/hosts backup=yes + copy: src=generate-hosts-{{ ansible_hostname }}/hosts dest=/etc/hosts backup=yes diff --git a/update-hosts.yml b/update-hosts.yml index 95d114f..36e6389 100644 --- a/update-hosts.yml +++ b/update-hosts.yml @@ -5,9 +5,9 @@ tasks: - name: update hosts connection: local - git: repo=~git/public/hosts.git dest=generate-hosts + git: repo=~git/public/hosts.git dest=generate-hosts-{{ ansible_hostname }} - name: generate hosts file connection: local - shell: generate-hosts/generate-hosts.py < generate-hosts/hosts.in > generate-hosts/hosts + shell: generate-hosts-{{ ansible_hostname }}/generate-hosts.py < generate-hosts-{{ ansible_hostname }}/hosts.in > generate-hosts-{{ ansible_hostname }}/hosts - name: copy hosts file - copy: src=generate-hosts/hosts dest=/etc/hosts backup=yes + copy: src=generate-hosts-{{ ansible_hostname }}/hosts dest=/etc/hosts backup=yes