forked from infra/ansible
fix(koji-http-toggle): resolve proxy IPs via shell so awk pipe works
Signed-off-by: Samyak Jain <samyak.jn11@gmail.com>
This commit is contained in:
parent
d9e7279830
commit
f059b1f9d2
1 changed files with 3 additions and 3 deletions
|
|
@ -30,8 +30,8 @@
|
|||
|
||||
tasks:
|
||||
- name: Resolve proxy IPs
|
||||
ansible.builtin.command:
|
||||
cmd: "getent ahostsv4 {{ item }} | awk '{print $1; exit}'"
|
||||
ansible.builtin.shell:
|
||||
cmd: set -o pipefail && getent ahostsv4 {{ item }} | awk '{print $1; exit}'
|
||||
register: proxy_resolution
|
||||
loop: "{{ proxy_hostnames }}"
|
||||
changed_when: false
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
- name: Set proxy IP list
|
||||
ansible.builtin.set_fact:
|
||||
proxy_ips: "{{ proxy_resolution.results | map(attribute='stdout') | list }}"
|
||||
proxy_ips: "{{ proxy_resolution.results | map(attribute='stdout') | map('trim') | list }}"
|
||||
|
||||
- name: Block Koji HTTP from proxies
|
||||
when: koji_action == 'block'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue