From bc1959ed31bb252f20ac085fc08c046836beffb3 Mon Sep 17 00:00:00 2001
From: Monty Taylor Office of Technology Zuul Ansible Technical Committee Developer Infrastructure Core Team Former Foundation Board of Directors PTL of shade project Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. simple.yaml A playbook containing a play that will run
+ against all hosts in the inventory. It has one task
+ that uses the command module to run the "hostname" command.
+ longer.yaml A playboook containing two plays. The first runs
+ a role called "create-mirror-locations" against a group of hosts
+ from the inventory called "git". Then it runs a role
+ called "create-repositories" against a host from the inventory
+ called "code-review.example.com".
+
+ Don't let the existence of Rackspace modules confuse you.
+ The OpenStack modules work just great on Rackspace
+ A provider decided to redefine the OpenStack Availability Zone concept
+ complete with incompatible API changes. That is unsupportable. PS. Don't do that OpenStack in Ansible and Multi-cloud Operations are easy... but you need to know a few things. New inventory plugin coming in Ansible 2.4 USER_CONFIG_DIR is different on Linux, OSX and Windows. SITE_CONFIG_DIR is different on Linux, OSX and Windows. For multi-cloud, think of two types: Simple example of a clouds.yaml Where's the password? More information can be provided. https://git.openstack.org/cgit/openstack/ansible-role-cloud-launcher http://linch-pin.readthedocs.io/en/develop/ Linch-pin provides a collection of Ansible playbooks for provisioning, decommissioning, and managing resources across multiple infrastructures. The main goal of linch-pin is to facilitate provisioning and orchestration of resources in a multi-cloud environment through a topology file.Who am I?
+
+ Who am I?
+
+ Ansible
+ Why Ansible is Great
+
+
+ Ansible Overview
+
+
+ Ansible Simple Example
+
+
+- hosts: all
+ tasks:
+ - name: Print hostname of server
+ command: hostname
+
Ansible Longer Example
+
+
+- hosts: git
+ roles:
+ - create-mirror-locations
+- hosts: code-review.example.com
+ roles:
+ - create-repositories
+
Ansible Modules
+
+
+ Ansible OpenStack Modules
+
+
+ Interop - Work on All OpenStack Clouds
+
+
+ Work Around Deployer Differences ... To a Point
+
+
+ Based on shade library
+
+
+
+
Integration Testing
+
+
+ Let's Take a Few Steps Back
+
+
+ Module Structure
+
+
+ os_
+
+
+
+
+
+
+
+ OpenStack Dynamic Inventory Script
+
+
+ Modules for All OpenStack Resources are Welcome Upstream
+
+
+ To Serve All Users, We Have to be Strict
+
+
+ clouds.yaml
+
+
+ What about Mac and Windows?
+
+
+
+
+ Config Terminology
+
+
+ Remember your Execution Context!
+
+
+ basic clouds.yaml for the example code
+
+
+
+clouds:
+ my-citycloud:
+ profile: citycloud
+ auth:
+ username: mordred
+ project_id: 65222a4d09ea4c68934fa1028c77f394
+ user_domain_id: d0919bd5e8d74e49adf0e145807ffc38
+ project_domain_id: d0919bd5e8d74e49adf0e145807ffc38
+
secure.yaml
+
+
+ Example secure.yaml
+
+
+
+clouds:
+ my-citycloud:
+ auth:
+ password: XXXXXXXX
+
more clouds.yaml
+
+
+
+my-vexxhost:
+ identity_api_version: 3
+ image_endpoint_override: https://image-ca-ymq-1.vexxhost.net/v2
+ profile: vexxhost
+ auth:
+ user_domain_id: default
+ project_domain_id: default
+ project_name: d8af8a8f-a573-48e6-898a-af333b970a2d
+ username: 0b8c435b-cc4d-4e05-8a47-a2ada0539af1
+
Much more complex clouds.yaml example
+
+
+
+my-internap:
+ auth:
+ auth_url: https://identity.api.cloud.iweb.com
+ username: api-55f9a00fb2619
+ project_name: inap-17037
+ identity_api_version: 3
+ floating_ip_source: None
+ regions:
+ - name: ams01
+ values:
+ networks:
+ - name: inap-17037-WAN1654
+ routes_externally: true
+ default_interface: true
+ - name: inap-17037-LAN3631
+ routes_externally: false
Extra Variables to Control Inventory Behavior
+
+
+
+
+
+
+
+
+
+ ansible:
+ use_hostnames: False
+ expand_hostvars: True
+ fail_on_errors: True
Test Your Config
+ ---
+- hosts: localhost
+ tasks:
+ - os_auth:
+ cloud: "{{ item.cloud }}"
+ region_name: "{{ item.region }}"
+ with_items:
+ - cloud: my-vexxhost
+ region: ca-ymq-1
+ - cloud: my-citycloud
+ region: Buf1
+ - cloud: my-internap
+ region: ams01
+
More Interesting
+
+- hosts: localhost
+ tasks:
+ - os_server:
+ name: "my-server"
+ cloud: "{{ item.cloud }}"
+ region_name: "{{ item.region }}"
+ image: "{{ item.image }}"
+ flavor: "{{ item.flavor }}"
+ auto_ip: true
+ with_items:
+ - cloud: my-vexxhost
+ region: ca-ymq-1
+ image: Ubuntu 16.04.1 LTS [2017-03-03]
+ flavor: v1-standard-4
+ - cloud: my-citycloud
+ region: Buf1
+ image: Ubuntu 16.04 Xenial Xerus
+ flavor: 4C-4GB-100GB
+ - cloud: my-internap
+ region: ams01
+ image: Ubuntu 16.04 LTS (Xenial Xerus)
+ flavor: A1.4
Check That There is an Inventory
+
+ python ~/src/github.com/ansible/ansible/contrib/inventory/openstack.py --list
+
+ Cleanup After Ourselves
+
+- hosts: localhost
+ tasks:
+ - os_server:
+ cloud: "{{ item.cloud }}"
+ region_name: "{{ item.region }}"
+ name: my-server
+ state: absent
+ with_items:
+ - cloud: my-vexxhost
+ region: ca-ymq-1
+ - cloud: my-citycloud
+ region: Buf1
+ - cloud: my-internap
+ region: ams01
+
Check out Ansible Cloud Launcher
+
+
+ Check out Linch-pin
+
+
+
+ I want to write some new Cloud Native applications while continuing + to make use of my existing investments.
++ I need to move faster than before AND I need increased stability at + the same time.
+20k VMs per-day
20 Cloud Regions in 9 clouds
Only using OpenStack APIs
@@ -61,20 +72,27 @@Every commit is fully integration tested (twice) before landing
+Every change goes through enforced automatic full integration testing + (at least twice) before landing
Install and run one or more clouds then validate that those clouds + work.
+This is that "cloud scale out" part
A library to handle config information for openstack clients
-Tracks differences in vendors that can't be discovered
-In use in python-openstackclient, shade and ansible
-~/.config/openstack/clouds.yaml
--clouds: - citycloud: - profile: citycloud - auth: - username: mordred - password: XXXXXXXXXXXXXXXXXXXXX - project_id: 65222a4d09ea4c68934fa1028c77f394 - user_domain_id: d0919bd5e8d74e49adf0e145807ffc38 - project_domain_id: d0919bd5e8d74e49adf0e145807ffc38 - regions: - - Kna1 - - Sto2 - - Lon1 - dreamcompute: - profile: dreamhost - auth: - username: montay6 - project_name: dhc2111978 - password: XXXXXXXXXXXXX - region_name: RegionOne --
A library to wrap business logic around client libraries
--cloud.create_image('image-name', filename='image-filename.qcow2') -cloud.create_server('my-server', image='immage-name', auto_ip=True) --
In use in Infra Nodepool and ansible
-Based on shade
--- os_keypair: - cloud: citycloud - name: mordred - public_key_file: ~/.ssh/id_rsa.pub -- os_image: - cloud: citycloud - name: Monty Ubuntu - file: ubuntu.vhd -- os_server: - cloud: citycloud - name: my-server - flavor_ram: 1024 - image: Monty Ubuntu --
-- os_keypair:
- cloud: "{{ item.cloud }}"
- region_name: "{{ item.region_name }}"
- name: mordred
- public_key_file: ~/.ssh/id_rsa.pub
- with-items:
- - {cloud: vexxhost, region_name: ca-ymq-1}
- - {cloud: ovh, region_name: GRA1}
- - {cloud: ustack, region_name: bj1}
- - {cloud: citycloud, region_name: Sto2}
- - {cloud: internap, region_name: sin01}
- - {cloud: fuga, region_name: cystack}
- - {cloud: datacentred, region_name: sal01}
- - {cloud: rax, region_name: SYD}
- - {cloud: clouda, region_name: regionOne}
- - {cloud: auro, region_name: van1}
- - {cloud: zetta, region_name: no-osl1}
- - {cloud: kiss, region_name: region1}
-
- Why should you care?
-Is interop really important?
+Is interoperability really important?
sorted alphabetically
-99 Cloud
-China Mobile
-China National Offshore Oil Corp
-China Telecom
-China Unicom
-EasyStack
-Inspur
-Sinorail
-State Grid of China
-T2 Cloud
-Tencent
-UMCloud
-UnitedStack
-ZTE
++ Only 8 of the 24 Gold Member Companies are non-Asian
CityCloud: Sweden, UK, US
Datacentred: UK
Elastx: Sweden
Enter Cloud Suite: Italy, Germany
Fugo: Netherlands
Internap: Netherlands, US, Singapore
-OTC: Frankfurt
+OTC: Germany
OVH: France, US
Switch: Switzerland
Ultimum: Czech Republic
@@ -364,13 +256,15 @@ cloud.create_server('my-server', image='immage-name', auto_ip=True)That I personally have an account on
Auro: Vancouver
Catalyst: New Zealand
Conoha: Japan, Singapore, US
Dreamhost: US
-Ormuco: Canada + Federated
+Ormuco: Canada, Federated Worldwide
Vexxhost: Canada
+UnitedStack: China
Constant work in progress, help us when we get this - wrong
because we ARE you.
+because OpenStack IS you.