IRC chat logs for #ltsp on (webchat)

Channel log from 28 September 2019   (all times are UTC)

00:14vagrantc has left IRC (vagrantc!~vagrant@unaffiliated/vagrantc, Quit: leaving)
02:08ZAJDAN has left IRC (ZAJDAN!~zdenek@, Ping timeout: 245 seconds)
02:43book` has joined IRC (book`!~book`
02:43book`_ has left IRC (book`_!~book`, Ping timeout: 265 seconds)
04:42adrianor1 has joined IRC (adrianor1!
04:45adrianorg has left IRC (adrianorg!~adrianorg@, Ping timeout: 268 seconds)
05:00kjackal has left IRC (kjackal!, Ping timeout: 240 seconds)
05:33woernie has joined IRC (woernie!
uumas, my scripts are idempotent too, so that part doesn't worry me. But here's a more in-depth question: suppose that my script wants to restart the ssh service, which in debian is called `systemctl restart openssh-server` and in fedora is called `systemctl restart sshd`.
This isn't a real example, it's a fictional one, I don't know if they indeed have different names.
So, in my script, I'd have to check which of these services exist, to restart the appropriate one
How does ansible users cope with that? Does it have "common names for all services", or you still have to write distro-specific code?
06:20kjackal has joined IRC (kjackal!~quassel@2a02:587:3107:2e00:e987:af3f:69ef:3a49)
06:25ZAJDAN has joined IRC (ZAJDAN!~zdenek@
06:36ricotz has joined IRC (ricotz!~ricotz@ubuntu/member/ricotz)
07:29kjackal has left IRC (kjackal!~quassel@2a02:587:3107:2e00:e987:af3f:69ef:3a49, Ping timeout: 276 seconds)
09:08statler has joined IRC (statler!
alkisg: You can have distro-specific variables in your role's `vars` directory. Then you can load the correct ones. Here's an example:
For a simpler example, you could just do include_vars: "{{ ansible_distribution }}"
alkisg: generally speaking ansible has abstractions for this kind of thing, and you feed them with overrides. Very often though roles target a specific distro subset (e.g. debian based) where this is a non-issue
I do not like some aspects of ansible's design but in practice it's a great tool
Well if *I* am going to write the distro-specific code anyway, I don't see where ansible helps...
It doesn't make my code smaller, it just makes me read a whole new way to do my self the things again
alkisg: it operates on a higher level of abstraction and is specifically designed to manipulate remote hosts
essentially it compiles and uploads python scripts and executes them on the remote
it is not perfectly idempotent nor can it acquire existing state of the machine like puppet can but for system administration it is certainly great
10:18kjackal has joined IRC (kjackal!~quassel@2a02:587:3107:2e00:e987:af3f:69ef:3a49)
14:11kjackal has left IRC (kjackal!~quassel@2a02:587:3107:2e00:e987:af3f:69ef:3a49, Ping timeout: 276 seconds)
18:57woernie has left IRC (woernie!, Remote host closed the connection)
20:27statler has left IRC (statler!, Remote host closed the connection)
21:08vagrantc has joined IRC (vagrantc!~vagrant@unaffiliated/vagrantc)
21:37ricotz has left IRC (ricotz!~ricotz@ubuntu/member/ricotz, Quit: Leaving)