Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ar/refactor1 #43

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.

config.vm.box = "hashicorp/precise64"
config.vm.synced_folder ".", "/usr/local/tunapanda/provision"
config.vm.synced_folder ".", "/opt/tunapanda/provision"

# These environment vars can be used to alter the behavior of
# the bootstrapping script.
Expand All @@ -25,7 +25,7 @@ export PROVISION_BOOTSTRAP_DIR="#{ENV['PROVISION_BOOTSTRAP_DIR']}"
export PROVISION_BOOTSTRAP_PLAYBOOK="#{ENV['PROVISION_BOOTSTRAP_PLAYBOOK']}"
export PROVISION_BOOTSTRAP_INVENTORY="#{ENV['PROVISION_BOOTSTRAP_INVENTORY']}"
export PROVISION_BOOTSTRAP_FALLBACK_URL="#{ENV['PROVISION_BOOTSTRAP_FALLBACK_URL']}"
/usr/local/tunapanda/provision/scripts/bootstrap.sh
/opt/tunapanda/provision/scripts/bootstrap.sh
SCRIPT

config.vm.provision "shell", inline: $script, keep_color: true
Expand Down
24 changes: 0 additions & 24 deletions localconfig.yml.sample

This file was deleted.

4 changes: 2 additions & 2 deletions playbooks/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[defaults]
log_path = ansible.log
host_key_checking = False
library = /usr/local/tunapanda/provision/ext/edx/playbooks/library
roles_path = /usr/local/tunapanda/provision/playbooks/roles:/usr/local/tunapanda/provision/ext/edx/playbooks/roles
library = ../ext/edx/playbooks/library
roles_path = roles:../ext/edx/playbooks/roles
2 changes: 1 addition & 1 deletion playbooks/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- hosts: all
tasks:
- name: "install dependencies"
apt:
apt:
name={{ item }}
state=installed
with_items:
Expand Down
14 changes: 7 additions & 7 deletions playbooks/bootstrap_git.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
# Get info on the repo dir
- stat:
path={{ dir }}
path={{ dir }}
follow=yes
register: d

# If directory exists, update but fail gracefully if there are
# local changes.
#- name: "Updating repository repo in {{dir}}"
## Ansible's git module seems to "update" to the specified branch
## in a way that loses local commits if they haven't yet been
## pushed to the branch specified by {{ ver }}.
## in a way that loses local commits if they haven't yet been
## pushed to the branch specified by {{ ver }}.
# TODO: Find a safe way to automatically pull down updates
# git:
# git:
# ssh_opts="-o StrictHostKeyChecking=no"
# repo={{ repo }}
# dest={{ dir }}
Expand All @@ -21,14 +21,14 @@
# recursive=yes
# ignore_errors: yes
# when: d.stat.exists == True

# If directory does not exist, clone it
- name: "Cloning repository repo in {{dir}}"
git:
git:
ssh_opts="-o StrictHostKeyChecking=no"
repo={{ repo }}
dest={{ dir }}
version={{ ver }}
recursive=yes
when: d.stat.exists == False

67 changes: 67 additions & 0 deletions playbooks/cubietruck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
##
## This file contains settings for a standalone ARM device that
## serves as a wireless access point and has edX pre-installed
##
- hosts: all
pre_tasks:
- shell: echo "Last provisioning started at $(date)" > {{ provision__base_dir }}/provisioning.txt
post_tasks:
- shell: echo "Last provisioning completed at $(date)" >> {{ provision__base_dir }}/provisioning.txt

roles:
- role: debops.ifupdown
- role: provision_base
- role: kalite
- role: wap
- role: edx_portal
- role: iptables
- role: vidtest
- role: portal
- role: cubietruck_net

vars:
# Common vars
provision__base_dir: "/opt/tunapanda"
provision__data_dir: "{{ provision__base_dir }}/data"
provision__ext_dir: "{{ provision__base_dir }}/provision/ext"
provision__default_packages: [ git, vim, screen ]
provision__sites_available_dir: "/etc/nginx/sites-available"
provision__sites_enabled_dir: "/etc/nginx/sites-enabled"

# TODO: split these off into roles?
apache_dir: "/etc/apache2"
apache_docroot: "/var/www"
apache_user: "www-data"
iptables__cmd: "/sbin/iptables"

# Overrides for other roles
ifupdown_external_interface: "eth1"
ifupdown_internal_interface: "eth0"
nginx_sites_available_dir: "{{ provision__sites_available_dir }}"
nginx_sites_enabled_dir: "{{ provision__sites_enabled_dir }}"
common_web_user: "www-data"
EDXAPP_LMS_NGINX_PORT: '81'

# CubieTruck specific
ifupdown: True
ifupdown_ignore_networkmanager: True
ifupdown_external_interface: "eth0"
ifupdown_internal_interface: "wlan0"
ifupdown_interfaces:
- iface: "{{ ifupdown_external_interface }}"
inet: "dhcp"
- iface: "{{ ifupdown_internal_interface }}"
inet: "static"
options: |
address 10.0.0.1
netmask 255.0.0.0

# Tell playbooks to assume edx is pre-installed
# this changes what our options are for
# (re-)configuring it.
edx__pre_installed: true
provision__sites_available_dir: "/edx/app/nginx/sites-available/"
provision__sites_enabled_dir: "/edx/app/nginx/sites-enabled/"
php__fpm_url: "unix:/var/run/php5-fpm.sock"
portal__auth: "agreement"
26 changes: 0 additions & 26 deletions playbooks/group_vars/all

This file was deleted.

32 changes: 0 additions & 32 deletions playbooks/group_vars/cubietruck

This file was deleted.

26 changes: 0 additions & 26 deletions playbooks/group_vars/tunapanda_server

This file was deleted.

44 changes: 0 additions & 44 deletions playbooks/main.yml

This file was deleted.

1 change: 0 additions & 1 deletion playbooks/roles/apt_basic/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
---
apt_basic__enabled: false
apt_basic__upgrade_packages: false
3 changes: 0 additions & 3 deletions playbooks/roles/apt_localrepo/defaults/main.yml

This file was deleted.

12 changes: 6 additions & 6 deletions playbooks/roles/apt_localrepo/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
apt: name={{ item }} state=latest
with_items:
- dpkg-dev
- rubygems
- ruby-dev
- gcc
- devscripts
- rubygems
- ruby-dev
- gcc
- devscripts
- name: "Install local repo dependencies (gems)"
# TODO: Why doesn't this work?
# gem: name=fpm state=latest user_install=true
command: gem install -y fpm creates=/usr/bin/fpm
- name: Build local packages
shell: "echo 'OUTPUT_DIR=../../packages' > build_settings_local.d/output_dir.conf ; ./build.sh */ chdir={{ pkg_build_dir }}"
- name: Move built packages to repo
shell: 'cp -v {{ pkg_build_dir }}/Packages/*.deb {{ provision__base_dir }}/packages/'
shell: 'cp -v {{ pkg_build_dir }}/Packages/*.deb {{ provision__base_dir }}/packages/'
- name: Populate local repo
shell: '[ "$(ls -tr | tail -n1)" = "Packages.gz" ] || (dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz) chdir={{ provision__base_dir }}/packages'
- name: Add local repo to apt sources
apt_repository: repo="deb file:/usr/local/tunapanda/packages ./" state=present
apt_repository: repo="deb file:/opt/tunapanda/packages ./" state=present
- name: Update the apt cache unless it was just updated
apt: update_cache=yes cache_valid_time=10
1 change: 0 additions & 1 deletion playbooks/roles/build_iso/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
---
build_iso__enabled: false
build_iso__remastersys_root: "{{ vagrant_share }}/data/build/remastersys"
6 changes: 3 additions & 3 deletions playbooks/roles/build_iso/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
- name: Install Casper
apt:
name=casper
apt:
name=casper
state=latest
update_cache=yes
cache_valid_time=600

- name: "Build ISO (this will take a while!)"
command: "{{ build_iso__remastersys_root }}/bin/remastersys backup"
sudo: yes
10 changes: 10 additions & 0 deletions playbooks/roles/cubietruck_net/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Configure wlan driver
lineinfile:
dest=/etc/modules
line="bcmdhd op_mode=2"
regexp="^bcmdhd"

- name: Load wlan driver
command: modprobe bcmdhd
ignore_errors: yes
1 change: 0 additions & 1 deletion playbooks/roles/desktop/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
desktop__enabled: false
desktop__use_gnome2: true
desktop__custom_artwork: false
8 changes: 4 additions & 4 deletions playbooks/roles/desktop/tasks/artwork.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: Install custom artwork
synchronize:
src=fs/
synchronize:
src=fs/
dest=/
rsync_path="sudo rsync"

- name: Configuring users to use custom artwork by default
script: scripts/artwork-post-install.sh
script: scripts/artwork-post-install.sh
creates=/tmp/COMPLETED_artwork-post-install
2 changes: 1 addition & 1 deletion playbooks/roles/desktop/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
when: desktop__use_gnome2
- name: Start GUI
service: name=lightdm state=started

- include: artwork.yml
when: desktop__custom_artwork
Loading