From 7635f5b5167c85969dfb151ab5bdb88fae40d1b8 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 15 Nov 2020 12:10:09 +0100 Subject: [PATCH 01/12] ci: upgrade ssh-agent action to v0.4.1 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f4061d..7c6f478 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,7 +51,7 @@ jobs: - run: pip install -r ./requirements/pip.txt - name: Print Ansible version run: ansible --version - - uses: webfactory/ssh-agent@v0.2.0 + - uses: webfactory/ssh-agent@v0.4.1 with: ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" - name: Setup Hetzner server From 7ca52792caf5cc194bfbfe6f4732c116c56150f2 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 15 Nov 2020 12:40:56 +0100 Subject: [PATCH 02/12] chore: drop old load-config file --- tasks/load-config.yml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tasks/load-config.yml diff --git a/tasks/load-config.yml b/tasks/load-config.yml deleted file mode 100644 index 0645040..0000000 --- a/tasks/load-config.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include_vars: - file: "{{ module_role_path|default(role_path) }}/stackhead-module.yml" - name: "{{ include_varname }}" From 1205bb6ba67a5fe96480adc8e4b3938bb13c765a Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 15 Nov 2020 12:41:17 +0100 Subject: [PATCH 03/12] ci: print pip version --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c6f478..dd3939d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,9 +48,7 @@ jobs: run: ansible --version && sudo apt purge ansible -y - name: Install Ansible v2.10 alpha (GH actions currently uses 2.9) run: sudo python -m pip install ansible==2.10.0a9 && ansible --version - - run: pip install -r ./requirements/pip.txt - - name: Print Ansible version - run: ansible --version + - run: pip -V && pip install -r ./requirements/pip.txt - uses: webfactory/ssh-agent@v0.4.1 with: ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" From 63272102ec626bcbb9db5dd1c6b946493d80d615 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 15 Nov 2020 12:50:38 +0100 Subject: [PATCH 04/12] fix: use main task from StackHead module API --- __tests__/test-tf-generation.yml | 4 ++-- tasks/{steps => caddy_steps}/generate-caddyfile-tf.yml | 0 tasks/{steps => caddy_steps}/generate-serverconfig-tf.yml | 0 tasks/destroy.yml | 2 -- tasks/main.yml | 2 +- tasks/{ => steps}/deploy.yml | 2 +- tasks/{ => steps}/setup.yml | 2 +- 7 files changed, 5 insertions(+), 7 deletions(-) rename tasks/{steps => caddy_steps}/generate-caddyfile-tf.yml (100%) rename tasks/{steps => caddy_steps}/generate-serverconfig-tf.yml (100%) delete mode 100644 tasks/destroy.yml rename tasks/{ => steps}/deploy.yml (92%) rename tasks/{ => steps}/setup.yml (94%) diff --git a/__tests__/test-tf-generation.yml b/__tests__/test-tf-generation.yml index aaa5614..787aa4c 100644 --- a/__tests__/test-tf-generation.yml +++ b/__tests__/test-tf-generation.yml @@ -11,9 +11,9 @@ with_items: "{{ app_config.domains }}" - block: - name: Generate Caddy Terraform file - import_tasks: "../tasks/steps/generate-serverconfig-tf.yml" + import_tasks: "../tasks/caddy_steps/generate-serverconfig-tf.yml" - name: Generate Caddyfile - import_tasks: "../tasks/steps/generate-caddyfile-tf.yml" + import_tasks: "../tasks/caddy_steps/generate-caddyfile-tf.yml" vars: module_role_path: ".." caddy_root: "." diff --git a/tasks/steps/generate-caddyfile-tf.yml b/tasks/caddy_steps/generate-caddyfile-tf.yml similarity index 100% rename from tasks/steps/generate-caddyfile-tf.yml rename to tasks/caddy_steps/generate-caddyfile-tf.yml diff --git a/tasks/steps/generate-serverconfig-tf.yml b/tasks/caddy_steps/generate-serverconfig-tf.yml similarity index 100% rename from tasks/steps/generate-serverconfig-tf.yml rename to tasks/caddy_steps/generate-serverconfig-tf.yml diff --git a/tasks/destroy.yml b/tasks/destroy.yml deleted file mode 100644 index 3dc52fb..0000000 --- a/tasks/destroy.yml +++ /dev/null @@ -1,2 +0,0 @@ -# This task is executed when a project is destroyed. Usually empty. ---- diff --git a/tasks/main.yml b/tasks/main.yml index ee57368..f427685 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,2 +1,2 @@ --- -- include_tasks: "{{ module_role_path|default(role_path) }}/tasks/{{ stackhead_action }}.yml" +- include_tasks: "{{ stackhead__roles }}/stackhead_module_api/tasks/module-main.yml" diff --git a/tasks/deploy.yml b/tasks/steps/deploy.yml similarity index 92% rename from tasks/deploy.yml rename to tasks/steps/deploy.yml index b350202..268bd79 100644 --- a/tasks/deploy.yml +++ b/tasks/steps/deploy.yml @@ -11,5 +11,5 @@ with_items: "{{ app_config.domains }}" - name: Generate Caddy Terraform file - include_tasks: "{{ module_role_path|default(role_path) }}/tasks/steps/generate-serverconfig-tf.yml" + include_tasks: "{{ module_role_path|default(role_path) }}/tasks/caddy_steps/generate-serverconfig-tf.yml" diff --git a/tasks/setup.yml b/tasks/steps/setup.yml similarity index 94% rename from tasks/setup.yml rename to tasks/steps/setup.yml index f4df3c2..24d83c7 100644 --- a/tasks/setup.yml +++ b/tasks/steps/setup.yml @@ -12,7 +12,7 @@ vars: caddy_install_source: package - name: Overwrite Caddyfile - include_tasks: "{{ module_role_path|default(role_path) }}/tasks/steps/generate-caddyfile-tf.yml" + include_tasks: "{{ module_role_path|default(role_path) }}/tasks/caddy_steps/generate-caddyfile-tf.yml" - name: Restart Caddy command: /bin/true notify: From 42ff8a403c25261b4791b5f2df04258e261c99d7 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 15 Nov 2020 14:26:32 +0100 Subject: [PATCH 05/12] ci: install Ansible v2.10.3 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd3939d..ffc2b15 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,8 +46,8 @@ jobs: python-version: '3.x' - name: Uninstall old Ansible run: ansible --version && sudo apt purge ansible -y - - name: Install Ansible v2.10 alpha (GH actions currently uses 2.9) - run: sudo python -m pip install ansible==2.10.0a9 && ansible --version + - name: Install Ansible v2.10.3 (GH actions currently uses 2.9) + run: sudo python -m pip install ansible==2.10.3 && ansible --version - run: pip -V && pip install -r ./requirements/pip.txt - uses: webfactory/ssh-agent@v0.4.1 with: From 91ff783039054b5773190eec8629db3eace72838 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 29 Nov 2020 15:21:11 +0100 Subject: [PATCH 06/12] chore: remove obsolete main.yml file --- tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 tasks/main.yml diff --git a/tasks/main.yml b/tasks/main.yml deleted file mode 100644 index f427685..0000000 --- a/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include_tasks: "{{ stackhead__roles }}/stackhead_module_api/tasks/module-main.yml" From 745be22c5d84834dcc718d613f8adbb32fcbf080 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Thu, 11 Mar 2021 13:56:24 +0100 Subject: [PATCH 07/12] chore: use unforked samdoran.caddy --- meta/main.yml | 7 ++----- stackhead-module.yml | 2 -- tasks/steps/deploy.yml | 4 ---- tasks/steps/setup.yml | 8 -------- vars/main.yml | 2 -- 5 files changed, 2 insertions(+), 21 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 8f73e36..f377a52 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -14,8 +14,5 @@ galaxy_info: - caddyserver dependencies: - #- name: samdoran.caddy - # version: v1.0.0 - - src: git+https://github.com/saitho/ansible-role-caddy.git - version: caddy-v2 - name: samdoran.caddy + - name: samdoran.caddy + version: 2.1.0 diff --git a/stackhead-module.yml b/stackhead-module.yml index 150459d..6d7ba86 100644 --- a/stackhead-module.yml +++ b/stackhead-module.yml @@ -5,5 +5,3 @@ terraform: vendor: getstackhead name: caddy version: 1.0.1 - # deprecated: remove url with Terraform 0.13 in main project - url: https://github.com/getstackhead/terraform-caddy/releases/download/v1.0.0/terraform-provider-caddy diff --git a/tasks/steps/deploy.yml b/tasks/steps/deploy.yml index 268bd79..6ececb0 100644 --- a/tasks/steps/deploy.yml +++ b/tasks/steps/deploy.yml @@ -1,9 +1,5 @@ # This task list generates the Caddy configuration for a project --- -- name: Include OS-specific variables. - include_vars: "{{ ansible_os_family }}.yml" - ignore_errors: yes - - name: Check if authentications are defined set_fact: auths_basic: "{{ auths_basic|default([]) + item.security.authentication }}" diff --git a/tasks/steps/setup.yml b/tasks/steps/setup.yml index 24d83c7..209e796 100644 --- a/tasks/steps/setup.yml +++ b/tasks/steps/setup.yml @@ -1,16 +1,8 @@ # This task list sets up Caddy during server setup --- -- debug: - msg: "{{ caddy_install_source }}" -- debug: - msg: "{{ caddy_install_source }}" - vars: - caddy_install_source: package - name: Setup Caddy include_role: name: samdoran.caddy - vars: - caddy_install_source: package - name: Overwrite Caddyfile include_tasks: "{{ module_role_path|default(role_path) }}/tasks/caddy_steps/generate-caddyfile-tf.yml" - name: Restart Caddy diff --git a/vars/main.yml b/vars/main.yml index a310c0f..c60b361 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,5 +1,3 @@ --- caddy_user: "stackhead" caddy_group: "stackhead" -caddy_version: "2.1.1" -caddy_install_source: "package" From 6765199af25e5f2557f308fa6e599f680ea5f154 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Fri, 12 Mar 2021 12:34:49 +0100 Subject: [PATCH 08/12] chore: use configured email address --- templates/caddy/Caddyfile.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/caddy/Caddyfile.j2 b/templates/caddy/Caddyfile.j2 index 195e7f3..c5c15e8 100644 --- a/templates/caddy/Caddyfile.j2 +++ b/templates/caddy/Caddyfile.j2 @@ -1,7 +1,7 @@ #jinja2: trim_blocks:False { {% if lookup('env','TEST') == '1' %} acme_ca https://acme-staging-v02.api.letsencrypt.org/directory{% endif %} - email certificate@saitho.me + email {{ certificates_email_address }} } *:80 { @@ -10,4 +10,4 @@ file_server } -import conf.d/*.conf \ No newline at end of file +import conf.d/*.conf From ae82d67cfcd0801a9cc29349712a990fceea8a2f Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Thu, 11 Mar 2021 14:10:10 +0100 Subject: [PATCH 09/12] ci: update test workflow --- .github/workflows/test.yml | 166 ++++++++++++++++--------------- __tests__/test-tf-generation.yml | 4 +- 2 files changed, 89 insertions(+), 81 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffc2b15..9a41c9f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,17 +11,26 @@ env: DOMAIN_NAME: "pr-${{ github.run_id }}-caddy" DOMAIN_SUFFIX: "test.stackhead.io" +# You should not need to change anything below. + jobs: smoke: name: Smoketest test-tf-generation runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Ansible v2.10 alpha (GH actions currently uses 2.9) - run: ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install --user ansible==2.10.0a9 && ansible --version + - name: Remove Python 2 and old Ansible 2.9 version + run: sudo apt purge python ansible -y + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install Ansible v2.10.3 (GH actions currently uses 2.9) + run: pip install ansible==2.10.3 + - name: Print Ansible and Python version + run: ansible --version && python --version - name: Get latest StackHead version run: ansible-galaxy collection install git+https://github.com/getstackhead/stackhead.git,next -f - - run: pip install -r ./requirements/pip.txt - run: ansible-playbook ./__tests__/test-tf-generation.yml checkLabel: @@ -36,80 +45,79 @@ jobs: needs: checkLabel runs-on: ubuntu-latest if: github.event.pull_request.draft == false - env: - INVENTORY_PATH: __tests__/inventory.yml steps: - - uses: actions/checkout@v2 - - name: Set up Python 3 - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Uninstall old Ansible - run: ansible --version && sudo apt purge ansible -y - - name: Install Ansible v2.10.3 (GH actions currently uses 2.9) - run: sudo python -m pip install ansible==2.10.3 && ansible --version - - run: pip -V && pip install -r ./requirements/pip.txt - - uses: webfactory/ssh-agent@v0.4.1 - with: - ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" - - name: Setup Hetzner server - id: setup_server - uses: saitho/hetzner-cloud-action@v1.1.0 - with: - action: create - server_name: "${{ env.DOMAIN_NAME }}" - server_image: ubuntu-18.04 - server_location: fsn1 - server_ssh_key_name: gh-actions - wait_for_ssh: 1 - env: - API_TOKEN: ${{ secrets.HETZNER_TOKEN }} - - name: Add DNS record - uses: saitho/create-dns-record@patch-1 - with: - type: "A" - name: "${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" - content: "${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}" - ttl: 1 - proxied: 0 - token: "${{ secrets.CLOUDFLARE_TOKEN }}" - zone: "${{ secrets.CLOUDFLARE_ZONE }}" - - name: Add DNS record for subdomain - uses: saitho/create-dns-record@patch-1 - with: - type: "A" - name: "sub.${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" - content: "${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}" - ttl: 1 - proxied: 0 - token: "${{ secrets.CLOUDFLARE_TOKEN }}" - zone: "${{ secrets.CLOUDFLARE_ZONE }}" - - uses: getstackhead/stackhead/actions/integration-test@next - with: - ipaddress: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }} - domain: '${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}' - domain2: 'sub.${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}' - webserver: '${{ env.WEBSERVER }}' - rolename: '${{ env.ROLE_NAME }}' - - name: Remove DNS record - uses: saitho/delete-dns-record@saitho-patch-1 - if: always() - with: - name: "${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" - token: "${{ secrets.CLOUDFLARE_TOKEN }}" - zone: "${{ secrets.CLOUDFLARE_ZONE }}" - - name: Remove DNS record for subdomain - uses: saitho/delete-dns-record@saitho-patch-1 - if: always() - with: - name: "sub.${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" - token: "${{ secrets.CLOUDFLARE_TOKEN }}" - zone: "${{ secrets.CLOUDFLARE_ZONE }}" - - name: Remove Hetzner server - uses: saitho/hetzner-cloud-action@v1.1.0 - if: always() - with: - action: remove - server_id: "${{ steps.setup_server.outputs.hcloud_server_id }}" - env: - API_TOKEN: ${{ secrets.HETZNER_TOKEN }} + - uses: actions/checkout@v2 + - name: Remove Python 2 and old Ansible 2.9 version + run: sudo apt purge python ansible -y + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install Ansible v2.10.3 (GH actions currently uses 2.9) + run: pip install ansible==2.10.3 + - name: Print Ansible and Python version + run: ansible --version && python --version + - uses: webfactory/ssh-agent@v0.4.1 + with: + ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" + - name: Setup Hetzner server + id: setup_server + uses: saitho/hetzner-cloud-action@v1.1.0 + with: + action: create + server_name: "${{ env.DOMAIN_NAME }}" + server_image: ubuntu-18.04 + server_location: fsn1 + server_ssh_key_name: gh-actions + wait_for_ssh: 1 + env: + API_TOKEN: ${{ secrets.HETZNER_TOKEN }} + - name: Add DNS record + uses: saitho/create-dns-record@patch-1 + with: + type: "A" + name: "${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" + content: "${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}" + ttl: 1 + proxied: 0 + token: "${{ secrets.CLOUDFLARE_TOKEN }}" + zone: "${{ secrets.CLOUDFLARE_ZONE }}" + - name: Add DNS record for subdomain + uses: saitho/create-dns-record@patch-1 + with: + type: "A" + name: "sub.${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" + content: "${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}" + ttl: 1 + proxied: 0 + token: "${{ secrets.CLOUDFLARE_TOKEN }}" + zone: "${{ secrets.CLOUDFLARE_ZONE }}" + - uses: getstackhead/stackhead/actions/integration-test@next + with: + ipaddress: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }} + domain: '${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}' + domain2: 'sub.${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}' + webserver: '${{ env.WEBSERVER }}' + rolename: '${{ env.ROLE_NAME }}' + - name: Remove DNS record + uses: saitho/delete-dns-record@saitho-patch-1 + if: always() + with: + name: "${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" + token: "${{ secrets.CLOUDFLARE_TOKEN }}" + zone: "${{ secrets.CLOUDFLARE_ZONE }}" + - name: Remove DNS record for subdomain + uses: saitho/delete-dns-record@saitho-patch-1 + if: always() + with: + name: "sub.${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" + token: "${{ secrets.CLOUDFLARE_TOKEN }}" + zone: "${{ secrets.CLOUDFLARE_ZONE }}" + - name: Remove Hetzner server + uses: saitho/hetzner-cloud-action@v1.1.0 + if: always() + with: + action: remove + server_id: "${{ steps.setup_server.outputs.hcloud_server_id }}" + env: + API_TOKEN: ${{ secrets.HETZNER_TOKEN }} diff --git a/__tests__/test-tf-generation.yml b/__tests__/test-tf-generation.yml index 787aa4c..8797a5d 100644 --- a/__tests__/test-tf-generation.yml +++ b/__tests__/test-tf-generation.yml @@ -11,9 +11,9 @@ with_items: "{{ app_config.domains }}" - block: - name: Generate Caddy Terraform file - import_tasks: "../tasks/caddy_steps/generate-serverconfig-tf.yml" + import_tasks: "{{ module_role_path | default(role_path) }}/tasks/caddy_steps/generate-serverconfig-tf.yml" - name: Generate Caddyfile - import_tasks: "../tasks/caddy_steps/generate-caddyfile-tf.yml" + import_tasks: "{{ module_role_path | default(role_path) }}/tasks/caddy_steps/generate-caddyfile-tf.yml" vars: module_role_path: ".." caddy_root: "." From f91e54718f74ea1d84ba1b466241880537d1e20f Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Fri, 12 Mar 2021 16:50:32 +0100 Subject: [PATCH 10/12] ci: consider action/keep-integration-stage flag --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a41c9f..8db56c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -101,21 +101,21 @@ jobs: rolename: '${{ env.ROLE_NAME }}' - name: Remove DNS record uses: saitho/delete-dns-record@saitho-patch-1 - if: always() + if: always() && !contains( github.event.pull_request.labels.*.name, 'action/keep-integration-stage') with: name: "${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" token: "${{ secrets.CLOUDFLARE_TOKEN }}" zone: "${{ secrets.CLOUDFLARE_ZONE }}" - name: Remove DNS record for subdomain uses: saitho/delete-dns-record@saitho-patch-1 - if: always() + if: always() && !contains( github.event.pull_request.labels.*.name, 'action/keep-integration-stage') with: name: "sub.${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}" token: "${{ secrets.CLOUDFLARE_TOKEN }}" zone: "${{ secrets.CLOUDFLARE_ZONE }}" - name: Remove Hetzner server uses: saitho/hetzner-cloud-action@v1.1.0 - if: always() + if: always() && !contains( github.event.pull_request.labels.*.name, 'action/keep-integration-stage') with: action: remove server_id: "${{ steps.setup_server.outputs.hcloud_server_id }}" From 289c0847be5837f624c24ac895d7fed58cc73de6 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Fri, 12 Mar 2021 13:43:13 +0100 Subject: [PATCH 11/12] ci: install samdoran.caddy dependency --- .github/workflows/test.yml | 2 ++ tasks/steps/setup.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8db56c0..c62f815 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,6 +92,8 @@ jobs: proxied: 0 token: "${{ secrets.CLOUDFLARE_TOKEN }}" zone: "${{ secrets.CLOUDFLARE_ZONE }}" + - name: Install samdoran.caddy dependency + run: ansible-galaxy install samdoran.caddy,2.1.0 - uses: getstackhead/stackhead/actions/integration-test@next with: ipaddress: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }} diff --git a/tasks/steps/setup.yml b/tasks/steps/setup.yml index 209e796..8e87652 100644 --- a/tasks/steps/setup.yml +++ b/tasks/steps/setup.yml @@ -14,6 +14,6 @@ url: "http://{{ ansible_default_ipv4.address|default(ansible_all_ipv4_addresses[0]) }}" return_content: yes register: uri_result - until: '"Caddy web server" in uri_result.content' + until: '"Caddy" in uri_result.content' retries: 5 - delay: 1 + delay: 5 From c1cdf8f33662dcb8cce2d4e88ee4e4a6e42b5021 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Fri, 12 Mar 2021 17:57:38 +0100 Subject: [PATCH 12/12] debug --- tasks/caddy_steps/generate-serverconfig-tf.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/caddy_steps/generate-serverconfig-tf.yml b/tasks/caddy_steps/generate-serverconfig-tf.yml index c2b2422..9a4fefd 100644 --- a/tasks/caddy_steps/generate-serverconfig-tf.yml +++ b/tasks/caddy_steps/generate-serverconfig-tf.yml @@ -1,5 +1,11 @@ --- - block: + - debug: + msg: "{{ module_role_path }}" + - debug: + msg: "{{ role_path|d() }}" + - debug: + msg: "{{ module_role_path|default(role_path) }}/templates/terraform/caddy_server.tf.j2" - template: src: "{{ module_role_path|default(role_path) }}/templates/terraform/caddy_server.tf.j2" dest: "{{ dest_file }}"