Skip to content

Commit

Permalink
test: pass secrets in as env
Browse files Browse the repository at this point in the history
Signed-off-by: gardar <[email protected]>
  • Loading branch information
gardar committed Jan 15, 2024
1 parent b99bfff commit e42d60a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ansible-test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ jobs:
test_stack_name: ${{ secrets.ANSIBLE_TEST_CI_STACK }}" > tests/integration/integration_config.yml
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
org_name: "${{ secrets.ANSIBLE_TEST_ORG_NAME }}"
grafana_cloud_api_key: "${{ secrets.ANSIBLE_TEST_CLOUD_API_KEY }}"
grafana_api_key: "${{ secrets.ANSIBLE_TEST_GRAFANA_API_KEY }}"
grafana_url: "${{ secrets.ANSIBLE_GRAFANA_URL }}"
test_stack_name: "${{ secrets.ANSIBLE_TEST_CI_STACK }}"
10 changes: 5 additions & 5 deletions tests/integration/targets/create_cloud_stack/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
- name: Create a Grafana Cloud stack
grafana.grafana.cloud_stack:
name: "{{ test_stack_name }}"
stack_slug: "{{ test_stack_name }}"
cloud_api_key: "{{ grafana_cloud_api_key }}"
org_slug: "{{ org_name }}"
name: "{{ lookup('ansible.builtin.env', 'test_stack_name') }}"
stack_slug: "{{ lookup('ansible.builtin.env', 'test_stack_name') }}"
cloud_api_key: "{{ lookup('ansible.builtin.env', 'grafana_cloud_api_key') }}"
org_slug: "{{ lookup('ansible.builtin.env', 'org_name') }}"
state: present
register: create_result

- name: Create Check
ansible.builtin.assert:
that:
- create_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net"
- create_result.url == "https://" + "{{ lookup('ansible.builtin.env', 'test_stack_name') }}" + ".grafana.net"

- name: Sleep for 45 seconds
ansible.builtin.wait_for:
Expand Down

0 comments on commit e42d60a

Please sign in to comment.