Tutorial by Examples

Check the right software versions are installed: ansible >=2.0 python >=2.6 shade module for python $ansible --version ansible 2.2.0.0 $python --version Python 2.7.5 Install 'shade' the python component used to pilot openstack. $pip install shade Note : if you use a company...
Our openstack tenant is already set: a virtual lan gives instances private IP a virtual router map public IP to private IP a security key has been generated we have default firewall configuration for ssh and port 80 we are able to launch an instance thanks to the OpenStack web interface ...
Let use 'os_server' command from module 'Cloud' [http://docs.ansible.com/ansible/os_server_module.html]. Variables are defined in ./group_vars/all. $vi launch_compute.yml - name: launch a compute instance hosts: localhost gather_facts: False tasks: - name: Create and launch the VM ...
Use the 'os_server_facts' command from module 'Cloud' [http://docs.ansible.com/ansible/os_server_module.html]. Variables are defined in ./group_vars/all and the instance name is in server: "MyOwnPersonalInstance". $vi get_compute_info.yml - name: Get and print instance IP hosts: loca...
Instead of printing all the informations, we print only IP address of the first instance whose name is "MyOwnPersonalInstance". It's usually all we need. $vi get_compute_ip.yml - name: Get and print instance IP hosts: localhost gather_facts: False tasks: - name: Get VM infos...
To delete our instance, reuse the os_server command with all authentication information and simply replace ' state: present' by ' state: absent'. $vi stop_compute.yml - name: launch a compute instance hosts: localhost gather_facts: False tasks: - name: Create and launch the VM os_...

Page 1 of 1