diff --git a/test/integration/Makefile b/test/integration/Makefile index c708e08e40..1322871593 100644 --- a/test/integration/Makefile +++ b/test/integration/Makefile @@ -115,7 +115,10 @@ gce: $(CREDENTIALS_FILE) CLOUD_RESOURCE_PREFIX="$(CLOUD_RESOURCE_PREFIX)" make gce_cleanup ; \ exit $$RC; -rackspace: $(CREDENTIALS_FILE) +rackspace_prepare: + ansible-playbook rackspace.yml -i $(INVENTORY) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -e "resource_prefix=$(CLOUD_RESOURCE_PREFIX)" -v $(TEST_FLAGS) -t prepare + +rackspace: rackspace_prepare $(CREDENTIALS_FILE) ansible-playbook rackspace.yml -i $(INVENTORY) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -e "resource_prefix=$(CLOUD_RESOURCE_PREFIX)" -v $(TEST_FLAGS) ; \ RC=$$? ; \ CLOUD_RESOURCE_PREFIX="$(CLOUD_RESOURCE_PREFIX)" make rackspace_cleanup ; \ diff --git a/test/integration/rackspace.yml b/test/integration/rackspace.yml index 48ca9322ee..5d4d389f8d 100644 --- a/test/integration/rackspace.yml +++ b/test/integration/rackspace.yml @@ -5,6 +5,11 @@ tags: - rackspace roles: + - role: prepare_rax_tests + tags: + - prepare + - prepare_rax_tests + - role: test_rax tags: test_rax diff --git a/test/integration/roles/prepare_rax_tests/defaults/main.yml b/test/integration/roles/prepare_rax_tests/defaults/main.yml new file mode 100644 index 0000000000..ccead866c7 --- /dev/null +++ b/test/integration/roles/prepare_rax_tests/defaults/main.yml @@ -0,0 +1,7 @@ +--- +rackspace_region: IAD +rackspace_image_human_id: "ubuntu-1404-lts-trusty-tahr-pvhvm" +rackspace_image_id: "753a7703-4960-488b-aab4-a3cdd4b276dc" +rackspace_image_name: "Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)" +rackspace_flavor: "performance1-1" +resource_prefix: ansible-testing diff --git a/test/integration/roles/prepare_rax_tests/tasks/main.yml b/test/integration/roles/prepare_rax_tests/tasks/main.yml new file mode 100644 index 0000000000..60cc52830f --- /dev/null +++ b/test/integration/roles/prepare_rax_tests/tasks/main.yml @@ -0,0 +1,11 @@ +--- +- name: Check for required variables + assert: + that: + - resource_prefix is defined and resource_prefix + - rackspace_username is defined and rackspace_username + - rackspace_api_key is defined and rackspace_api_key + - rackspace_region is defined and rackspace_region + - rackspace_image_human_id is defined and rackspace_image_human_id + - rackspace_image_id is defined and rackspace_image_id + - rackspace_image_name is defined and rackspace_image_name diff --git a/test/integration/roles/test_rax/defaults/main.yml b/test/integration/roles/test_rax/defaults/main.yml deleted file mode 100644 index 4854b645cf..0000000000 --- a/test/integration/roles/test_rax/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -rackspace_region: IAD -resource_prefix: ansible-testing diff --git a/test/integration/roles/test_rax/meta/main.yml b/test/integration/roles/test_rax/meta/main.yml new file mode 100644 index 0000000000..a3f85b642e --- /dev/null +++ b/test/integration/roles/test_rax/meta/main.yml @@ -0,0 +1,3 @@ +dependencies: + - prepare_tests + - prepare_rax_tests diff --git a/test/integration/roles/test_rax/tasks/main.yml b/test/integration/roles/test_rax/tasks/main.yml index e4422d8859..4fe820a3c2 100644 --- a/test/integration/roles/test_rax/tasks/main.yml +++ b/test/integration/roles/test_rax/tasks/main.yml @@ -1,12 +1,3 @@ ---- -- name: Check for required variables - assert: - that: - - resource_prefix is defined and resource_prefix - - rackspace_username is defined and rackspace_username - - rackspace_api_key is defined and rackspace_api_key - - rackspace_region is defined and rackspace_region - # ============================================================ - name: Test rax with no args rax: @@ -63,7 +54,7 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin + image: "{{ rackspace_image_id }}" ignore_errors: true register: rax @@ -82,8 +73,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" ignore_errors: true register: rax @@ -102,8 +93,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-1" register: rax @@ -123,8 +114,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-1" state: absent wait: true @@ -146,8 +137,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-2" wait: true register: rax @@ -168,8 +159,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-2" wait: true register: rax @@ -189,8 +180,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-2" state: absent wait: true @@ -214,8 +205,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-3" meta: foo: bar @@ -239,8 +230,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-3" meta: foo: bar @@ -262,8 +253,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-3" state: absent meta: @@ -289,8 +280,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-4" count: 2 wait: true @@ -310,8 +301,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-4" count: 2 wait: true @@ -331,8 +322,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-4" count: 3 wait: true @@ -352,8 +343,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-4" count: 3 state: absent @@ -378,8 +369,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-5-%02d" count: 2 group: "{{ resource_prefix }}-5" @@ -401,8 +392,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-5-%02d" count: 2 group: "{{ resource_prefix }}-5" @@ -428,8 +419,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-6-%02d" count: 2 group: "{{ resource_prefix }}-6" @@ -451,8 +442,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-6-%02d" count: 2 group: "{{ resource_prefix }}-6" @@ -473,8 +464,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-6-%02d" count: 4 group: "{{ resource_prefix }}-6" @@ -500,8 +491,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-7-%02d" count: 2 exact_count: true @@ -524,8 +515,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-7-%02d" count: 2 exact_count: true @@ -547,8 +538,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-7-%02d" count: 4 exact_count: true @@ -572,8 +563,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-7-%02d" count: 0 exact_count: true @@ -599,8 +590,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-8" count: 2 group: "{{ resource_prefix }}-8" @@ -623,8 +614,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-8" count: 2 group: "{{ resource_prefix }}-8" @@ -651,8 +642,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-9" count: 2 exact_count: true @@ -675,8 +666,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-9" count: 0 exact_count: true @@ -702,8 +693,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-10-%03d" count: 2 count_offset: 10 @@ -727,8 +718,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-10-%03d" count: 0 count_offset: 10 @@ -755,8 +746,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-10-%03d" count: 2 count_offset: 10 @@ -780,8 +771,8 @@ username: "{{ rackspace_username }}" api_key: "{{ rackspace_api_key }}" region: "{{ rackspace_region }}" - image: ubuntu-1204-lts-precise-pangolin - flavor: performance1-1 + image: "{{ rackspace_image_id }}" + flavor: "{{ rackspace_flavor }}" name: "{{ resource_prefix }}-10-%03d" count: 0 count_offset: 10 diff --git a/test/integration/roles/test_rax_clb/defaults/main.yml b/test/integration/roles/test_rax_clb/defaults/main.yml deleted file mode 100644 index 4854b645cf..0000000000 --- a/test/integration/roles/test_rax_clb/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -rackspace_region: IAD -resource_prefix: ansible-testing diff --git a/test/integration/roles/test_rax_clb/meta/main.yml b/test/integration/roles/test_rax_clb/meta/main.yml new file mode 100644 index 0000000000..a3f85b642e --- /dev/null +++ b/test/integration/roles/test_rax_clb/meta/main.yml @@ -0,0 +1,3 @@ +dependencies: + - prepare_tests + - prepare_rax_tests diff --git a/test/integration/roles/test_rax_clb/tasks/main.yml b/test/integration/roles/test_rax_clb/tasks/main.yml index b52094035e..8f6a990ceb 100644 --- a/test/integration/roles/test_rax_clb/tasks/main.yml +++ b/test/integration/roles/test_rax_clb/tasks/main.yml @@ -1,12 +1,3 @@ ---- -- name: Check for required variables - assert: - that: - - resource_prefix is defined and resource_prefix - - rackspace_username is defined and rackspace_username - - rackspace_api_key is defined and rackspace_api_key - - rackspace_region is defined and rackspace_region - # ============================================================ - name: Test rax_clb with no args rax_clb: diff --git a/test/integration/roles/test_rax_clb_nodes/defaults/main.yml b/test/integration/roles/test_rax_clb_nodes/defaults/main.yml deleted file mode 100644 index 4854b645cf..0000000000 --- a/test/integration/roles/test_rax_clb_nodes/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -rackspace_region: IAD -resource_prefix: ansible-testing diff --git a/test/integration/roles/test_rax_clb_nodes/meta/main.yml b/test/integration/roles/test_rax_clb_nodes/meta/main.yml new file mode 100644 index 0000000000..a3f85b642e --- /dev/null +++ b/test/integration/roles/test_rax_clb_nodes/meta/main.yml @@ -0,0 +1,3 @@ +dependencies: + - prepare_tests + - prepare_rax_tests diff --git a/test/integration/roles/test_rax_clb_nodes/tasks/main.yml b/test/integration/roles/test_rax_clb_nodes/tasks/main.yml index 5a867b19eb..01bbf9dd9a 100644 --- a/test/integration/roles/test_rax_clb_nodes/tasks/main.yml +++ b/test/integration/roles/test_rax_clb_nodes/tasks/main.yml @@ -1,12 +1,3 @@ ---- -- name: Check for required variables - assert: - that: - - resource_prefix is defined and resource_prefix - - rackspace_username is defined and rackspace_username - - rackspace_api_key is defined and rackspace_api_key - - rackspace_region is defined and rackspace_region - # ============================================================ - name: Test rax_clb_nodes with no args rax_clb_nodes: