Adding xos container sanity tests
- validates xos core and synchronizer processes are started successfully
Change-Id: Id3a678c3ee60bd222b1cf8787f9501e826fb287e
Relates-to: CORD-1035
diff --git a/mock-ecord-container-test.yml b/mock-ecord-container-test.yml
new file mode 100644
index 0000000..3f00af1
--- /dev/null
+++ b/mock-ecord-container-test.yml
@@ -0,0 +1,94 @@
+---
+# mock-ecord xos container sanity tests
+
+- name: Add xos onboarded containers to inventory to test
+ hosts: head
+ roles:
+ - xos-onboard-test-hosts
+
+- name: Include vars
+ hosts: all
+ tasks:
+ - name: Include variables
+ include_vars: "{{ item }}"
+ with_items:
+ - "{{ playbook_dir }}/profile_manifests/{{ cord_profile }}.yml"
+ - "{{ playbook_dir }}/profile_manifests/local_vars.yml"
+
+- name: Check UI Container
+ hosts: xos-ui
+ connection: docker
+ roles:
+ - xos-container-test-ui
+
+- name: Check GUI Container
+ hosts: xos-spa-gui
+ connection: docker
+ roles:
+ - xos-container-test-spa-gui
+
+- name: Check REST GW Container
+ hosts: xos-rest-gateway
+ connection: docker
+ roles:
+ - xos-container-test-restgw
+
+- name: Check Chameleon Container
+ hosts: xos_chameleon
+ connection: docker
+ roles:
+ - xos-container-test-chameleon
+
+- name: Check XOS Core Synchronizer Container
+ hosts: xos_core
+ connection: docker
+ roles:
+ - xos-container-test-core
+
+- name: Check XOS ONOS Synchronizer Container
+ hosts: xos_onos_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-onos
+
+- name: Check XOS OPENSTACK Synchronizer Container
+ hosts: xos_openstack_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-openstack
+
+- name: Check XOS VTN Synchronizer Container
+ hosts: xos_vtn_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-vtn
+
+- name: Check XOS Fabric Synchronizer Container
+ hosts: xos_fabric_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-fabric
+
+- name: Check XOS VROUTER Synchronizer Container
+ hosts: xos_vrouter_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-vrouter
+
+- name: Check XOS VEG Synchronizer Container
+ hosts: xos_veg_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-veg
+
+- name: Check XOS VNOD Synchronizer Container
+ hosts: xos_vnod_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-vnod
+
+- name: Check XOS VEE Synchronizer Container
+ hosts: xos_vee_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-vee
diff --git a/mock-rcord-container-test.yml b/mock-rcord-container-test.yml
new file mode 100644
index 0000000..8fedcb9
--- /dev/null
+++ b/mock-rcord-container-test.yml
@@ -0,0 +1,78 @@
+---
+# mock-rcord xos container sanity tests
+
+#- include: "{{ playbook_dir }}/add-onboard-containers-playbook.yml"
+
+- name: Add xos onboarded containers to inventory to test
+ hosts: head
+ roles:
+ - xos-onboard-test-hosts
+
+- name: Include vars
+ hosts: all
+ tasks:
+ - name: Include variables
+ include_vars: "{{ item }}"
+ with_items:
+ - "{{ playbook_dir }}/profile_manifests/{{ cord_profile }}.yml"
+ - "{{ playbook_dir }}/profile_manifests/local_vars.yml"
+
+- name: Check UI Container
+ hosts: xos-ui
+ connection: docker
+ roles:
+ - xos-container-test-ui
+
+- name: Check GUI Container
+ hosts: xos-spa-gui
+ connection: docker
+ roles:
+ - xos-container-test-spa-gui
+
+- name: Check REST GW Container
+ hosts: xos-rest-gateway
+ connection: docker
+ roles:
+ - xos-container-test-restgw
+
+- name: Check Chameleon Container
+ hosts: xos_chameleon
+ connection: docker
+ roles:
+ - xos-container-test-chameleon
+
+- name: Check XOS Core Synchronizer Container
+ hosts: xos_core
+ connection: docker
+ roles:
+ - xos-container-test-core
+
+- name: Check XOS ONOS Synchronizer Container
+ hosts: xos_onos_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-onos
+
+- name: Check XOS Fabric Synchronizer Container
+ hosts: xos_fabric_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-fabric
+
+- name: Check XOS VROUTER Synchronizer Container
+ hosts: xos_vrouter_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-vrouter
+
+- name: Check XOS VSG Synchronizer Container
+ hosts: xos_vsg_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-vsg
+
+- name: Check XOS VTR Synchronizer Container
+ hosts: xos_vtr_synchronizer
+ connection: docker
+ roles:
+ - xos-container-test-vtr
diff --git a/roles/xos-container-test-chameleon/tasks/main.yml b/roles/xos-container-test-chameleon/tasks/main.yml
new file mode 100644
index 0000000..154ed8b
--- /dev/null
+++ b/roles/xos-container-test-chameleon/tasks/main.yml
@@ -0,0 +1,10 @@
+#xos-spa-gui tests
+
+- name: Check Chameleon Process
+ shell: ps -f | grep "'python chameleon/chameleon/main.py -R 9101 -G xos-core:50055'"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
diff --git a/roles/xos-container-test-core/tasks/main.yml b/roles/xos-container-test-core/tasks/main.yml
new file mode 100644
index 0000000..54c0af3
--- /dev/null
+++ b/roles/xos-container-test-core/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-spa-gui tests
+
+- name: Check XOS Core Process
+ shell: ps -f | grep "bash -c cd coreapi; bash ./start_coreapi.sh"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS Core Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS CoreContainer
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-fabric/tasks/main.yml b/roles/xos-container-test-fabric/tasks/main.yml
new file mode 100644
index 0000000..386ede7
--- /dev/null
+++ b/roles/xos-container-test-fabric/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-fabric-sync tests
+
+- name: Check XOS Fabric Synchronizer Process
+ shell: ps -f | grep "python fabric-synchronizer.py -C /opt/xos/synchronizers/fabric/fabric_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS Fabric Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS Fabric Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-onboarding/tasks/main.yml b/roles/xos-container-test-onboarding/tasks/main.yml
new file mode 100644
index 0000000..456dd90
--- /dev/null
+++ b/roles/xos-container-test-onboarding/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-onboarding-sync tests
+
+- name: Check XOS Onboarding Process
+ shell: ps -f | grep "python onboarding-synchronizer.py -C /opt/xos/synchronizers/onboarding/onboarding_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS Onboarding Container
+ shell: mount -l #| grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS Onboarding Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-onos/tasks/main.yml b/roles/xos-container-test-onos/tasks/main.yml
new file mode 100644
index 0000000..b2ec3cb
--- /dev/null
+++ b/roles/xos-container-test-onos/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-onos-sync tests
+
+- name: Check XOS ONOS Synchronizer Process
+ shell: ps -f | grep "python onos-synchronizer.py -C /opt/xos/synchronizers/onos/onos_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS ONOS Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS ONOS Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-openstack/tasks/main.yml b/roles/xos-container-test-openstack/tasks/main.yml
new file mode 100644
index 0000000..6915273
--- /dev/null
+++ b/roles/xos-container-test-openstack/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-openstack-sync tests
+
+- name: Check XOS Openstack Synchronizer Process
+ shell: ps -f | grep "python openstack-synchronizer.py -C /opt/xos/synchronizers/openstack/openstack_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS Openstack Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS Openstack Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-postgres/tasks/main.yml b/roles/xos-container-test-postgres/tasks/main.yml
new file mode 100644
index 0000000..f024261
--- /dev/null
+++ b/roles/xos-container-test-postgres/tasks/main.yml
@@ -0,0 +1,14 @@
+#xos-postgres tests
+
+- name: Check PSQL Service
+ shell: service postgresql status | grep "{{ item }}"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ with_items:
+ - 9.3/main
+ - port 5432
+ - online
+ tags:
+ - skip_ansible_lint # running a sub job
diff --git a/roles/xos-container-test-restgw/tasks/main.yml b/roles/xos-container-test-restgw/tasks/main.yml
new file mode 100644
index 0000000..5e27e02
--- /dev/null
+++ b/roles/xos-container-test-restgw/tasks/main.yml
@@ -0,0 +1,10 @@
+#xos-rest-gw tests
+
+- name: Check Rest GW Process
+ shell: ps -f | grep "node src/server.js --config gateway-config.yml"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
diff --git a/roles/xos-container-test-spa-gui/tasks/main.yml b/roles/xos-container-test-spa-gui/tasks/main.yml
new file mode 100644
index 0000000..711802a
--- /dev/null
+++ b/roles/xos-container-test-spa-gui/tasks/main.yml
@@ -0,0 +1,10 @@
+#xos-spa-gui tests
+
+- name: Check GUI Process
+ shell: ps -f | grep "nginx -g daemon off"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
diff --git a/roles/xos-container-test-ui/tasks/main.yml b/roles/xos-container-test-ui/tasks/main.yml
new file mode 100644
index 0000000..a86c6d6
--- /dev/null
+++ b/roles/xos-container-test-ui/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-ui tests
+
+- name: Check UI Process
+ shell: ps -f | grep "python /opt/xos/manage.py runserver 0.0.0.0:9000 --insecure --makemigrations"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on UI Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on UI Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
diff --git a/roles/xos-container-test-vee/tasks/main.yml b/roles/xos-container-test-vee/tasks/main.yml
new file mode 100644
index 0000000..ef25a3c
--- /dev/null
+++ b/roles/xos-container-test-vee/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-vee-sync tests
+
+- name: Check XOS VEE Synchronizer Process
+ shell: ps -f | grep "python vee-synchronizer.py -C /opt/xos/synchronizers/vee/vee_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS VEE Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS VEE Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-veg/tasks/main.yml b/roles/xos-container-test-veg/tasks/main.yml
new file mode 100644
index 0000000..f4d1eeb
--- /dev/null
+++ b/roles/xos-container-test-veg/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-veg-sync tests
+
+- name: Check XOS VEG Synchronizer Process
+ shell: ps -f | grep "python veg-synchronizer.py -C /opt/xos/synchronizers/veg/veg_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS VEG Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS VEG Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-vnod/tasks/main.yml b/roles/xos-container-test-vnod/tasks/main.yml
new file mode 100644
index 0000000..7a384f7
--- /dev/null
+++ b/roles/xos-container-test-vnod/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-vnod-sync tests
+
+- name: Check XOS VNOD Synchronizer Process
+ shell: ps -f | grep "python vnod-synchronizer.py -C /opt/xos/synchronizers/vnod/vnod_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS VNOD Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS VNOD Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-volt/tasks/main.yml b/roles/xos-container-test-volt/tasks/main.yml
new file mode 100644
index 0000000..1d9c672
--- /dev/null
+++ b/roles/xos-container-test-volt/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-volt-sync tests
+
+- name: Check XOS VOLT Synchronizer Process
+ shell: ps -f | grep "python volt-synchronizer.py -C /opt/xos/synchronizers/volt/volt_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS VOLT Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS VOLT Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-vrouter/tasks/main.yml b/roles/xos-container-test-vrouter/tasks/main.yml
new file mode 100644
index 0000000..9fa418f
--- /dev/null
+++ b/roles/xos-container-test-vrouter/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-vrouter-sync tests
+
+- name: Check XOS VROUTER Synchronizer Process
+ shell: ps -f | grep "python vrouter-synchronizer.py -C /opt/xos/synchronizers/vrouter/vrouter_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS VROUTER Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS VROUTER Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-vsg/tasks/main.yml b/roles/xos-container-test-vsg/tasks/main.yml
new file mode 100644
index 0000000..3860cb4
--- /dev/null
+++ b/roles/xos-container-test-vsg/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-vsg-sync tests
+
+- name: Check XOS VSG Synchronizer Process
+ shell: ps -f | grep "python vcpe-synchronizer.py -C /opt/xos/synchronizers/vsg/vsg_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS VSG Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS VSG Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-vtn/tasks/main.yml b/roles/xos-container-test-vtn/tasks/main.yml
new file mode 100644
index 0000000..0be4086
--- /dev/null
+++ b/roles/xos-container-test-vtn/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-vtn-sync tests
+
+- name: Check XOS VTN Synchronizer Process
+ shell: ps -f | grep "python vtn-synchronizer.py -C /opt/xos/synchronizers/vtn/vtn_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS VTN Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS VTN Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-container-test-vtr/tasks/main.yml b/roles/xos-container-test-vtr/tasks/main.yml
new file mode 100644
index 0000000..feaba0d
--- /dev/null
+++ b/roles/xos-container-test-vtr/tasks/main.yml
@@ -0,0 +1,24 @@
+#xos-vtr-sync tests
+
+- name: Check XOS VTR Synchronizer Process
+ shell: ps -f | grep "python vtr-synchronizer.py -C /opt/xos/synchronizers/vtr/vtr_synchronizer_config"
+ register: result
+ until: result | success
+ retries: 10
+ delay: 5
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Get Volume Mounts on XOS VTR Synchronizer Container
+ shell: mount -l | grep xos_services
+ register: volumes
+ tags:
+ - skip_ansible_lint # running a sub job
+
+- name: Validate Volume Mounts on XOS VTR Synchronizer Container
+ assert:
+ that: "'/opt/xos_services/{{ item.name }}' in volumes.stdout|lower"
+ with_items: "{{ xos_services }}"
+ when:
+ - "'{{ item.name }}' != 'vnodlocal'"
+ - "'{{ item.name }}' != 'volt'"
\ No newline at end of file
diff --git a/roles/xos-onboard-test-hosts/defaults/main.yml b/roles/xos-onboard-test-hosts/defaults/main.yml
new file mode 100644
index 0000000..659d9c4
--- /dev/null
+++ b/roles/xos-onboard-test-hosts/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+
+cord_dir: "{{ ansible_user_dir + '/cord' }}"
+
+cord_profile_dir: "{{ ansible_user_dir + '/cord_profile' }}"
diff --git a/roles/xos-onboard-test-hosts/tasks/main.yml b/roles/xos-onboard-test-hosts/tasks/main.yml
new file mode 100644
index 0000000..0496464
--- /dev/null
+++ b/roles/xos-onboard-test-hosts/tasks/main.yml
@@ -0,0 +1,20 @@
+---
+# xos-onboard-hosts/tasks/main.yml
+
+- name: Get the Docker container names for onboarded containers
+ docker_service:
+ project_name: "{{ cord_profile | regex_replace('\\W','') }}"
+ project_src: "{{ cord_profile_dir }}/onboarding-docker-compose/"
+ recreate: never
+ register: xos_onboard_out
+
+- name: Add the containers to Ansible groups on a per-container type basis
+ add_host:
+ name: "{{ xos_onboard_out.ansible_facts[item].keys() | first }}"
+ groups: "{{ item }}"
+ ansible_connection: "docker"
+ cord_profile: "{{ cord_profile }}"
+ ansible_ssh_user: "root"
+ with_items: "{{ xos_onboard_out.ansible_facts.keys() | list }}"
+ when:
+ - "'gui-extensions' not in '{{ xos_onboard_out.ansible_facts[item].keys() | first }}'"