Skip to content

tnaganawa/ansible-collections-tungstenfabric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-collections-tungstenfabric

ansible module for tungstenfabric

Install

cd
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install ansible requests
yum install -y git


ansible-galaxy collection install git+https://github.com/tnaganawa/ansible-collections-tungstenfabric.git
 or
git clone https://github.com/tnaganawa/ansible-collections-tungstenfabric.git
mkdir -p ~/.ansible/collections/ansible_collections/tungstenfabric/networking/
mv -i ansible-collections-tungstenfabric/plugins/ ~/.ansible/collections/ansible_collections/tungstenfabric/networking/
  • For ansible collentions to work, ansible 2.9 or later is required.

from CLI

create:
ansible -m tungstenfabric.networking.virtual_network localhost -a 'name=vn1 controller_ip=x.x.x.x state=present'

update:
ansible -m tungstenfabric.networking.virtual_network localhost -a 'name=vn1 controller_ip=x.x.x.x state=present subnet=10.0.1.0 subnet_prefix=24'

delete:
ansible -m tungstenfabric.networking.virtual_network localhost -a 'name=vn1 controller_ip=x.x.x.x state=absent'

from playbook

# cat virtual-port-group.yaml
- name: create vpg
  hosts: localhost
  gather_facts: false
  tasks:
  - name: create vpg
    tungstenfabric.networking.virtual_port_group:
      name: vpg1
      controller_ip: x.x.x.x
      state: present
      fabric: fabric1
      physical_interfaces:
        - [leaf1, xe-0/0/9]
        - [leaf2, xe-0/0/9]

# cat bms_vmi.yaml
- name: add vn vlan pair
  hosts: localhost
  gather_facts: false
  tasks:
  - name: add vn vlan pair
    tungstenfabric.networking.bms_vmi:
      controller_ip: x.x.x.x
      state: present
      fabric: fabric1
      vpg_vn_vlan_list:
       - [vpg1, vn111, 111]
       - [vpg1, vn112, 112]

# ansible-playbook -i localhost virtual-port-group.yaml
# ansible-playbook -i localhost bms_vmi.yaml

When keystone is used

This playbook will use environment variables for keystone access, such as OS_AUTH_URL.

# source /etc/kolla/kolla-toolbox/admin-openrc.sh

About

ansible module for tungstenfabric

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages