---
# Ansible playbook to create OpenStack Compute Node
# OpenStack release: Kilo
# Host OS: ubuntu 14.04 64bit server
#
# NOTE:
#   Make sure that ssh works using PKI without password before using this playbook.
#   Make sure that target has static IP which is used in the hosts file.
#   Make sure that DNS is working on tagret (enable in /etc/resolv.conf)
#
# This playbook should be run for each computed node. Besure 
# to setup vars seperately for each compute node.
#
# command line: ansible-playbook  -i hosts compute_playbook.yml
#   or: ansible-playbook  -i hosts compute_playbook.yml  --tags "tagname"
#
# date: 12/17/15
# name: rmelton


- name: OpenStack Compute Node Playbook
  hosts: COMPUTE_NODE
  remote_user: stack
  become: yes

  roles:
   - { role: common,tags: [ 'common' ] }
   - { role: net_if,tags: [ 'net_if' ] }
   - { role: set_hosts,tags: [ 'set_hosts' ] }
   - { role: backup,tags: [ 'backup1' ] , backup_name: 'ubuntu-installed-updated'  }
   - { role: os_services,tags: [ 'os_services' ] }
   - { role: backup,tags: [ 'backup2' ] , backup_name: 'ubuntu-openstack-install-complete'  }

# force Ansible to change target address so we can run test from 
#   cloud controller
- name: OpenStack Compute Node Test
  hosts: CLOUD_CONTROLLER
  remote_user: stack
  become: no
  gather_facts: no
  roles:
   - { role: os_test,tags: [ 'os_test' ] }
 


