<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Necrophcodr</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Necrophcodr"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Necrophcodr"/>
	<updated>2026-04-27T19:32:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Ansible&amp;diff=11373</id>
		<title>Ansible</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Ansible&amp;diff=11373"/>
		<updated>2015-11-04T09:24:47Z</updated>

		<summary type="html">&lt;p&gt;Necrophcodr: fix url&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://ansible.com/ 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 beside Python on client boxes is required.&lt;br /&gt;
&lt;br /&gt;
= Installation of ansible =&lt;br /&gt;
ansible is available in &#039;&#039;testing&#039;&#039;. The latest package is broken, sorry.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add ansible}}&lt;br /&gt;
&lt;br /&gt;
== Create a SSH key ==&lt;br /&gt;
Generate a SSH key for the managed node. It&#039;s recommended to use a key which is protected with a password.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|ssh-keygen -t rsa}}&lt;br /&gt;
&lt;br /&gt;
= Managed nodes =&lt;br /&gt;
There are only minimal requirements for the clients. For every system you want to manage, you need to have the client&#039;s SSH key in the &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt; file of the management system and Python.&lt;br /&gt;
&lt;br /&gt;
Install the Python package.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add python}}&lt;br /&gt;
&lt;br /&gt;
== Transfer the SSH key ==&lt;br /&gt;
There are two ways to do it. From a default Alpine installation you can use ssh and cat to do it.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;ssh root@[IP of the management system] &#039;cat ~/.ssh/id_rsa.pub&#039; | cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you are planning to use additional features of SSH. &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt;, which is provided by the &amp;lt;code&amp;gt;openssh-client&amp;lt;/code&amp;gt; package, can help you with the key setup. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|ssh-copy-id -i ~/.ssh/id_rsa.pub root@[IP of the management system]}}&lt;br /&gt;
&lt;br /&gt;
= Setup hosts =&lt;br /&gt;
Add all your remote systems to &amp;lt;code&amp;gt;/etc/ansible/hosts&amp;lt;/code&amp;gt;. For details, please refer to [http://ansible.cc/docs/patterns.html#hosts-and-groups Hosts and Groups] in the ansible documentation.&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/ansible/hosts|&lt;br /&gt;
192.168.1.50&lt;br /&gt;
10.0.0.12&lt;br /&gt;
webserver.example.org&lt;br /&gt;
mail.example.org}}&lt;br /&gt;
&lt;br /&gt;
= First test =&lt;br /&gt;
&lt;br /&gt;
{{Cmd|$ ansible all -m ping -u you --sudo}}&lt;br /&gt;
&lt;br /&gt;
Another test is check all variables.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# ansible [IP of your Alpine Linux box] -m setup}}&lt;br /&gt;
&lt;br /&gt;
= Playbooks =&lt;br /&gt;
When writing playbooks for Alpine Linux there are some issues:&lt;br /&gt;
&lt;br /&gt;
# There is basic support for APK by Ansible. But the following will always work {{Cmd|action: command /sbin/apk add lighttpd}}&lt;br /&gt;
# Same with the OpenRC, the [[Alpine_Linux_Init_System|Init System]] {{Cmd|action: command /etc/init.d/lighttpd start}}&lt;br /&gt;
# If you are going to re-use playbooks from other Linux distribution, please keep in mind that Alpine Linux uses different paths for the binaries. &amp;lt;code&amp;gt;/bin/rm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [http://git.alpinelinux.org/cgit/fab/alpine-ansible/ alpine-ansible git repository] contain some example playbooks. &lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Necrophcodr</name></author>
	</entry>
</feed>