diff --git a/README.md b/README.md index d0eb5f8..97b910a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Requirements - aptitude or python-apt (required by apt tasks) - python > 2.5 (required by ini_file tasks) -- Ansible >= 1.8.0 +- Ansible >= 2.0 This role is designed to work against a modern Ubuntu system. (Tested on Ubuntu 13.10 and 14.04) It should theoretically work on older versions of Ubuntu or Debian based systems. diff --git a/handlers/main.yml b/handlers/main.yml deleted file mode 100644 index 2197d4c..0000000 --- a/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ansible-rookeries diff --git a/meta/main.yml b/meta/main.yml index ad8c4ab..26ec119 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -9,15 +9,26 @@ galaxy_info: - name: Ubuntu versions: - trusty + - xenial categories: - development - web dependencies: - - role: dorianpula.nginx-uwsgi-supervisor - app_name: "{{ rookeries_app_name }}" - app_root_path: "{{ rookeries_app_symlink }}" - app_venv: "{{ rookeries_venv_symlink }}" - app_nginx_hostname: "{{ rookeries_app_hostname }}" - app_uwsgi_port: "{{ rookeries_local_uwsgi_port }}" - app_uwsgi_executable: "rookeries:make_rookeries_app()" - app_uwsgi_envs: "{{ rookeries_app_config }}" +# - role: "git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor,,nginx-uwsgi-supervisor" + - role: "uwsgi-nginx-supervisor" + uwsgi_app_name: "{{ rookeries_app_name }}" + uwsgi_app_root_path: "{{ rookeries_app_symlink }}" + uwsgi_app_venv: "{{ rookeries_venv_symlink }}" + uwsgi_app_nginx_hostname: "{{ rookeries_app_hostname }}" + uwsgi_app_port: "{{ rookeries_local_uwsgi_port }}" + uwsgi_app_executable: "rookeries:make_rookeries_app()" + uwsgi_app_envs: "{{ rookeries_app_config }}" +# - role: "git+https://bitbucket.org/dorianpula/ansible-nodejs,,nodejs" + - role: "nodejs" + node_version_family: "5.x" + globally_installed_tools: + - browserify + - coffee-script + - less + - grunt-cli + - karma-cli diff --git a/tasks/dev_email_server.yaml b/tasks/dev_email_server.yaml index 487cfd1..6344132 100644 --- a/tasks/dev_email_server.yaml +++ b/tasks/dev_email_server.yaml @@ -5,7 +5,7 @@ when: rookeries_environ_type == "dev" - name: upload supervisor configuration to web server home - template: src=dev_supervisor/mailsink_supervisor.conf dest=/etc/supervisor/conf.d/mailsink_supervisor.conf + template: src=mailsink_supervisor.conf dest=/etc/supervisor/conf.d/mailsink_supervisor.conf sudo: yes when: rookeries_environ_type == "dev" diff --git a/tasks/main.yml b/tasks/main.yml index dfef102..27b299e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,4 @@ --- -- include: nodejs.yaml - include: couchdb.yaml - include: dev_email_server.yaml - include: rookeries_deployment.yaml diff --git a/tasks/nodejs.yaml b/tasks/nodejs.yaml deleted file mode 100644 index 21e6c45..0000000 --- a/tasks/nodejs.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- name: install systems to help setup nodejs - apt: pkg={{ item }} state=present - with_items: - - python-apt - - git - - apt-transport-https - -- name: add the nodesource repository - apt_key: url=https://deb.nodesource.com/gpgkey/nodesource.gpg.key state=present - -- name: add the nodesource binary repository - apt_repository: repo="deb https://deb.nodesource.com/node_0.12 {{ ansible_lsb.codename }} main" - state=present - -- name: add the nodesource source repository - apt_repository: repo="deb-src https://deb.nodesource.com/node_0.12 {{ ansible_lsb.codename }} main" - state=present update_cache=yes - -- name: install nodejs + npm - apt: pkg=nodejs state=present - -- name: check if nodejs binary exists and needs linking to node binary - stat: path=/usr/bin/nodejs - register: nodejs_bin - -- name: link nodejs binary correctly - file: src=/usr/bin/nodejs dest=/usr/bin/node state=link - when: nodejs_bin.stat.exists - -- name: install coffeescript + less dependencies - npm: name={{ item }} global=yes state=present registry=http://registry.npmjs.org/ - with_items: - - less - - browserify diff --git a/tasks/rookeries_deployment.yaml b/tasks/rookeries_deployment.yaml index 152187e..1778f39 100644 --- a/tasks/rookeries_deployment.yaml +++ b/tasks/rookeries_deployment.yaml @@ -30,7 +30,7 @@ when: deploy_package.stat.exists - name: install frontend dependencies for app - npm: path={{ rookeries_deploy_dir }} state=present registry=http://registry.npmjs.org/ + npm: path={{ rookeries_deploy_dir }} state=present production=yes when: deploy_package.stat.exists - name: add in symlink to deployed package. diff --git a/templates/dev_supervisor/mailsink_supervisor.conf b/templates/mailsink_supervisor.conf similarity index 100% rename from templates/dev_supervisor/mailsink_supervisor.conf rename to templates/mailsink_supervisor.conf diff --git a/vars/main.yml b/vars/main.yml index 3ea06d3..0e3db37 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,6 +1,9 @@ --- # App name reused from the nginx-uwsgi-supervisor roles app_name: "{{ rookeries_app_name }}" +web_root_path: /srv/www +virtualenv_root_path: "{{ web_root_path }}/virtualenvs" +web_server_group: www-data # Introduced from deployment playbook