<?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=Yjftsjthsd-a</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=Yjftsjthsd-a"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Yjftsjthsd-a"/>
	<updated>2026-04-29T09:53:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Talk:Enable_Serial_Console_on_Boot&amp;diff=22156</id>
		<title>Talk:Enable Serial Console on Boot</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Talk:Enable_Serial_Console_on_Boot&amp;diff=22156"/>
		<updated>2022-07-30T02:56:43Z</updated>

		<summary type="html">&lt;p&gt;Yjftsjthsd-a: note working alpine version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is this information obsolete? The last susbtantive edit was in 20 October 2010 and the page says it applies to Alpine 1.10.x. I&#039;m not sure what a &amp;quot;serial console&amp;quot; is---different from a normal tty? In practice when are they used?&lt;br /&gt;
-- [[User:Dubiousjim|Dubiousjim]] 10:01, 25 March 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
This still works fine with Alpine 2.3.6.  It&#039;s used in practice if a KVM is not available for a given server/router running Alpine.  In that case, connecting a set of Alpine boxes and other devices (such as switches or routers) to a serial console server can be a practical way to maintain console access.&lt;br /&gt;
[[User:Jbilyk|Jbilyk]] 22:45, 13 April 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone has more insight to serial &amp;amp; extlinux magic:&lt;br /&gt;
What I&#039;d love to have is something similar to the way AIX or Oracle VM had it:&lt;br /&gt;
At bootloader time, issue a &amp;quot;press a key to activate this console&amp;quot; on vga and serial.&lt;br /&gt;
Whatever is then used, gets the menu, and will then be the kernel console.&lt;br /&gt;
&lt;br /&gt;
[[User:Darkfader|Darkfader]] ([[User talk:Darkfader|talk]]) 13:12, 24 November 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
we also need to extend it to reflect xen console stuff, so one sees the xen boot and also gets dom0 on the right tty.&lt;br /&gt;
I&#039;ll add it if I manage to configure it ;))&lt;br /&gt;
[[User:Darkfader|Darkfader]] ([[User talk:Darkfader|talk]]) 13:50, 24 November 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This all still works as of 2022 with Alpine 3.16. In fact, the current generation of &amp;quot;virt&amp;quot; ISOs from the download page ship with the serial configuration enabled by default, so you can just boot them and log in over serial and everything works.&lt;br /&gt;
[[User:Yjftsjthsd-a|Yjftsjthsd-a]] ([[User talk:Yjftsjthsd-a|talk]]) 02:56, 30 July 2022 (UTC)&lt;/div&gt;</summary>
		<author><name>Yjftsjthsd-a</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Talk:Enable_Serial_Console_on_Boot&amp;diff=22155</id>
		<title>Talk:Enable Serial Console on Boot</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Talk:Enable_Serial_Console_on_Boot&amp;diff=22155"/>
		<updated>2022-07-30T02:56:17Z</updated>

		<summary type="html">&lt;p&gt;Yjftsjthsd-a: note that this is still live in 2022&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is this information obsolete? The last susbtantive edit was in 20 October 2010 and the page says it applies to Alpine 1.10.x. I&#039;m not sure what a &amp;quot;serial console&amp;quot; is---different from a normal tty? In practice when are they used?&lt;br /&gt;
-- [[User:Dubiousjim|Dubiousjim]] 10:01, 25 March 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
This still works fine with Alpine 2.3.6.  It&#039;s used in practice if a KVM is not available for a given server/router running Alpine.  In that case, connecting a set of Alpine boxes and other devices (such as switches or routers) to a serial console server can be a practical way to maintain console access.&lt;br /&gt;
[[User:Jbilyk|Jbilyk]] 22:45, 13 April 2012 (EST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone has more insight to serial &amp;amp; extlinux magic:&lt;br /&gt;
What I&#039;d love to have is something similar to the way AIX or Oracle VM had it:&lt;br /&gt;
At bootloader time, issue a &amp;quot;press a key to activate this console&amp;quot; on vga and serial.&lt;br /&gt;
Whatever is then used, gets the menu, and will then be the kernel console.&lt;br /&gt;
&lt;br /&gt;
[[User:Darkfader|Darkfader]] ([[User talk:Darkfader|talk]]) 13:12, 24 November 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
we also need to extend it to reflect xen console stuff, so one sees the xen boot and also gets dom0 on the right tty.&lt;br /&gt;
I&#039;ll add it if I manage to configure it ;))&lt;br /&gt;
[[User:Darkfader|Darkfader]] ([[User talk:Darkfader|talk]]) 13:50, 24 November 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This all still works as of 2022. In fact, the current generation of &amp;quot;virt&amp;quot; ISOs from the download page ship with the serial configuration enabled by default, so you can just boot them and log in over serial and everything works.&lt;br /&gt;
[[User:Yjftsjthsd-a|Yjftsjthsd-a]] ([[User talk:Yjftsjthsd-a|talk]]) 02:56, 30 July 2022 (UTC)&lt;/div&gt;</summary>
		<author><name>Yjftsjthsd-a</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Enable_Serial_Console_on_Boot&amp;diff=22154</id>
		<title>Enable Serial Console on Boot</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Enable_Serial_Console_on_Boot&amp;diff=22154"/>
		<updated>2022-07-30T02:53:46Z</updated>

		<summary type="html">&lt;p&gt;Yjftsjthsd-a: document using serial console with qemu&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syslinux / Extlinux==&lt;br /&gt;
=== How to Enable the Serial Console on Boot (1.10.x)===&lt;br /&gt;
&lt;br /&gt;
When using syslinux to boot, you&#039;ll need to modify the syslinux.cfg file in the root directory of the boot device. If using a disk-based Alpine, modify the /boot/extlinux.cfg file.&lt;br /&gt;
&lt;br /&gt;
Add the following:&lt;br /&gt;
* &amp;lt;tt&amp;gt;serial 0 9600&amp;lt;/tt&amp;gt;&lt;br /&gt;
* add &amp;lt;tt&amp;gt;console=ttyS0,9600&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;append&amp;lt;/tt&amp;gt; parameter&lt;br /&gt;
* optionally, remove &amp;lt;tt&amp;gt;quiet&amp;lt;/tt&amp;gt; from the &amp;lt;tt&amp;gt;append &amp;lt;/tt&amp;gt; parameter&lt;br /&gt;
&lt;br /&gt;
==== Example syslinux.cfg ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
serial 0 9600&lt;br /&gt;
timeout 20&lt;br /&gt;
prompt 1&lt;br /&gt;
default grsec&lt;br /&gt;
label grsec&lt;br /&gt;
        kernel /boot/grsec&lt;br /&gt;
        append initrd=/boot/grsec.gz alpine_dev=sda1:vfat modules=sd-mod,usb-storage console=ttyS0,9600&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== extlinux.conf (3.0+)===&lt;br /&gt;
&lt;br /&gt;
The /etc/update-extlinux.conf is read by the update-extlinux utility.&lt;br /&gt;
&lt;br /&gt;
To do so, change the default entry:&lt;br /&gt;
&amp;lt;pre&amp;gt;default_kernel_opts=&amp;quot;quiet&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
to read like this:           &lt;br /&gt;
&amp;lt;pre&amp;gt;default_kernel_opts=&amp;quot;console=ttyS0,9600 quiet&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the serial port and baud rate to match the default_kernel_opts line above:&lt;br /&gt;
&amp;lt;pre&amp;gt;serial_port=0&lt;br /&gt;
serial_baud=9600&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Xen ====&lt;br /&gt;
&lt;br /&gt;
Notice, if you want to use this for a Xen VM,&lt;br /&gt;
you need to configure the speed at &#039;&#039;&#039;115200&#039;&#039;&#039; bps and enable the &lt;br /&gt;
&amp;lt;pre&amp;gt;serial=&amp;quot;pty&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
setting in the VM config file.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Xen can be configured to use and log to a serial console by editing /etc/update-extlinux.conf to include the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
default_kernel_opts=&amp;quot;console=hvc0 earlyprintk=xen nomodeset&amp;quot;&lt;br /&gt;
xen_opts=&amp;quot;dom0_mem=256M com1=115200,8n1 console=com1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the [http://wiki.xen.org/wiki/Xen_Serial_Console Xen wiki] for more details.&lt;br /&gt;
&lt;br /&gt;
==== qemu ====&lt;br /&gt;
&lt;br /&gt;
Like Xen, qemu should run at speed 115200.&lt;br /&gt;
&lt;br /&gt;
Conveniently, the alpine &amp;quot;virt&amp;quot; image (but not the &amp;quot;standard&amp;quot; image) comes with this all configured on the default ISO.&lt;br /&gt;
&lt;br /&gt;
Sample command to run qemu on alpine-virt with a serial console:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-system-x86_64 -accel kvm -cdrom alpine-virt-3.16.0-x86_64.iso -display none -chardev stdio,id=char0,logfile=serial.log,signal=off -serial chardev:char0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that this example command uses the logfile option to log the output of the serial console; you can remove this if you don&#039;t need it.&lt;br /&gt;
&lt;br /&gt;
==== Example /boot/extlinux.conf ====&lt;br /&gt;
&lt;br /&gt;
This is a complete file, written by the update-extlinux command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEFAULT menu.c32&lt;br /&gt;
PROMPT 0&lt;br /&gt;
MENU TITLE Alpine/Linux Boot Menu&lt;br /&gt;
MENU AUTOBOOT Alpine will be booted automatically in # seconds.&lt;br /&gt;
SERIAL 0 9600&lt;br /&gt;
TIMEOUT 100&lt;br /&gt;
LABEL grsec&lt;br /&gt;
  MENU DEFAULT&lt;br /&gt;
  MENU LABEL Linux 3.10.33-0-grsec&lt;br /&gt;
  LINUX vmlinuz-3.10.33-0-grsec&lt;br /&gt;
  INITRD initramfs-3.10.33-0-grsec&lt;br /&gt;
  APPEND root=UUID=re-mov-ed-uu-id modules=sd-mod,usb-storage,ext4 console=ttyS0,9600&lt;br /&gt;
&lt;br /&gt;
MENU SEPARATOR&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please: adjust the tty speed to 115200 if needed (Xen/qemu!!).&lt;br /&gt;
&lt;br /&gt;
The timeout is given in deciseconds, so this would be a 10 second timeout.[https://wiki.syslinux.org/wiki/index.php?title=Config#TIMEOUT] A timeout of 0 does not boot without delay, but rather waits indefinitely for the user.&lt;br /&gt;
&lt;br /&gt;
If the file is read by pygrub, the same value is interpreted as seconds, resulting in a 100s bootup delay per VM.&lt;br /&gt;
&lt;br /&gt;
==Grub==&lt;br /&gt;
If you&#039;re using Grub as your bootloader, follow this section.&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/etc/default/grub&amp;lt;/tt&amp;gt; and add the following lines (assuming you&#039;re using the first serial port at 115200 baud rate):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GRUB_TERMINAL=&amp;quot;serial console&amp;quot;&lt;br /&gt;
GRUB_SERIAL_COMMAND=&amp;quot;serial --unit=0 --word=8 --parity=no --speed 115200 --stop=1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also add &amp;lt;tt&amp;gt;console=ttyS0,115200n8d&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;GRUB_CMDLINE_LINUX_DEFAULT&amp;lt;/tt&amp;gt; variable&lt;br /&gt;
&lt;br /&gt;
Your &amp;lt;tt&amp;gt;/etc/default/grub&amp;lt;/tt&amp;gt; should now look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GRUB_TIMEOUT=2&lt;br /&gt;
GRUB_DISABLE_SUBMENU=y&lt;br /&gt;
GRUB_DISABLE_RECOVERY=true&lt;br /&gt;
GRUB_CMDLINE_LINUX_DEFAULT=&amp;quot;console=tty0 console=ttyS0,115200n8d modules=sd-mod,usb-storage,xfs quiet rootfstype=xfs&amp;quot;&lt;br /&gt;
GRUB_TERMINAL=&amp;quot;serial console&amp;quot;&lt;br /&gt;
GRUB_SERIAL_COMMAND=&amp;quot;serial --unit=0 --word=8 --parity=no --speed 115200 --stop=1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, regenerate your grub.cfg with the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
grub-mkconfig -o /boot/grub/grub.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Follow the final 2 steps below: &amp;lt;tt&amp;gt;Enabling a login console&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Add your serial console to the trusted local terminal list&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enabling a login console ==&lt;br /&gt;
&lt;br /&gt;
This is done in /etc/inittab. There is commented entry for ttyS0. Just enable it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Put a getty on the serial port&lt;br /&gt;
ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the getty, restart init:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
kill -HUP 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enabling two consoles during boot ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to output to both the serial and vga console during the system boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
append &amp;quot;quiet console=ttyS0,9600 console=tty0&amp;quot;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not known how to do the same thing in the extlinux menu. &lt;br /&gt;
You might find a starting point in this thread: http://patchwork.openembedded.org/patch/45175/&lt;br /&gt;
&lt;br /&gt;
== Add your serial console to the trusted local terminal list ==&lt;br /&gt;
If you face the problem that the login prompt always refuses your password when you use serial console, you missed this entry.&lt;br /&gt;
&lt;br /&gt;
Add this to the &amp;lt;tt&amp;gt;/etc/securetty&amp;lt;/tt&amp;gt; file:   &lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
ttyS0&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Yjftsjthsd-a</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Ansible&amp;diff=16804</id>
		<title>Ansible</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Ansible&amp;diff=16804"/>
		<updated>2020-01-26T02:05:06Z</updated>

		<summary type="html">&lt;p&gt;Yjftsjthsd-a: /* First test */&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;main&#039;&#039;.&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 ed25519}}&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 python3}}&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_ed25519.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_ed25519.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 [https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.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}}&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 modules to keep in mind:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for OpenRC, the [[Alpine_Linux_Init_System|Init System]], in the service module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- service:&lt;br /&gt;
   name: lighttpd&lt;br /&gt;
   enabled: yes&lt;br /&gt;
   state: started&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for [[Alpine_Linux_package_management|APK]] as of Ansible 2.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- apk:&lt;br /&gt;
   name: lighttpd&lt;br /&gt;
   state: present&lt;br /&gt;
   update_cache: yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for the [[Alpine_Wall|Awall]] firewall as of Ansible 2.4.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- awall:&lt;br /&gt;
   name: policyfile&lt;br /&gt;
   state: enabled&lt;br /&gt;
   activate: yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;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;
&amp;lt;/ol&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;
=See Also=&lt;br /&gt;
*[[Ansible APK Module]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Yjftsjthsd-a</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Ansible&amp;diff=16803</id>
		<title>Ansible</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Ansible&amp;diff=16803"/>
		<updated>2020-01-26T02:04:04Z</updated>

		<summary type="html">&lt;p&gt;Yjftsjthsd-a: /* Managed nodes */&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;main&#039;&#039;.&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 ed25519}}&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 python3}}&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_ed25519.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_ed25519.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 [https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.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 modules to keep in mind:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for OpenRC, the [[Alpine_Linux_Init_System|Init System]], in the service module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- service:&lt;br /&gt;
   name: lighttpd&lt;br /&gt;
   enabled: yes&lt;br /&gt;
   state: started&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for [[Alpine_Linux_package_management|APK]] as of Ansible 2.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- apk:&lt;br /&gt;
   name: lighttpd&lt;br /&gt;
   state: present&lt;br /&gt;
   update_cache: yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for the [[Alpine_Wall|Awall]] firewall as of Ansible 2.4.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- awall:&lt;br /&gt;
   name: policyfile&lt;br /&gt;
   state: enabled&lt;br /&gt;
   activate: yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;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;
&amp;lt;/ol&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;
=See Also=&lt;br /&gt;
*[[Ansible APK Module]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Yjftsjthsd-a</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Ansible&amp;diff=16802</id>
		<title>Ansible</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Ansible&amp;diff=16802"/>
		<updated>2020-01-26T02:02:30Z</updated>

		<summary type="html">&lt;p&gt;Yjftsjthsd-a: /* Installation of ansible */&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;main&#039;&#039;.&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 ed25519}}&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 [https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.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 modules to keep in mind:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for OpenRC, the [[Alpine_Linux_Init_System|Init System]], in the service module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- service:&lt;br /&gt;
   name: lighttpd&lt;br /&gt;
   enabled: yes&lt;br /&gt;
   state: started&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for [[Alpine_Linux_package_management|APK]] as of Ansible 2.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- apk:&lt;br /&gt;
   name: lighttpd&lt;br /&gt;
   state: present&lt;br /&gt;
   update_cache: yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;There is support for the [[Alpine_Wall|Awall]] firewall as of Ansible 2.4.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- awall:&lt;br /&gt;
   name: policyfile&lt;br /&gt;
   state: enabled&lt;br /&gt;
   activate: yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;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;
&amp;lt;/ol&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;
=See Also=&lt;br /&gt;
*[[Ansible APK Module]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Yjftsjthsd-a</name></author>
	</entry>
</feed>