mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Overhaul ansible-test cloud test plugins. (#53044)
This commit is contained in:
@@ -11,11 +11,12 @@
|
||||
#
|
||||
# NOTE: Automatic provisioning of AWS credentials requires an ansible-core-ci API key.
|
||||
|
||||
[default]
|
||||
aws_access_key: @ACCESS_KEY
|
||||
aws_secret_key: @SECRET_KEY
|
||||
security_token: @SECURITY_TOKEN
|
||||
aws_region: @REGION
|
||||
# aliases for backwards compatibility with older integration test playbooks
|
||||
ec2_access_key: '{{ aws_access_key }}'
|
||||
ec2_secret_key: '{{ aws_secret_key }}'
|
||||
ec2_region: '{{ aws_region }}'
|
||||
ec2_access_key: {{ aws_access_key }}
|
||||
ec2_secret_key: {{ aws_secret_key }}
|
||||
ec2_region: {{ aws_region }}
|
||||
@@ -13,6 +13,7 @@
|
||||
# 1) ansible-core-ci API key in ~/.ansible-core-ci.key
|
||||
# 2) Sherlock URL (including API key) in ~/.ansible-sherlock-ci.cfg
|
||||
|
||||
[default]
|
||||
# Provide either Service Principal or Active Directory credentials below.
|
||||
|
||||
# Service Principal
|
||||
@@ -4,5 +4,6 @@
|
||||
#
|
||||
# 1) Running integration tests without using ansible-test.
|
||||
#
|
||||
|
||||
[default]
|
||||
cloudscale_api_token = @API_TOKEN
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It is recommended that you DO NOT use this template unless you cannot use the simulator.
|
||||
|
||||
[cloudstack]
|
||||
[default]
|
||||
endpoint = http://@HOST:@PORT/client/api
|
||||
key = @KEY
|
||||
secret = @SECRET
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#
|
||||
# It is recommended that you DO NOT use this template unless you cannot use the simulator.
|
||||
|
||||
[default]
|
||||
gcp_project: @PROJECT
|
||||
gcp_cred_file: @CRED_FILE
|
||||
gcp_cred_kind: @CRED_KIND
|
||||
@@ -11,6 +11,7 @@
|
||||
#
|
||||
# It is recommended that you DO NOT use this template unless you cannot use the simulator.
|
||||
|
||||
[default]
|
||||
gitlab_host: http://@HOST:@PORT
|
||||
gitlab_login_token: @TOKEN
|
||||
gitlab_runner_registration_token: @RUNNER_TOKEN
|
||||
@@ -12,7 +12,7 @@
|
||||
# If you run with @FIXTURES enabled (true) then you can decide if you want to
|
||||
# run in @REPLAY mode (true) or, record mode (false).
|
||||
|
||||
|
||||
[default]
|
||||
opennebula_url: @URL
|
||||
opennebula_username: @USERNAME
|
||||
opennebula_password: @PASSWORD
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# NOTE: Automatic provisioning of Tower credentials requires an ansible-core-ci API key.
|
||||
|
||||
[general]
|
||||
[default]
|
||||
version=@VERSION
|
||||
host=@HOST
|
||||
username=@USERNAME
|
||||
@@ -6,8 +6,8 @@
|
||||
dns_prefix: "aks{{ resource_group | hash('md5') | truncate(10, True, '') }}"
|
||||
kubernetes_version: 1.7.7
|
||||
service_principal:
|
||||
client_id: "{{ lookup('env', 'AZURE_CLIENT_ID') }}"
|
||||
client_secret: "{{ lookup('env', 'AZURE_SECRET') }}"
|
||||
client_id: "{{ azure_client_id }}"
|
||||
client_secret: "{{ azure_secret }}"
|
||||
linux_profile:
|
||||
admin_username: azureuser
|
||||
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible
|
||||
@@ -36,8 +36,8 @@
|
||||
dns_prefix: "aks{{ resource_group | hash('md5') | truncate(10, True, '') }}"
|
||||
kubernetes_version: 1.7.7
|
||||
service_principal:
|
||||
client_id: "{{ lookup('env', 'AZURE_CLIENT_ID') }}"
|
||||
client_secret: "{{ lookup('env', 'AZURE_SECRET') }}"
|
||||
client_id: "{{ azure_client_id }}"
|
||||
client_secret: "{{ azure_secret }}"
|
||||
linux_profile:
|
||||
admin_username: azureuser
|
||||
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible
|
||||
@@ -74,7 +74,7 @@
|
||||
dns_prefix: "aks{{ resource_group | hash('md5') | truncate(10, True, '') }}"
|
||||
kubernetes_version: 1.7.7
|
||||
service_principal:
|
||||
client_id: "{{ lookup('env', 'AZURE_CLIENT_ID') }}"
|
||||
client_id: "{{ azure_client_id }}"
|
||||
linux_profile:
|
||||
admin_username: azureuser
|
||||
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible
|
||||
@@ -98,7 +98,7 @@
|
||||
dns_prefix: "aks{{ resource_group | hash('md5') | truncate(10, True, '') }}"
|
||||
kubernetes_version: 1.8.1
|
||||
service_principal:
|
||||
client_id: "{{ lookup('env', 'AZURE_CLIENT_ID') }}"
|
||||
client_id: "{{ azure_client_id }}"
|
||||
linux_profile:
|
||||
admin_username: azureuser
|
||||
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible
|
||||
@@ -122,7 +122,7 @@
|
||||
dns_prefix: "aks{{ resource_group | hash('md5') | truncate(10, True, '') }}"
|
||||
kubernetes_version: 1.8.1
|
||||
service_principal:
|
||||
client_id: "{{ lookup('env', 'AZURE_CLIENT_ID') }}"
|
||||
client_id: "{{ azure_client_id }}"
|
||||
linux_profile:
|
||||
admin_username: azureuser
|
||||
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
- name: Prepare random number
|
||||
set_fact:
|
||||
rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
|
||||
tenant_id: "{{ lookup('env','AZURE_TENANT') }}"
|
||||
tenant_id: "{{ azure_tenant }}"
|
||||
run_once: yes
|
||||
|
||||
- name: set service principal info
|
||||
set_fact:
|
||||
azure_client_id: "{{ lookup('env','AZURE_CLIENT_ID') }}"
|
||||
azure_secret: "{{ lookup('env','AZURE_SECRET') }}"
|
||||
no_log: yes
|
||||
|
||||
- name: lookup service principal object id
|
||||
set_fact:
|
||||
object_id: "{{ lookup('azure_service_principal_attribute',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
url: 'https://api.cloudscale.ch/v1/volumes'
|
||||
method: POST
|
||||
headers:
|
||||
Authorization: 'Bearer {{ lookup("env", "CLOUDSCALE_API_TOKEN") }}'
|
||||
Authorization: 'Bearer {{ cloudscale_api_token }}'
|
||||
body:
|
||||
name: '{{ cloudscale_resource_prefix }}-duplicate'
|
||||
size_gb: 50
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
- name: create the provider credentials from the cloud script
|
||||
set_fact:
|
||||
nios_provider:
|
||||
host: "{{ lookup('env', 'NIOS_HOST') }}"
|
||||
username: admin
|
||||
password: infoblox
|
||||
- debug: var=nios_provider
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
- name: Check that SSL is available
|
||||
tower_organization:
|
||||
name: Default
|
||||
environment:
|
||||
TOWER_HOST: "https://{{ lookup('env', 'TOWER_HOST') }}"
|
||||
register: result
|
||||
|
||||
- name: Check we haven't changed anything
|
||||
@@ -14,7 +12,6 @@
|
||||
tower_organization:
|
||||
name: Default
|
||||
environment:
|
||||
TOWER_HOST: "https://{{ lookup('env', 'TOWER_HOST') }}"
|
||||
TOWER_CERTIFICATE: /dev/null # force check failure
|
||||
ignore_errors: true
|
||||
register: check_ssl_is_used
|
||||
@@ -42,7 +39,6 @@
|
||||
tower_organization:
|
||||
name: Default
|
||||
environment:
|
||||
TOWER_HOST: "https://{{ lookup('env', 'TOWER_HOST') }}"
|
||||
TOWER_CERTIFICATE: /dev/null # should not fail because verify_ssl is disabled
|
||||
always:
|
||||
- name: Delete ~/.tower_cli.cfg
|
||||
|
||||
@@ -16,20 +16,20 @@
|
||||
|
||||
- name: Update the project (to clone the git repo)
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/projects/{{ result.id }}/update/"
|
||||
url: "https://{{ tower_host }}/api/v2/projects/{{ result.id }}/update/"
|
||||
method: POST
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
user: "{{ tower_username }}"
|
||||
password: "{{ tower_password }}"
|
||||
validate_certs: false
|
||||
status_code: 202
|
||||
force_basic_auth: true
|
||||
|
||||
- name: Wait for the project to be status=successful
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/projects/{{ result.id }}/"
|
||||
url: "https://{{ tower_host }}/api/v2/projects/{{ result.id }}/"
|
||||
method: GET
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
user: "{{ tower_username }}"
|
||||
password: "{{ tower_password }}"
|
||||
validate_certs: false
|
||||
force_basic_auth: true
|
||||
return_content: true
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.tower_version == '{{ lookup('env', 'TOWER_VERSION') }}'"
|
||||
- "result.tower_version == '{{ tower_version }}'"
|
||||
|
||||
- name: Make sure the default Default organization exists
|
||||
tower_organization:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
- name: Fetch project_base_dir
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/config/"
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
url: "https://{{ tower_host}}/api/v2/config/"
|
||||
user: "{{ tower_username }}"
|
||||
password: "{{ tower_password }}"
|
||||
validate_certs: false
|
||||
return_content: true
|
||||
register: awx_config
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
- name: Get unified job template ID for Demo Job Template"
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/unified_job_templates/?name=Demo+Job+Template"
|
||||
url: "https://{{ tower_host }}/api/v2/unified_job_templates/?name=Demo+Job+Template"
|
||||
method: GET
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
password: "{{ tower_password }}"
|
||||
user: "{{ tower_username }}"
|
||||
validate_certs: False
|
||||
register: unified_job
|
||||
|
||||
- name: Build workflow
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/workflow_job_templates/"
|
||||
url: "https://{{ tower_host }}/api/v2/workflow_job_templates/"
|
||||
body:
|
||||
name: "Success Template"
|
||||
variables: "---"
|
||||
extra_vars: ""
|
||||
body_format: 'json'
|
||||
method: 'POST'
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
password: "{{ tower_password }}"
|
||||
status_code: 201
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
user: "{{ tower_username }}"
|
||||
validate_certs: False
|
||||
register: workflow
|
||||
|
||||
- name: Add a node
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/workflow_job_templates/{{ workflow.json.id }}/workflow_nodes/"
|
||||
url: "https://{{ tower_host }}/api/v2/workflow_job_templates/{{ workflow.json.id }}/workflow_nodes/"
|
||||
body:
|
||||
credential: null
|
||||
diff_mode: null
|
||||
@@ -38,15 +38,15 @@
|
||||
verbosity: null
|
||||
body_format: 'json'
|
||||
method: 'POST'
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
password: "{{ tower_password }}"
|
||||
status_code: 201
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
user: "{{ tower_username }}"
|
||||
validate_certs: False
|
||||
register: node1
|
||||
|
||||
- name: Add a node
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/workflow_job_templates/{{ workflow.json.id }}/workflow_nodes/"
|
||||
url: "https://{{ tower_host }}/api/v2/workflow_job_templates/{{ workflow.json.id }}/workflow_nodes/"
|
||||
body:
|
||||
credential: null
|
||||
diff_mode: null
|
||||
@@ -60,19 +60,19 @@
|
||||
verbosity: null
|
||||
body_format: 'json'
|
||||
method: 'POST'
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
password: "{{ tower_password }}"
|
||||
status_code: 201
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
user: "{{ tower_username }}"
|
||||
validate_certs: False
|
||||
register: node2
|
||||
|
||||
- name: "Link nodes {{ node2.json.id }} to {{ node1.json.id }}"
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/workflow_job_template_nodes/{{ node1.json.id }}/success_nodes/"
|
||||
url: "https://{{ tower_host }}/api/v2/workflow_job_template_nodes/{{ node1.json.id }}/success_nodes/"
|
||||
body: '{ "id": {{ node2.json.id }} }'
|
||||
body_format: 'json'
|
||||
method: 'POST'
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
password: "{{ tower_password }}"
|
||||
status_code: 204
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
user: "{{ tower_username }}"
|
||||
validate_certs: False
|
||||
|
||||
@@ -17,20 +17,20 @@
|
||||
|
||||
- name: Update the project (to clone the git repo)
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/projects/{{ result.id }}/update/"
|
||||
url: "https://{{ tower_host }}/api/v2/projects/{{ result.id }}/update/"
|
||||
method: POST
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
user: "{{ tower_username }}"
|
||||
password: "{{ tower_password }}"
|
||||
validate_certs: false
|
||||
status_code: 202
|
||||
force_basic_auth: true
|
||||
|
||||
- name: Wait for the project to be status=successful
|
||||
uri:
|
||||
url: "https://{{ lookup('env', 'TOWER_HOST') }}/api/v2/projects/{{ result.id }}/"
|
||||
url: "https://{{ tower_host }}/api/v2/projects/{{ result.id }}/"
|
||||
method: GET
|
||||
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
|
||||
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
|
||||
user: "{{ tower_username }}"
|
||||
password: "{{ tower_password }}"
|
||||
validate_certs: false
|
||||
force_basic_auth: true
|
||||
return_content: true
|
||||
|
||||
Reference in New Issue
Block a user