From 69770a46c481c46418efabbdc1039892871c20a8 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Tue, 26 Apr 2016 08:43:23 -0400 Subject: [PATCH 1/5] Add Ansible role dependencies as SCM rather than Ansible Galaxy roles. --- meta/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meta/main.yml b/meta/main.yml index ad8c4ab..414b90b 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -13,7 +13,7 @@ galaxy_info: - development - web dependencies: - - role: dorianpula.nginx-uwsgi-supervisor + - role: "git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor,,nginx-uwsgi-supervisor" app_name: "{{ rookeries_app_name }}" app_root_path: "{{ rookeries_app_symlink }}" app_venv: "{{ rookeries_venv_symlink }}" @@ -21,3 +21,11 @@ dependencies: 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-nodejs,,nodejs" + node_version_family: "5.x" + globally_installed_tools: + - browserify + - coffee-script + - less + - grunt-cli + - karma-cli From 2d00f3c71db72a57d3e48f87278db9524e0c2950 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Thu, 28 Apr 2016 18:10:51 -0400 Subject: [PATCH 2/5] Migrate roles to use stand-alone NodeJS role. --- meta/main.yml | 6 ++++-- tasks/main.yml | 1 - tasks/nodejs.yaml | 35 ----------------------------------- 3 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 tasks/nodejs.yaml diff --git a/meta/main.yml b/meta/main.yml index 414b90b..8e4c31b 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -13,7 +13,8 @@ galaxy_info: - development - web dependencies: - - role: "git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor,,nginx-uwsgi-supervisor" +# - role: "git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor,,nginx-uwsgi-supervisor" + - role: "nginx-uwsgi-supervisor" app_name: "{{ rookeries_app_name }}" app_root_path: "{{ rookeries_app_symlink }}" app_venv: "{{ rookeries_venv_symlink }}" @@ -21,7 +22,8 @@ dependencies: 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-nodejs,,nodejs" +# - role: "git+https://bitbucket.org/dorianpula/ansible-nodejs,,nodejs" + - role: "nodejs" node_version_family: "5.x" globally_installed_tools: - browserify 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 From 68e672d718b9d4cb7418fdea5d9f8954b9f60acb Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Tue, 10 May 2016 18:21:16 -0400 Subject: [PATCH 3/5] Remove node dev dependencies from rookeries installation. --- tasks/rookeries_deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 22870d80168af138616a8172c3d39016d40691a1 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Mon, 16 May 2016 18:15:30 -0400 Subject: [PATCH 4/5] Change the supported systems and minimum Ansible version to more current versions. Simplify setup of mailsink dependency. --- README.md | 2 +- handlers/main.yml | 2 -- meta/main.yml | 1 + tasks/dev_email_server.yaml | 2 +- templates/{dev_supervisor => }/mailsink_supervisor.conf | 0 5 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 handlers/main.yml rename templates/{dev_supervisor => }/mailsink_supervisor.conf (100%) 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 8e4c31b..5aef8c5 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -9,6 +9,7 @@ galaxy_info: - name: Ubuntu versions: - trusty + - xenial categories: - development - web 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/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 From 7dfbaf85e5d7d1042549de5d0a2b8a66592e2005 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Tue, 17 May 2016 23:41:02 -0400 Subject: [PATCH 5/5] Make sure role works with latest revision of base roles. --- meta/main.yml | 16 ++++++++-------- vars/main.yml | 3 +++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 5aef8c5..26ec119 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -15,14 +15,14 @@ galaxy_info: - web dependencies: # - role: "git+https://bitbucket.org/dorianpula/ansible-nginx-uwsgi-supervisor,,nginx-uwsgi-supervisor" - - role: "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: "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" 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