#ansible

carstenraddatz_fca@nerdica.net

My #Gentoo #linux #userstory in brief

Inspired by a post from 2019 by @know, here is my #linux #userstory in brief.

Back in early 2004 there was no #Ubuntu yet, and I was ready to go dualboot. So I started that journey with a #gentoo iso image because the documentation was excellent, verbose and taught you everything, so you knew what you were doing all along. I checked, the Gentoo Handbook still does this very well.

How rewarding a learning curve! 😁

The experience was so different from the S.u.S.E. ncurses-based installer that I had used once in 1998 or so, which hid everything behind menus and kinda put me off the idea. Pressing buttons doesn't teach you a thing, typing stuff after you understand what it'll do does. It was only upwards from then on.

Today I'm using setups closely following Sakaki's Installation Guide (https://wiki.gentoo.org/wiki/Sakaki%27sEFIInstall_Guide) on all my workstations with LVM, LUKS and GPG. Practically, today, the actual distribution used on a target system to configure, maintain and run does not matter much. Sadly, that set of Sakaki's instructions is not actively maintained any more.

With #ansible automation has gone far, and typed commands have been abstracted away for the most part. You declare what you want in playbooks, and whatever Gentoo, Ubuntu or #Debian have you is made to match the requirements. Hands-on commandline only gets you so far, won't scale to many hosts, and as much as clicking about a Windows UI to do stuff has limits at some point you'll be taking next steps. #Puppet, ansible, and #git are your friends. #Vagrant be useful still. You'll want to get to know them pretty soon if you haven't already.

So Gentoo initially gave me that joy of discovering technical details which make systems work. With the community on IRC and folks over at https://forums.gentoo.org/ you'll almost never hear "did you try turning it off and on again", but instead meet knowledgeable gentoo users who help you get to the bottom of it. Using gentoo means growth.

How was discovering your favourite distribution for you, and how have you been using it?

#linux #userstory #gentoo

rainerhgw@diasp.org

#servicepost
Tilde (~) does not expand to the user's home directory.
That does not work in #ansible's inventory:

[all:vars]
ansible_python_interpreter=/usr/bin/python
ansible_ssh_common_args="-F ~/.ssh/config.ansible"
[…]

That does work:

[all:vars]
ansible_python_interpreter=/usr/bin/python
ansible_ssh_common_args="-F {{ lookup('env', 'HOME') }}/.ssh/config.ansible"
[…]

rainerhgw@diasp.org

#Ansible #Debian

Ich habe ein Playbook zum Updaten. Ausschnitt:

- name: Upgrade all packages (Debian)
apt:
upgrade: dist
allow_change_held_packages: yes
update_cache: yes
autoremove: yes
when:
- ansible_facts['distribution'] == "Debian"

Meistens funktioniert das, aber nicht immer. Ansible läuft dennoch fehlerfrei durch. Dann bleibt der Host in Zabbix rot, und Zabbix meint, es gäbe Updates.
Das sieht dann so aus:

root@zabbix:~# apt update
[…]
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@zabbix:~# apt dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
apport dpkg dpkg-dev libdpkg-perl python3-apport python3-problem-report
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

Es funktioniert dann:

root@zabbix:~# apt -y dist-upgrade apport dpkg dpkg-dev libdpkg-perl python3-apport python3-problem-report
[…]
root@zabbix:~# echo $?
0

Ich würde das aber gerne Ansible erledigen lassen.
Weiß jemand, wie?

utzer@social.yl.ms

Ok, let's get into this #Ansible thing. Fresh #Debian #Linux, which Ansible playbooks (that is what they are called, right?) should I use?

I want to remove password of root, disable ssh login for root, create a user and add it to sudoers list (#sudo without password), add ssh key, disable login with password, set hostname, configure some DNS server on 127.0.0.1 and get the box to reboot.

Other useful things welcome.

utzer@social.yl.ms

Ich muss mich mal mit #Ansible beschäftigen, mag mir jemand helfen, ich habe eine paar #Tor Server (relays, bridges, exits) die jeweils eine bestimmte Konfig haben, jetzt will ich einfach skalieren und die Zahl der Server vermehren, aber das will ich nicht händisch machen.