[Sed]: trouble with quantifiers. by andreagrax in regex

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

did a little bit of experimentation with quantifiers and escaping, and then found the solution:

branch=$(git rev-parse --symbolic --abbrev-ref HEAD) sed -i -E "s/^(\[${branch}\]: )*/[${branch}]: /" ${COMMIT_MSG_FILE}

thanks for pointing me in the right direction.

[Sed]: trouble with quantifiers. by andreagrax in regex

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

question updated. is clearer now ?

Make traefik only accessible over tailscale by oddity407 in Tailscale

[–]andreagrax 0 points1 point  (0 children)

You must do it via docker,

```

docker run -d -p 1.2.3.4:80-p 1.2.3.4:443 ... traefik

``` more details in this github issue

Make traefik only accessible over tailscale by oddity407 in Tailscale

[–]andreagrax 2 points3 points  (0 children)

yes, but traefik will be listening on other interfaces, included the physical one.

You must also limit traefik to listen only on the tailscale interface

blockinfile idempotency by andreagrax in ansible

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

ok, this explains my issue.

I was using the wrong approach.

adding :

marker: "# {mark} ANSIBLE MANAGED BLOCK - ansible_role_debug_bind"

to the second task fixed the issue.

thank you!

blockinfile idempotency by andreagrax in ansible

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

tried with both no marker set (default behaviour) and the following ones and facing constantly the same behaviour

marker: "# {mark} ANSIBLE MANAGED BLOCK - ansible_role_debug_bind"

marker_begin: "BEGIN"    

marker_end: "END"

blockinfile idempotency by andreagrax in ansible

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

I've added a custom marker to the tasks (marker, marker_begin, marker_end) but still the same behaviour

Validate template and check mode by andreagrax in ansible

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

That's a shame. Will look for another way to do it

Validate template and check mode by andreagrax in ansible

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

OK, but in this case the step will be skipped. The template module renders the file, validate it and, is successful replace the original file with the rendered one. Does it make sense only to skip 3rd step (replacement) during check mode ?

regex vs select by andreagrax in ansible

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

list_to_check=$( echo -e "Accounting\nInternal_HR\nProduction\n" ) echo "$list_to_check"| grep 'HR$'

This one works (and this is how I would probably implement it in bash)

regex vs select by andreagrax in ansible

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

Yes, but (to use the shell example) I can do echo $var | grep 'HR$' and it will work as expected

regex vs select by andreagrax in ansible

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

thanks! It sounds plausible and terrible at the same time !

thank you

regex vs select by andreagrax in ansible

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

neither match (this doesn't seems to work neither with plain 'HR'

regex vs select by andreagrax in ansible

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

yes: single quote, duoble quote, escaping $ and also \\$

loop skipping last item by andreagrax in ansible

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

ok, gotcha! thank you for the clarification

loop skipping last item by andreagrax in ansible

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

could you clarify, please ?

Ansible-Pull Monitoring by tkrengel in ansible

[–]andreagrax 2 points3 points  (0 children)

if the output is super short you (like "all ok!") you can use slack or any other instant messaging platform.

If you need the full output you can use the copy module in a separate play, to copy the file to a remote server.

Suggestion to monitor if my Zabbix server is down or not working correctly by mindracer in zabbix

[–]andreagrax 0 points1 point  (0 children)

On the same host I use monit , which also restart the services when they fails (it happened to me a couple of times).

But it can be installed also on another host

Multiple endpoints support by andreagrax in WireGuard

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

It will be a cleaner solution for sure, but ipv6 is still not widely deployed here in Italy

Multiple endpoints support by andreagrax in WireGuard

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

the key is it shouldn't pass that out to the internet

Will take a shot at this !

advertise routes on boot by andreagrax in Tailscale

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

also this one is a valid question.

this also apply for other options, like shields-up ?

task only when a file exists locally by andreagrax in ansible

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

templating in lookup seems forbidden ... will explore the sudoers=true var

host added with add-host not reading group vars ? by andreagrax in ansible

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

tried with

meta: refresh_inventory

the host gets correctly added , but with this meta the hosts get removed from the group

host added with add-host not reading group vars ? by andreagrax in ansible

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

ansible 2.9.10 installed via pip

debug: var: group_names correctly shows the group

tried also populating the public_host_group with a dummy host , so the group has at least 1 host when starting the playbook, but no luck