Skip to content

Commit

Permalink
activation tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Akasurde committed Aug 19, 2024
1 parent 08d98f5 commit 277f650
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
1 change: 1 addition & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ hdrs
testuser
testsecret
keygen
testpass
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- "milestone"

env:
CONTROLLER_URL: "https://localhost:8443"
CONTROLLER_HOST: "https://localhost:8443"
CONTROLLER_USERNAME: "admin"
CONTROLLER_PASSWORD: "testpass"
CONTROLLER_VERIFY_SSL: false
Expand Down
27 changes: 2 additions & 25 deletions tests/integration/targets/activation/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
---
- block:
- set_fact:
credential_defaults: &credential_defaults
controller_username: "{{ controller_username }}"
controller_password: "{{ controller_password }}"
controller_host: "{{ controller_host }}"
validate_certs: false
- debug:
msg: "{{ lookup('ansible.builtin.env', 'CONTROLLER_HOST') }}"

- name: Generate a random_string for the test
set_fact:
Expand All @@ -32,15 +28,13 @@

- name: Create an AWX controller token
ansible.eda.controller_token:
<<: *credential_defaults
name: "{{ awx_token_name }}"
description: "A test AWX controller token description"
token: "{{ token_value }}"
state: present

- name: Create a new credential type
ansible.eda.credential_type:
<<: *credential_defaults
name: "{{ credential_type_name }}"
state: present
description: "A test credential type"
Expand Down Expand Up @@ -88,7 +82,6 @@

- name: Create a new SCM credential
ansible.eda.credential:
<<: *credential_defaults
name: "{{ credential_name }}"
state: present
credential_type_name: Source Control
Expand All @@ -107,7 +100,6 @@

- name: Create a new project
ansible.eda.project:
<<: *credential_defaults
name: "{{ project_name }}"
description: "Test Project Description"
url: "{{ scm_url }}"
Expand All @@ -123,7 +115,6 @@

- name: Create a new decision environment
ansible.eda.decision_environment:
<<: *credential_defaults
name: "{{ decision_env_name }}"
description: "Test Decision Environment Description"
credential: "{{ credential_name }}"
Expand All @@ -132,7 +123,6 @@

- name: Create a new rulebook activation in check mode
ansible.eda.activation:
<<: *credential_defaults
name: "{{ activation_name }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -150,7 +140,6 @@

- name: Create a new rulebook activation
ansible.eda.activation:
<<: *credential_defaults
name: "{{ activation_name }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -167,7 +156,6 @@

- name: Create a new rulebook activation again
ansible.eda.activation:
<<: *credential_defaults
name: "{{ activation_name }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -185,16 +173,13 @@

- name: Get information about the rulebook activation
ansible.eda.activation_info:
<<: *credential_defaults
name: "{{ activation_name }}"

- name: List all the rulebook activations
ansible.eda.activation_info:
<<: *credential_defaults

- name: Delete project
ansible.eda.project:
<<: *credential_defaults
name: "{{ project_name }}"
state: absent
register: project_deletion
Expand All @@ -207,7 +192,6 @@

- name: Delete credential
ansible.eda.credential:
<<: *credential_defaults
name: "{{ credential_name }}"
state: absent
register: credential_deletion
Expand All @@ -220,49 +204,42 @@

- name: Delete rulebook activation
ansible.eda.activation:
<<: *credential_defaults
name: "{{ activation_name }}"
state: absent

always:
- name: Delete AWX token
ansible.eda.controller_token:
<<: *credential_defaults
name: "{{ awx_token_name }}"
state: absent
ignore_errors: true

- name: Delete project
ansible.eda.project:
<<: *credential_defaults
name: "{{ project_name }}"
state: absent
ignore_errors: true

- name: Delete decision environment
ansible.eda.decision_environment:
<<: *credential_defaults
name: "{{ decision_env_name }}"
state: absent
ignore_errors: true

- name: Delete credential
ansible.eda.credential:
<<: *credential_defaults
name: "{{ credential_name }}"
state: absent
ignore_errors: true

- name: Delete credential type
ansible.eda.credential_type:
<<: *credential_defaults
name: "{{ credential_type_name }}"
state: absent
ignore_errors: true

- name: Delete rulebook activation
ansible.eda.activation:
<<: *credential_defaults
name: "{{ activation_name }}"
state: absent
ignore_errors: true

0 comments on commit 277f650

Please sign in to comment.