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

Commit bfd46a9

Browse files
authored
fix: install StackHead from Ansible collection (#3)
* fix: set filter namespace * chore: install next StackHead version * chore: use stackhead__roles variable * tests: fix stackhead role path
1 parent ac47c28 commit bfd46a9

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/test.yml

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

@@ -38,6 +40,8 @@ jobs:
3840
INVENTORY_PATH: __tests__/inventory.yml
3941
steps:
4042
- uses: actions/checkout@v2
43+
- name: Install Ansible v2.10 alpha (GH actions currently uses 2.9)
44+
run: ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install --user ansible==2.10.0a9 && ansible --version
4145
- run: pip install -r ./requirements/pip.txt
4246
- name: Print Ansible version
4347
run: ansible --version
@@ -76,7 +80,7 @@ jobs:
7680
proxied: 0
7781
token: "${{ secrets.CLOUDFLARE_TOKEN }}"
7882
zone: "${{ secrets.CLOUDFLARE_ZONE }}"
79-
- uses: "getstackhead/stackhead@master"
83+
- uses: getstackhead/stackhead@next
8084
with:
8185
ipaddress: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}
8286
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([])

templates/terraform/caddy_server.tf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
resource "caddy_server_block" "caddy-{{ project_name }}" {
33
filename = "{{ project_name }}.conf"
44

5-
{%- set all_ports = containerapp__expose|containerPorts(project_name) %}
5+
{%- set all_ports = containerapp__expose|getstackhead.stackhead.containerPorts(project_name) %}
66
markers = {
77
docker_ports = "{{ all_ports|map(attribute='tfstring')|join(',') }}"
88
}
@@ -42,4 +42,4 @@ EOF
4242
when = destroy
4343
command = "caddy reload -config /etc/caddy/Caddyfile"
4444
}
45-
}
45+
}

0 commit comments

Comments
 (0)