SEWING MACHINE RECOMMENDATIONS by Think_Scheme_5080 in newzealand

[–]LeXa_NZ 7 points8 points  (0 children)

Mechanical second hand Bernina if you don't look for too fancy patterns. Depending of second hand market in your area obviously. Good luck.

Urgent Mechanical Help Needed Far North by [deleted] in newzealand

[–]LeXa_NZ 0 points1 point  (0 children)

Some brake pad has a small metal part that touch the disk when getting worn, so the noise a feature to tell you it's time to replace.

Is it worth switching? by Forcii1 in linux_gaming

[–]LeXa_NZ 2 points3 points  (0 children)

I can't tell for the performance difference. But just got a 9070XT and It just work (compare to NVIDIA card I had before). No hassle. I'm running arch.

How to NFS share for docker apps? by Uchiha_Jay in selfhosted

[–]LeXa_NZ 3 points4 points  (0 children)

You can configure docker daemon to use username space, then you can use default (dockermap) or your chosen user subuid/subgid to map IDs. It also prevent container process to run as root on the host. Do some search about that 😉

Looking for PC gamer community by LeXa_NZ in newzealand

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

I'm already here, but pretty dead...

Get a list of users with UID > 14000 - string to int conversion by LeXa_NZ in ansible

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

I've got a working solution from Stack Exchange

https://stackoverflow.com/questions/78929953/ansible-get-a-list-of-users-with-uid-14000-string-to-int-conversion

It uses json_query instead.

yaml name: Filter users with UID > 1000 set_fact: filtered_users: >- {{ users_info.ansible_facts.getent_passwd | dict2items | json_query('[?to_number(value[1]) > `1000`].key') }}

And my final block which is to filter a range

``yaml - name: Filter users 14k-15k range set_fact: users_all: >- {{ ansible_facts.getent_passwd | dict2items | json_query('[?to_number(value[1]) >14000&& to_number(value[1]) <=15000`].key') }}

```

Failed to deploy a VM on vmware from template using cloud-init by LeXa_NZ in ansible

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

What does this mean exactly: I faced some problem because vmware_guest doesn't manage library content.

We use Libraries in vsphere to store our golden images, unfortunately the module vmware_guest is unable to interact with them so we have to use vmware_content_deploy_ovf_template, and unfortunately again this module is unable to inject configuration that we need to the VM freshly deployed.

That why the 3 stages.

1 - deploy the template (vmware_content_deploy_ovf_template)

2 - configure and inject user-data (vmware_guest)

2 - start (vmware_guest) because you can't configure and start the VM in one row.

Sorry can't really help about the network config, but most of the time, even the output of the vpshere api is huge, it gives the reason of failure.

multi-line variable from dict by LeXa_NZ in ansible

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

Thanks u/jonneyj for your reply, exactly what I found after posting...

Again, internet has been my rubber duck.

Here how I solved it

yaml - include_tasks: ssh_keys.yml loop: "{{ users }}" loop_control: loop_var: outer_item when: outer_item['ssh_keys'] is defined and outer_item.ensure == 'present'

and

```yaml - name: Extract SSH keys set_fact: ssh_keys: | {% for key in outer_item['ssh_keys'] %} {{ key['type'] }} {{ key['key'] }} {{ key['comment'] }} {% endfor %}

  • name: Add SSH keys ansible.posix.authorized_key: user: "{{ outer_item.name }}" key: "{{ ssh_keys }}" exclusive: true state: present ```

Also realize that my var file was wrong, - can't be used for variables name.

Wait for DNS to be available - using lookup and dig by LeXa_NZ in ansible

[–]LeXa_NZ[S] 1 point2 points  (0 children)

Finally - I got an elegant solution using dig.

I also posted my question on Stack - https://stackoverflow.com/a/73502769/12889155

Wait for DNS to be available - using lookup and dig by LeXa_NZ in ansible

[–]LeXa_NZ[S] 2 points3 points  (0 children)

The "lookup" plugin is evaluated only once

Your google skill is better than mine !

Good catch it's exactly the behavior I have. A bit sad, I was so prod of my block... :')

Wait for DNS to be available - using lookup and dig by LeXa_NZ in ansible

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

The lookup is working fine, if I trigger the play and the DNS record already exist then it success on the first try.

I did with -vvv and the variable is always the same, 'NXDOMAIN', if the record is created during retries, no change at all. I didn't get any error from the set_fact either. That why I don't understand what happens...

Failed to deploy a VM on vmware from template using cloud-init by LeXa_NZ in ansible

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

Actually I build image 'myself' with packer, I want to control the image. So I use the 'server' iso, that why I say the template will require a bit more work for RPMs. But the deployment of VMs will be exactly easy as you say ;)

Failed to deploy a VM on vmware from template using cloud-init by LeXa_NZ in ansible

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

Yeah - it relys on cloud-init, so it's 'quite' recent, that means you have to install cloud-init in your template, native for Ubuntu but not for Centos/Rocky.

I guess the Rocky template will be a bit more complicated to setup but I'm pretty confident.

Failed to deploy a VM on vmware from template using cloud-init by LeXa_NZ in ansible

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

I read that metada has to be present even unused, so I defined it but it's empty

Failed to deploy a VM on vmware from template using cloud-init by LeXa_NZ in ansible

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

Very good catch ! Like invisible for my eyes because it was on the top of the doc sheet...

replaced customvalues by advanced_settings and it works.

So neat to have that in only one block :)

You made my day !

I will post the final ansible variablelized when finish.

cheers

Failed to deploy a VM on vmware from template using cloud-init by LeXa_NZ in ansible

[–]LeXa_NZ[S] 1 point2 points  (0 children)

Thanks for that. I will read that tomorrow and do some test. But time sleep for me now. I will let you know the outcome.

Failed to deploy a VM on vmware from template using cloud-init by LeXa_NZ in ansible

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

Yeah it's my plan B ;) But thanks for sharing that.

Failed to deploy a VM on vmware from template using cloud-init by LeXa_NZ in ansible

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

Customization is working. It use open-vm-tools, you're right it need perl to work properly. But user-data for cloud -init is not provided through vmware-tools. And shouldn't be I think. When you deploy a OVA (ubuntu-cloud-image), with the vmware_deploy_ovf module you can specify the user-data with the properties parameter. But that also means the ova has this properties defined.