From 54ca8097eb4c29a98b62f0d241606a374ac17136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 15 Mar 2021 17:32:42 +0100 Subject: [PATCH 1/8] Setup Github Actions --- .github/workflows/tests.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..5d206341 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: Test suite +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-16.04, ubuntu-18.04] + rails_env: [staging, production] + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install Ansible + run: pip install ansible + - name: Update system packages + run: sudo apt-get update -y + - name: Install OpenSSH + run: sudo apt-get install -y openssh-server + - name: Generate dummy SSH key + run: ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa + - name: Create hosts file + run: echo "localhost ansible_connection=local ansible_user=root" > hosts + - name: Run CONSUL installer + run: ansible-playbook consul.yml -i hosts --extra-vars "env=${{ matrix.rails_env }} domain=localhost errbit=True" -vvv From a164169abe9948469295583313fca50dbbb688a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 15 Mar 2021 17:34:00 +0100 Subject: [PATCH 2/8] Uninstall pre-installed mongodb versions Some Ubuntu images could have pre-installed packages which conflicts with the packages installed by the installer, like the Ubuntu based Github virtual environments. --- roles/mongodb/tasks/main.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 470f4f97..e7fb7c23 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -1,5 +1,15 @@ -- name: Install MongoDB +- name: Uninstall preinstalled MongoDB versions + apt: + name: + - mongodb* + - mongodb-org* + purge: yes + state: absent + ignore_errors: yes + +- name: Install latest MongoDB version apt: name: - mongodb - mongodb-server + state: present From 200f3dc9408b07b743da984ac83567b2b082ea15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 15 Mar 2021 17:40:12 +0100 Subject: [PATCH 3/8] Update hack to install Errbit using Bundler 1.17.1 Two months ago the Errbit Gemfile.lock was updated [1] so the task to hack the bundler version is not working since then. [1] https://github.com/errbit/errbit/commit/e9ca15b842521d2ae536590c57c3db61fef19a3e --- roles/errbit/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/errbit/tasks/main.yml b/roles/errbit/tasks/main.yml index 7bad566d..77f46ca9 100644 --- a/roles/errbit/tasks/main.yml +++ b/roles/errbit/tasks/main.yml @@ -12,7 +12,7 @@ - name: Use bundler 1.x replace: path: "{{ errbit_dir }}/Gemfile.lock" - regexp: ' 2.1.2' + regexp: ' 2.1.4' replace: ' 1.17.1' - name: Create log folder From 81038256cd69b52a8cbc0aa2b3593c72c3969b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Wed, 17 Mar 2021 13:22:45 +0100 Subject: [PATCH 4/8] Install manually python3.6 as pip dropped support on January 2020 As python 3.6 us the default for Ubuntu 18.04 this is only needed for 16.04. Note that the mentioned ppa is down, so we are using a working one: `ppa:deadsnakes/ppa` https://stackoverflow.com/questions/42662104/how-to-install-pip-for-python-3-6-on-ubuntu-16-10/44254088#44254088 --- .github/workflows/tests.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5d206341..070f6ddf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,8 +21,19 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.6 + # https://github.com/pypa/pip/pull/9189 + - name: Install python3.6 on Ubuntu 16.04 + if: ${{ matrix.os == 'ubuntu-16.04' }} + run: | + sudo add-apt-repository -y ppa:deadsnakes/ppa + sudo apt-get update + sudo apt-get install -y python3.6 python3.6-dev python3.6-venv + wget https://bootstrap.pypa.io/get-pip.py + sudo -H python3.6 get-pip.py + sudo ln -s /usr/bin/python3.6 /usr/local/bin/python3 + sudo ln -s /usr/bin/python3.6 /usr/local/bin/python - name: Install Ansible - run: pip install ansible + run: pip install ansible - name: Update system packages run: sudo apt-get update -y - name: Install OpenSSH From 9e1c93848db0dfd8a27521f1e5951ef5185c0cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Wed, 17 Mar 2021 13:48:46 +0100 Subject: [PATCH 5/8] Do not use setup-python action on Ubuntu16.04 --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 070f6ddf..cb0c7b81 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,8 +19,10 @@ jobs: - uses: actions/checkout@v2 - name: Set up Python 3.6 uses: actions/setup-python@v2 + if: ${{ matrix.os != 'ubuntu-16.04' }} with: python-version: 3.6 + # https://github.com/pypa/pip/pull/9189 - name: Install python3.6 on Ubuntu 16.04 if: ${{ matrix.os == 'ubuntu-16.04' }} From ba2a541c9bf3f614dc0aef78c847aa74882a462f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Wed, 17 Mar 2021 17:10:15 +0100 Subject: [PATCH 6/8] Remember the user the need of the SSH key pair to run the installer For less experienced users this additional explanation could save them some time. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df01ad44..d0beb033 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ A remote server with one of the supported distributions: - Ubuntu 16.04 x64 - Ubuntu 18.04 x64 -Access to a remote server via public ssh key without password. +Access to a remote server via public ssh key without password. If you don't have a SSH key pair yet, you can generate it with `ssh-keygen` command on Linux based systems, this key will be added to the `deploy` user `.ssh/authorized_keys` file during installation process so the machine from where running the installer has access to the servers as the `deploy` user. The default user is `deploy` but you can [use any user](#using-a-different-user-than-deploy) with sudo privileges. ``` From de643f21861ab758a5eb35a9b7a2cbf84aad8811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Wed, 17 Mar 2021 17:56:04 +0100 Subject: [PATCH 7/8] [TEMP] Try to install pyOpenSSL in a different way Pending --- roles/letsencrypt/tasks/main.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/roles/letsencrypt/tasks/main.yml b/roles/letsencrypt/tasks/main.yml index 2d53ce80..f475b205 100644 --- a/roles/letsencrypt/tasks/main.yml +++ b/roles/letsencrypt/tasks/main.yml @@ -30,10 +30,7 @@ state: present - name: Ensure python OpenSSL dependencies are installed - pip: - name: - - pyOpenSSL - state: present + command: python -m pip install --user pyOpenSSL - name: Ensure directory exists for local self-signed TLS certs. file: From 248f9c5a9bad5dcabfcff8757fdcb5373d073952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Wed, 17 Mar 2021 18:10:00 +0100 Subject: [PATCH 8/8] Revert "[TEMP] Try to install pyOpenSSL in a different way" This reverts commit de643f21861ab758a5eb35a9b7a2cbf84aad8811. --- roles/letsencrypt/tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/letsencrypt/tasks/main.yml b/roles/letsencrypt/tasks/main.yml index f475b205..2d53ce80 100644 --- a/roles/letsencrypt/tasks/main.yml +++ b/roles/letsencrypt/tasks/main.yml @@ -30,7 +30,10 @@ state: present - name: Ensure python OpenSSL dependencies are installed - command: python -m pip install --user pyOpenSSL + pip: + name: + - pyOpenSSL + state: present - name: Ensure directory exists for local self-signed TLS certs. file: