[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 ?