create provision script, removed salt states

This commit is contained in:
Matthew Scragg 2014-09-02 14:07:14 -05:00
parent 564bde872d
commit 1492448448
13 changed files with 20 additions and 149 deletions

1
.gitignore vendored
View file

@ -9,3 +9,4 @@ config.json
realms/static/vendor realms/static/vendor
realms/static/assets/* realms/static/assets/*
wiki.db wiki.db
npm-debug.log

View file

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
# Provision script created for Ubuntu 14.04
APP_DIR=/vagrant APP_DIR=/vagrant
echo "Provisioning..." echo "Provisioning..."
@ -40,5 +41,17 @@ source .venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
# Dev server http://127.0.0.1:5000 cat << EOF > /usr/local/bin/realms-wiki
# python realms.py runserver #!/bin/bash
${APP_DIR}/.venv/bin/python ${APP_DIR}/manage.py "\$@"
EOF
chmod +x /usr/local/bin/realms-wiki
cat << EOF > /etc/init/realms-wiki.conf
description "Realms Wiki"
author "scragg@gmail.com"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /usr/local/bin/realms-wiki run
EOF

View file

@ -4,4 +4,4 @@ assets.register('editor',
'js/ace/ace.js', 'js/ace/ace.js',
'js/ace/mode-markdown.js', 'js/ace/mode-markdown.js',
'vendor/keymaster/keymaster.js', 'vendor/keymaster/keymaster.js',
'js/dillinger.js') 'js/editor.js')

View file

@ -1,3 +1,6 @@
/*
Source is modified version of http://dillinger.io/
*/
$(function () { $(function () {
var url_prefix = ""; var url_prefix = "";

View file

@ -1,2 +0,0 @@
master: localhost
file_client: local

View file

@ -1,36 +0,0 @@
redis-lea-repo:
pkgrepo.managed:
- ppa: chris-lea/redis-server
- required_in: redis-server
nodejs-lea-repo:
pkgrepo.managed:
- ppa: chris-lea/node.js
python-redis-lea-repo:
pkgrepo.managed:
- ppa: chris-lea/python-redis
common-pkgs:
pkg.installed:
- pkgs:
- python
- build-essential
- git
- libpcre3-dev
- libevent-dev
- python-software-properties
- python-pip
- python-virtualenv
- python-dev
- pkg-config
- curl
- libxml2-dev
- libxslt1-dev
- zlib1g-dev
- libffi-dev
- nodejs
- require:
- pkgrepo: nodejs-lea-repo
- pkgrepo: redis-lea-repo
- pkgrepo: python-redis-lea-repo

View file

@ -1,44 +0,0 @@
python-dev:
pkg.installed
build-essential:
pkg.installed
python-pip:
pkg.installed
virtualenvwrapper:
pip.installed:
- require:
- pkg: python-pip
bower:
npm.installed:
- user: root
- require:
- pkg: common-pkgs
uglify-js:
npm.installed:
- user: root
- require:
- pkg: common-pkgs
create_virtualenv:
virtualenv.managed:
- name: /home/deploy/virtualenvs/realms
- requirements: /home/deploy/realms/requirements.txt
- cwd: /home/deploy/realms
- user: root
vagrant_ownership:
cmd.run:
- name: chown -R vagrant.vagrant /home/deploy
- onlyif: test -d /vagrant
- user: root
deploy_ownership:
cmd.run:
- name: chown -R vagrant.vagrant /home/deploy
- unless: test -d /vagrant
- user: root

View file

@ -1,9 +0,0 @@
redis-server:
pkg:
- installed
service:
- running
- enable: True
- reload: True
- require:
- pkg: redis-server

View file

@ -1,6 +0,0 @@
base:
'*':
- common
- users
- redis
- realms

View file

@ -1,2 +0,0 @@
source /usr/local/bin/virtualenvwrapper.sh
WORKON_HOME=/home/deploy/virtualenvs

View file

@ -1,46 +0,0 @@
deploy:
user.present:
- shell: /bin/bash
- home: /home/deploy
- fullname: Deploy
sudo:
pkg:
- installed
/etc/sudoers.d/mysudoers:
file.managed:
- source: salt://users/mysudoers
- mode: 440
- user: root
- group: root
- require:
- pkg: sudo
/home/deploy:
file.directory:
- user: deploy
- group: deploy
/home/deploy/.bash_profile:
file.managed:
- source: salt://users/.bash_profile
- mode: 440
- user: deploy
- group: deploy
- require:
- file: /home/deploy
/home/deploy/.bashrc:
file.copy:
- mode: 440
- user: deploy
- group: deploy
- source: /etc/skel/.bashrc
bashrc-append:
file.append:
- name: /home/deploy/.bashrc
- text: . ~/.bash_profile
- user: deploy
- group: deploy

View file

@ -1 +0,0 @@
deploy ALL=(ALL) NOPASSWD:ALL