blob: c183d9b2439404b8fef0069be43df9391967342b [file] [log] [blame]
---
# roles/juju-setup/main/tasks.yml
- name: Verify that we can log into every VM
command: ansible services -m ping -u ubuntu
- name: Initialize Juju
command: juju generate-config
creates={{ ansible_env['PWD'] }}/.juju/environments.yaml
- name: Juju config file
template:
src=environments.yaml.j2
dest={{ ansible_env['PWD'] }}/.juju/environments.yaml
- name: Bootstrap Juju
command: juju bootstrap
creates={{ ansible_env['PWD'] }}/.juju/environments/manual.jenv
- name: Copy openstack.cfg for Juju
become: yes
copy:
src=openstack.cfg
dest=/usr/local/src/openstack.cfg
- name: Get Juju machine status
command: juju status --format=json
register: juju_status_json
- name: Add Juju status to ansible facts
set_fact: juju_status="{{ juju_status_json.stdout | from_json }}"
- name: Add machines to Juju
with_items: head_vm_list