Skip to content

Commit

Permalink
Escalate permissions for ip command (#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
plirglo authored and przemyslavic committed May 10, 2022
1 parent 5014895 commit 23c7327
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- name: Check routing configuration
become: true
command: ip route show default 0.0.0.0/0
register: ip_route_show_default

Expand All @@ -14,6 +15,7 @@
when: ip_route_show_default.stdout_lines | length > 1
block:
- name: Get metric values
become: true
shell: |-
set -o pipefail && \
ip route show default 0.0.0.0/0 | awk '{if (! /metric/) print 0; else for (x=1;x<NF;x++) if ($x == "metric") print $(x+1) }'
Expand Down

0 comments on commit 23c7327

Please sign in to comment.