From d3d92f4f5927379e34e8e31acfb0f4f4d197ba5b Mon Sep 17 00:00:00 2001 From: natalia Date: Thu, 20 Sep 2018 01:28:45 -0700 Subject: [PATCH] Added some variables and modules --- roles/blockscout/tasks/main.yml | 13 +++++++++++-- roles/elixir/defaults/main.yml | 6 +++++- roles/elixir/tasks/ubuntu.yml | 8 ++++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/roles/blockscout/tasks/main.yml b/roles/blockscout/tasks/main.yml index 00255ac..28b74ba 100644 --- a/roles/blockscout/tasks/main.yml +++ b/roles/blockscout/tasks/main.yml @@ -12,7 +12,13 @@ dest: "{{ home }}/blockscout/apps/explorer/config/dev.secret.exs" - name: Add block_scout_web dev.secret - shell: cp {{ home }}/blockscout/apps/block_scout_web/config/dev.secret.exs.example {{ home }}/blockscout/apps/block_scout_web/config/dev.secret.exs + copy: + src: '{{ home }}/blockscout/apps/block_scout_web/config/dev.secret.exs.example' + remote_src: yes + dest: '{{ home }}/blockscout/apps/block_scout_web/config/dev.secret.exs' + owner: '{{ username }}' + group: '{{ username }}' + mode: 0644 - name: Install dependencies shell: cd {{ home }}/blockscout && mix local.hex --force && mix do deps.get, local.rebar --force, deps.compile, compile @@ -39,7 +45,10 @@ shell: cd {{ home }}/blockscout/apps/block_scout_web/assets && npm install node-sass --unsafe-perm; cd - - name: Install node dependensies in the apps/explorer - shell: cd {{ home }}/blockscout/apps/explorer && npm install; cd - + npm: + path: "{{ home }}/blockscout/apps/explorer" + state: present + become: true - name: Start server shell: cd {{ home }}/blockscout && mix phx.server diff --git a/roles/elixir/defaults/main.yml b/roles/elixir/defaults/main.yml index 58dd882..27d4d23 100644 --- a/roles/elixir/defaults/main.yml +++ b/roles/elixir/defaults/main.yml @@ -1,3 +1,7 @@ --- -ERLANG_SOURCE_DEB: "https://packages.erlang-solutions.com/ubuntu" \ No newline at end of file +ERLANG_SIGNING_KEY_URL: "https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc" +ERLANG_SOURCE_DEB: "https://packages.erlang-solutions.com/ubuntu" +POSTGRESQL_SIGNING_KEY_URL: "https://www.postgresql.org/media/keys/ACCC4CF8.asc" +POSTGRESQL_SOURCE_DEB: "http://apt.postgresql.org/pub/repos/apt/" +POSTGRESQL_DISTRIBUTION_RELEASE: "xenial-pgdg" \ No newline at end of file diff --git a/roles/elixir/tasks/ubuntu.yml b/roles/elixir/tasks/ubuntu.yml index 6ef67fd..4c86c73 100644 --- a/roles/elixir/tasks/ubuntu.yml +++ b/roles/elixir/tasks/ubuntu.yml @@ -2,12 +2,12 @@ - name: Add ubuntu/erlang_solutions signing key apt_key: - url: https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc + url: '{{ ERLANG_SIGNING_KEY_URL }}' state: present - name: Add erlang-solutions repository into sources list apt_repository: - repo: deb https://packages.erlang-solutions.com/ubuntu xenial contrib + repo: 'deb {{ ERLANG_SOURCE_DEB }} {{ansible_distribution_release}} contrib' state: present - name: Install erlang and elixir @@ -22,12 +22,12 @@ - name: Add PostgreSQL signing key apt_key: - url: https://www.postgresql.org/media/keys/ACCC4CF8.asc + url: '{{ POSTGRESQL_SIGNING_KEY_URL }}' state: present - name: Add PostgreSQL into sources list apt_repository: - repo: deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main + repo: 'deb {{ POSTGRESQL_SOURCE_DEB }} {{ POSTGRESQL_DISTRIBUTION_RELEASE }} main' state: present - name: Install PostgreSQL and other tools