Automating the Deployment of Legacy VNFs with Ansible

Daniel Farrell
(Red Hat)
TODO: Tweet screenshot

Self

TODO: Introduce self

Legacy

TODO: Talk about wrong way of doing things

Intro to Configuration MANAGEMENT 

INTRO TO CONFIGURATION MANAGEMENT

Reproducible

INTRO TO CONFIGURATION MANAGEMENT

Automated

INTRO TO CONFIGURATION MANAGEMENT

Treat infrastructure like code

INTRO TO CONFIGURATION MANAGEMENT

Similar deployments for dev, QE, pre-production, production

INTRO TO CONFIGURATION MANAGEMENT

Easy to collaborate
(community, new team members)

INTRO TO CONFIGURATION MANAGEMENT

Reusable by other tooling
(Packer)

Intro to Ansible

TODO

ANSIBLE Example

TODO: This is rehashed ODL example, refactor portions into something appropriate for this talk

Ansible

IPR underway to import into ODL-managed repos

Ansible

Ansible Galaxy

Ansible

Good OS support
(CentOS, Fedora, Ubuntu 16.04)

Ansible

Daily tests in ODL CI

Ansible

Example: Vagrant provisioner

Ansible

At a high level...

Ansible

  # Box that installs ODL via its Ansible role on CentOS 7
  config.vm.define "cent7_ansible" do |cent7_ansible|
    # Build Vagrant box based on CentOS 7
    cent7_ansible.vm.box = "centos/7"

    # Install ODL using the Ansible provisioner
    cent7_ansible.vm.provision "ansible" do |ansible|
      # Path to Ansible playbook that installs ODL using ODL's Ansible role
      ansible.playbook = "provisioning/playbook.yml"
    end
  end

Ansible

In detail...

Ansible

      ansible.playbook = "provisioning/playbook.yml"

Ansible

[~/vagrant-opendaylight]$ cat provisioning/playbook.yml
---
- hosts: all
  sudo: yes
  roles:
    - opendaylight

ansible

Provision the box

Ansible

[~/vagrant-opendaylight]$ vagrant up cent7_ansible

ansible

At a high level...

Ansible

In detail...

Ansible

TASK: [opendaylight | Add ODL yum repo] ********************************** 
changed: [cent7_ansible]
TASK: [opendaylight | Install ODL via RPM repo] **************************
changed: [cent7_ansible]

Ansible

TASK: [opendaylight | Check if FirewallD service is running] ************* 
ok: [cent7_ansible]
TASK: [opendaylight | Open ODL NB REST port via FirewallD] *************** 
skipping: [cent7_ansible]  

Ansible

TASK: [opendaylight | Start ODL systemd service] ************************* 
changed: [cent7_ansible]

Ansible

Explore

Ansible

[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible
[vagrant@localhost ~]$

Ansible

[vagrant@localhost ~]$ sudo systemctl is-active opendaylight
active

Ansible

Example: Config change

Ansible

[~/vagrant-opendaylight]$ cat provisioning/playbook.yml
---
- hosts: all
  sudo: yes
  roles:
    - role: opendaylight
      extra_features: ['odl-netvirt-openstack']

Ansible

[~/vagrant-opendaylight]$ vagrant provision cent7_ansible

ansible

At a high level...

Ansible

In detail...

Ansible

TASK: [opendaylight | Configure ODL Karaf features] ********************** 
changed: [cent7_ansible]

Ansible

NOTIFIED: [opendaylight | Stop ODL] ************************************** 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Cleanup Karaf] ********************************* 
changed: [cent7_ansible]

NOTIFIED: [opendaylight | Start ODL] ************************************* 
changed: [cent7_ansible]

Ansible

Explore

Ansible

[~/vagrant-opendaylight]$ vagrant ssh cent7_ansible

Ansible

[vagrant@localhost ~]$ sudo systemctl is-active opendaylight
active

Ansible

[vagrant@localhost ~]$ ssh -p 8101 karaf@localhost
# password "karaf"


Ansible


Ansible

opendaylight-user@root>feature:list | grep odl-netvirt-openstack
odl-netvirt-openstack | 0.3.0-Boron | x | <snip>

PROVISIONING VNFs with Ansible

TODO: Talk about what it would look like to manage VNF confg with Ansible

User Stories

TODO: Give examples of projects that use Ansible, walk though what they are doing and why it's good

Example: Ansible in Packer

TODO: Example of using Ansible with Packer to create VMs/containers

EXAMPLE: ANSIBLE as TUTORIAL

TODO: Example of using Ansible as Vagrant provisioner to give easy access (users, devs) to same deployment that will be used in production/similar

Contact

TODO

Incomplete: Automated Deployments with Ansible

By Daniel Farrell

Incomplete: Automated Deployments with Ansible

Talk given at CNCF Day 2017 in Beijing

  • 854
Loading comments...

More from Daniel Farrell