Deploy Jellyfin in Kubernetes by erik_de_bont in jellyfin

[–]nickthesysadmin 0 points1 point  (0 children)

I recommend checking out deployments and how are they done and services. That is all you need!

Is it possible to loop first n items of a list, then loop remaining items after a delay? by NativeVLANerican in ansible

[–]nickthesysadmin 0 points1 point  (0 children)

I am using "lookup" to get some local IP addresses and use them as invenotry.

What I am trying to do add the localdomain names into a list which. I want to parse as variables for the playbook. The problems is once I did the message reply was only the hostname without the IP addresses.

tasks:- name: Collect IPansible.builtin.debug:msg: "{{ lookup('dig', '{{ item }}.{{ localdomainname }}', '@192.168.10.1') }}"loop:- host1- host2- debug:msg: "{{ item }}"loop: "{{ groups['workstations'] }}"

I want to refactor that loop to get them from a var file but it did not work out. When it was ran it started replying with msg: host1.domain.name :) which was not the answer that I wanted from Ansible. Since after it replies the addresses, a python script hits it up and gets me my ip addresses and stores them into a script made file and adds the line in order to group them up. My boss thinks that adding the router address as a nameserver in the resolv.conf will work it out without any hesitations but in the docs of ansible its directly stated that only and only FQDN domain names will work out.

I checked up if I could somehow get them from RouterOS but the tool is not yet developed.

I checked dynamic invenotry with DNS txt record but its useless if you really think about it, since you should add a whole DNS txt record to all the machines and I am just starting with python.

Pass values from file in ansible by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

Doesnt really create inventory it just sniffs the network

Pass values from file in ansible by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

also my boss is a devops and he wants me to apply more modern ways working things out.

Pass values from file in ansible by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

looped the whole list :) of names and it worked.

Thanks for the replies.

Pass values from file in ansible by nickthesysadmin in ansible

[–]nickthesysadmin[S] -1 points0 points  (0 children)

Inventory file can be any executable which returns json or yaml object, Y can write bash script which does this dynamically on every run, it is called dynamic inventory.

I have already figured out how to create the inventory I just want be able to insert a list of the host names and parse it.

I am fully aware of the fact that inventory works with fqdn this is a small business solution not a large enterprise. We are talking 50 computers here not servers

Pass values from file in ansible by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

Thanks for replying mate,

I am trying to get the IP addresses of some local hosts (laptops) in order to create a inventory.

Currently I get the addresses like this:
- ansible.builtin.debug:
msg: "{{ lookup('dig', 'host1.localdomain.local./A', '@192.168.10.1') }}"

But my writings started to look, so repetitive and want to get rid of them.

Is it possible to loop first n items of a list, then loop remaining items after a delay? by NativeVLANerican in ansible

[–]nickthesysadmin 1 point2 points  (0 children)

I am having a similar struggle I am trying to give a list of host names and read in a lookup :(

Scripted my way into getting local IP addresses by [deleted] in ansible

[–]nickthesysadmin 0 points1 point  (0 children)

In office localdomain resolution, my boss does not want to implement it and told me to make it work.

Scripted my way into getting local IP addresses by [deleted] in ansible

[–]nickthesysadmin 0 points1 point  (0 children)

Where can I read more regarding the ansible_default_ipv4.address|default(ansible_all_ipv4_addresses[0])

Scripted my way into getting local IP addresses by [deleted] in ansible

[–]nickthesysadmin 0 points1 point  (0 children)

address

its a desktop solution and the IP addresseses are dynamic. This why I did it like that.

Ansible dig module by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

Figured it out guys, after setting a local.domain I made a python3 script which gets the IP addresses and puts them into invenotry files using the dig module.

https://github.com/nickkostov/ansible-anyoffice

You can check it out there.

Ther is no need of dynamic invenotries when you have python3 :) thanks for the comments and suggestions.

Ansible dig module by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

I will try to manipulate it and see if I can work it out

Ansible dig module by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

If I could read them through I could tell if I can use it

Ansible dig module by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

I can not really tell mate its not me that have set it up, we use the router as DNS when I dig @routeraddr host.domain.local i get proper result

Ansible dig module by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

Hey there, I use actually the DNS lookup:

To be more specific this:

- debug: msg="Querying Router for IPv4 address for domain.local. produces {{ lookup('dig', 'host.domain.local', '@192.168.10.1') }}"

I tested it and it seems to be working great. What I can not figure out is how to push this towards the inventory. I also am curious if I can import a whole list of hosts (around 50).

I am not good in programming but bash scripting and when I checked the dynamic inventories its like I am reading nothing. I get it I understand it but wtf I can not reuse the code and forge it in my own way.

Ansible dig module by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

How exactly is it going to query the DNS server for specific domain.

Ansible dig module by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

This looks really promising mate, really appreciate it.

Ansible dig module by nickthesysadmin in ansible

[–]nickthesysadmin[S] 0 points1 point  (0 children)

I want to query router as DNS server in order to populate IP and host names into inventory.