狠狠撸

狠狠撸Share a Scribd company logo
Ansible Module Topic
2017/3/31
TIS OSS 推進室
倉持健史
Ansible とは、
『 オートメーション(自動化)することができるソフトウェア 』
3つの特徴
Simple
Powerful
Agentless
Source : https://www.ansible.com/it-automation
Ansible の適用範囲
自動化出来るのは
サーバだけじゃない!
エンタープライズ志向なAnsible
? ネットワーク機器 の対応
Cisco、Juniper、F5、A10、???
? ストレージ機器 の対応
NetApp、INFINIDAT
? Windows の対応
? クラウド の対応
? Docker の対応
Source: docs.ansible.com
Author
? Sumit Kumar
? timuster(https://github.com/timuster)
? TME(テクニカルマーケティングエンジニア)
? NetApp, Inc. 所属
Requirement for NetApp cDOT Modules
? Ansible version
? v2.3(RC2)
? Python module
? netapp-lib(2015.9.25 <)
? latest version: 2016.10.14
? Target Storage OS version
? clustered DataONTAP 8.3
? Status
? preview
Readiness
# git clone git://github.com/ansible/ansible.git
# cd ansible/
# git checkout stable-2.3
# source ./hacking/env-setup
# ansible --version
ansible 2.3.0.0 (stable-2.3 af83d4d4df) last updated 2017/03/30 15:16:14 (GMT +900)
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.5 (default, Nov 20 2015, 02:00:19) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
# pip install netapp-lib
Playbook
---
- name: Test Playbook for NetApp cDOT Modules
hosts: localhost
gather_facts: no
vars:
netapp_hostname: 192.168.175.206
netapp_username: "admin"
netapp_password: “PASSWORD"
mysvm: "my_SVM"
svm_root_vol: "root_v01“
tasks:
- name: create SVM
na_cdot_svm:
state: present
name: "{{ mysvm }}"
root_volume: "{{ svm_root_vol }}"
root_volume_aggregate: "itc_aggr02"
root_volume_security_style: mixed
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
tags: CREATE
Before
Console :
Clustered Data ONTAP
Run Playbook
# ansible-playbook -i hosts playbook.yml -t CREATE
PLAY [Test Playbook for NetApp cDOT Modules]
**
TASK [create SVM]
**
changed: [localhost]
PLAY RECAP
**
localhost : ok=1 changed=1 unreachable=0 failed=0
After
Console :
Clustered Data ONTAP
Playbook (cont.)
- block:
- name: before destroy SVM make root vol offline
na_cdot_volume:
state: absent
name: "{{ svm_root_vol }}"
vserver: "{{ mysvm }}"
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: destroy SVM
na_cdot_svm:
state: absent
name: "{{ mysvm }}"
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
tags: DESTROY
References
? Roadmap
Core 2.3 Target: Mid April 2017
https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_3.rst
? Sample Playbook
https://github.com/timuster/netapp_ansible_playbooks
Ansible Module Topic

More Related Content

Ansible Module Topic