diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed4cafc..6eb9dd8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,8 +19,10 @@ jobs: 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: Get latest StackHead version - run: git clone --depth 1 --branch master https://github.com/getstackhead/stackhead.git stackhead-repo + run: ansible-galaxy collection install git+https://github.com/getstackhead/stackhead.git,next -f - run: ansible-playbook ./__tests__/test-tf-generation.yml checkLabel: @@ -37,6 +39,8 @@ jobs: if: github.event.pull_request.draft == false 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: Print Ansible version run: ansible --version - uses: webfactory/ssh-agent@v0.2.0 @@ -74,7 +78,7 @@ jobs: proxied: 0 token: "${{ secrets.CLOUDFLARE_TOKEN }}" zone: "${{ secrets.CLOUDFLARE_ZONE }}" - - uses: "getstackhead/stackhead@master" + - uses: getstackhead/stackhead@next with: ipaddress: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }} domain: '${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}' diff --git a/__tests__/filter_plugins b/__tests__/filter_plugins deleted file mode 120000 index eca3366..0000000 --- a/__tests__/filter_plugins +++ /dev/null @@ -1 +0,0 @@ -../stackhead-repo/ansible/filter_plugins/ \ No newline at end of file diff --git a/__tests__/test-tf-generation.yml b/__tests__/test-tf-generation.yml index 0b0cd73..a31c9c0 100644 --- a/__tests__/test-tf-generation.yml +++ b/__tests__/test-tf-generation.yml @@ -1,8 +1,10 @@ --- - hosts: localhost connection: local + vars: + stackhead__roles: "~/.ansible/collections/ansible_collections/getstackhead/stackhead/roles" tasks: - - include_vars: "../stackhead-repo/ansible/__tests__/variables.yml" + - include_vars: "{{ stackhead__roles }}/stackhead_module_api/testdata/variables.yml" - set_fact: containerapp__expose: "{{ containerapp__expose|default([]) + item.expose }}" when: item.expose is defined and item.expose not in containerapp__expose|default([]) diff --git a/tasks/deploy.yml b/tasks/deploy.yml index 4ae1244..a5894a5 100644 --- a/tasks/deploy.yml +++ b/tasks/deploy.yml @@ -12,4 +12,4 @@ - include_tasks: "{{ role_path }}/tasks/steps/generate-serverblock-tf.yml" # Generate SSL certificate configurations -- include_tasks: "roles/stackhead_project/tasks/ssl/ssl-config.yml" +- include_tasks: "{{ stackhead__roles }}/stackhead_module_api/tasks/ssl-certificate.yml" diff --git a/templates/terraform/nginx_server_block_docker.tf.j2 b/templates/terraform/nginx_server_block_docker.tf.j2 index 5da2bb3..58c12d3 100644 --- a/templates/terraform/nginx_server_block_docker.tf.j2 +++ b/templates/terraform/nginx_server_block_docker.tf.j2 @@ -3,7 +3,7 @@ resource "nginx_server_block" "nginx-{{ project_name }}" { filename = "{{ project_name }}.conf" enable = true -{%- set all_ports = containerapp__expose|containerPorts(project_name) %} +{%- set all_ports = containerapp__expose|getstackhead.stackhead.containerPorts(project_name) %} markers = { docker_ports = "{{ all_ports|map(attribute='tfstring')|join(',') }}" } @@ -47,4 +47,4 @@ EOT when = destroy command = "sudo systemctl reload nginx" } -} \ No newline at end of file +}