Ansible: Difference between revisions

From Alpine Linux
No edit summary
No edit summary
Line 2: Line 2:


= Installation of ansible =
= Installation of ansible =
ansible is available in ''testing''.


{{Cmd|apk add ansible -U -X http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted}}
{{Cmd|apk add ansible -U -X http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted}}


= Setup =
= Setup SSH =
 
== SSH ==
For every system you want to manage, you need to have the SSH key in the <code>authorized_keys</code> file of the target system.
For every system you want to manage, you need to have the SSH key in the <code>authorized_keys</code> file of the target system.


{{Cmd|ssh-copy-id -i ~/.ssh/id_rsa.pub root@[IP of the target system]}}
{{Cmd|ssh-copy-id -i ~/.ssh/id_rsa.pub root@[IP of the target system]}}


== hosts ==
= Setup hosts =
Add all your remote systems to <code>/etc/ansible/hosts</code>. For details, please refer to [http://ansible.cc/docs/patterns.html#hosts-and-groups Hosts and Groups] in the ansible documentation.
Add all your remote systems to <code>/etc/ansible/hosts</code>. For details, please refer to [http://ansible.cc/docs/patterns.html#hosts-and-groups Hosts and Groups] in the ansible documentation.


Line 20: Line 19:
webserver.example.org
webserver.example.org
mail.example.org}}
mail.example.org}}
= First test =
{{Cat|$ ansible all -m ping -u you --sudo}}

Revision as of 09:46, 22 January 2013

ansible is a simple configuration management, deployment, task-execution, and multinode orchestration framework. It uses SSH for the communication between the involved systems, no server or client daemons are needed, and no additional software on client boxes is required.

Installation of ansible

ansible is available in testing.

apk add ansible -U -X http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted

Setup SSH

For every system you want to manage, you need to have the SSH key in the authorized_keys file of the target system.

ssh-copy-id -i ~/.ssh/id_rsa.pub root@[IP of the target system]

Setup hosts

Add all your remote systems to /etc/ansible/hosts. For details, please refer to Hosts and Groups in the ansible documentation.

Contents of /etc/ansible/hosts

192.168.1.50 10.0.0.12 webserver.example.org mail.example.org

First test

Contents of $ ansible all -m ping -u you --sudo

{{{2}}}