Upload
takeshi-kuramochi
View
189
Download
0
Embed Size (px)
Citation preview
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 --versionansible 2.3.0.0 (stable-2.3 af83d4d4df) last updated 2017/03/30 15:16:14 (GMT +900)config file = /etc/ansible/ansible.cfgconfigured module search path = Default w/o overridespython 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 Moduleshosts: localhostgather_facts: no
vars:netapp_hostname: 192.168.175.206netapp_username: "admin"netapp_password: “PASSWORD"mysvm: "my_SVM"svm_root_vol: "root_v01“
tasks:- name: create SVMna_cdot_svm:state: presentname: "{{ mysvm }}"root_volume: "{{ svm_root_vol }}"root_volume_aggregate: "itc_aggr02"root_volume_security_style: mixedhostname: "{{ 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 offlinena_cdot_volume:state: absentname: "{{ svm_root_vol }}"vserver: "{{ mysvm }}"hostname: "{{ netapp_hostname }}"username: "{{ netapp_username }}"password: "{{ netapp_password }}"
- name: destroy SVMna_cdot_svm:state: absentname: "{{ mysvm }}"hostname: "{{ netapp_hostname }}"username: "{{ netapp_username }}"password: "{{ netapp_password }}"
tags: DESTROY
References
Roadmap
Core 2.3 Target: Mid April 2017https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_3.rst
Sample Playbook
https://github.com/timuster/netapp_ansible_playbooks