Skip to content
This repository was archived by the owner on Aug 21, 2022. It is now read-only.

Commit 5c2ed5d

Browse files
authored
fix: install StackHead from Ansible collection (#3)
* fix: add namespace to filter plugin calls * fix: role path * fix: role path * chore: install next StackHead version * chore: use stackhead__roles variable * tests: fix stackhead role path
1 parent 3f2cc25 commit 5c2ed5d

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v2
22+
- name: Install Ansible v2.10 alpha (GH actions currently uses 2.9)
23+
run: ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install --user ansible==2.10.0a9 && ansible --version
2224
- name: Get latest StackHead version
23-
run: git clone --depth 1 --branch master https://github.com/getstackhead/stackhead.git stackhead-repo
25+
run: ansible-galaxy collection install git+https://github.com/getstackhead/stackhead.git,next -f
2426
- run: ansible-playbook ./__tests__/test-tf-generation.yml
2527

2628
checkLabel:
@@ -37,6 +39,8 @@ jobs:
3739
if: github.event.pull_request.draft == false
3840
steps:
3941
- uses: actions/checkout@v2
42+
- name: Install Ansible v2.10 alpha (GH actions currently uses 2.9)
43+
run: ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install --user ansible==2.10.0a9 && ansible --version
4044
- name: Print Ansible version
4145
run: ansible --version
4246
- uses: webfactory/[email protected]
@@ -74,7 +78,7 @@ jobs:
7478
proxied: 0
7579
token: "${{ secrets.CLOUDFLARE_TOKEN }}"
7680
zone: "${{ secrets.CLOUDFLARE_ZONE }}"
77-
- uses: "getstackhead/stackhead@master"
81+
- uses: getstackhead/stackhead@next
7882
with:
7983
ipaddress: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}
8084
domain: '${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}'

__tests__/filter_plugins

Lines changed: 0 additions & 1 deletion
This file was deleted.

__tests__/test-tf-generation.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
- hosts: localhost
33
connection: local
4+
vars:
5+
stackhead__roles: "~/.ansible/collections/ansible_collections/getstackhead/stackhead/roles"
46
tasks:
5-
- include_vars: "../stackhead-repo/ansible/__tests__/variables.yml"
7+
- include_vars: "{{ stackhead__roles }}/stackhead_module_api/testdata/variables.yml"
68
- set_fact:
79
containerapp__expose: "{{ containerapp__expose|default([]) + item.expose }}"
810
when: item.expose is defined and item.expose not in containerapp__expose|default([])

tasks/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
- include_tasks: "{{ role_path }}/tasks/steps/generate-serverblock-tf.yml"
1313

1414
# Generate SSL certificate configurations
15-
- include_tasks: "roles/stackhead_project/tasks/ssl/ssl-config.yml"
15+
- include_tasks: "{{ stackhead__roles }}/stackhead_module_api/tasks/ssl-certificate.yml"

templates/terraform/nginx_server_block_docker.tf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resource "nginx_server_block" "nginx-{{ project_name }}" {
33
filename = "{{ project_name }}.conf"
44
enable = true
55

6-
{%- set all_ports = containerapp__expose|containerPorts(project_name) %}
6+
{%- set all_ports = containerapp__expose|getstackhead.stackhead.containerPorts(project_name) %}
77
markers = {
88
docker_ports = "{{ all_ports|map(attribute='tfstring')|join(',') }}"
99
}
@@ -47,4 +47,4 @@ EOT
4747
when = destroy
4848
command = "sudo systemctl reload nginx"
4949
}
50-
}
50+
}

0 commit comments

Comments
 (0)