技術討論區 > DevOps 討論版
Ansible install with openSUSE 13.2 and Mac 小記
(1/1)
sakana:
原文 http://sakananote2.blogspot.com/2015/10/ansible-install-with-opensuse-132-and.html
最近因為工作的關係開始接觸 Ansible
Ansible 是利用 SSH 來進行環境部署的工具, 以 python 為基礎, 其他常見的工具有 Puppet / Chef / Salt.
先把相關的資源整理上來 Online resource
Documentation
http://docs.ansible.com/
Ansible module index
http://docs.ansible.com/ansible/modules_by_category.html
Ansible Galaxy
https://galaxy.ansible.com/
Repository of Ansible roles contributed by the community
Ansible Project Google Group
https://groups.google.com/forum/#!forum/ansible-project
The place to go if you have any questions about Ansible
IRC
#ansible on irc.freenode.net
目前研讀的是 Oreilly - Ansible up & running
code example 在
https://github.com/lorin/ansiblebook
看一些時間了, 雖然目前只有看完 Chapter 3 但是先整理一些資料出來
先來提 安裝 Ansible
安裝 Ansible
http://docs.ansible.com/ansible/intro_installation.html
Mac OS 我是利用 pip 安裝
$ sudo easy_install pip
$ sudo pip install ansible
openSUSE 13.2 的部分( 目前應該大部份的 linux 都可以直接安裝 ansible )
查詢套件
# zypper search ansible
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
--+---------+--------------------------------------------------------------------------+-----------
| ansible | SSH-based configuration management, deployment, and orchestration engine | package
| ansible | SSH-based configuration management, deployment, and orchestration engine | srcpackage
安裝 Ansible
# zypper install -y ansible
這樣就大功告成了
真正要裝套件的只有 Control Machine, 被部署的機器是不用安裝套件的 ( Clientless ), 這點應該是與 puppet 或是其他的工具最大的差異.
所以主要的角色有
控制端 The control machine
The one that you use to control remote machines
needs to have python 2.6 or later installed.
遠端機器 To manage a server with Ansible
Needs to have SSH and Python 2.5 or later installed.
基本上目前大部份的 linux 都有 SSH 以及 python 2.5 以上 ( 我觀察是 2.7 ), 所以這也是說不用裝套件的原因
那要使用 Ansible 要有那些先備知識會比較好呢? ( 從書上整理來的 ^^ )
主要是 會使用 SSH 指令連接遠端的機器, 知道如何使用 ssh key 免密碼的方式連接遠端主機, 知道 sudo 是啥 ^^
What do I need to know?
Connect to a remote machine using SSH.
Interact with the bash command-line shell (pipes and redirection).
Install packages.
Use the sudo command.
Check and set file permissions.
Start and stop services.
Set environment variables.
Write scripts ( Any language )
You don't need to know python to use Ansible unless you want to write your own module.
You will need to learn some YAML and Jinja2 to use Ansible.
今天就先這樣, 下次來整理簡單的 Ansible 指令
~ enjoy it
導覽
[0] 文章列表
前往完整版本