blob: 53c5b424b979ce7cd2a57216f16d8619aa15c774 [file] [log] [blame]
Kailash Khalasiab480912017-03-20 13:14:51 -07001---
2# xos-onboard-hosts/tasks/main.yml
3
4- name: Get the Docker container names for onboarded containers
5 docker_service:
6 project_name: "{{ cord_profile | regex_replace('\\W','') }}"
Zack Williamsc989f262017-05-11 13:02:59 -07007 project_src: "{{ head_cord_profile_dir }}/onboarding-docker-compose/"
Kailash Khalasiab480912017-03-20 13:14:51 -07008 recreate: never
9 register: xos_onboard_out
10
11- name: Add the containers to Ansible groups on a per-container type basis
12 add_host:
13 name: "{{ xos_onboard_out.ansible_facts[item].keys() | first }}"
14 groups: "{{ item }}"
15 ansible_connection: "docker"
16 cord_profile: "{{ cord_profile }}"
17 ansible_ssh_user: "root"
18 with_items: "{{ xos_onboard_out.ansible_facts.keys() | list }}"
19 when:
20 - "'gui-extensions' not in '{{ xos_onboard_out.ansible_facts[item].keys() | first }}'"