Fix: Yum module does not use proxy when username is not set #51548 (#51994)

* add test of yum with proxy

* Properly handle unauthenticated yum proxy config

Fixes #51548

* shell executable is bash
This commit is contained in:
おすし
2019-02-14 04:10:47 +09:00
committed by ansibot
parent d7fd4d0550
commit c2a409a9e0
2 changed files with 28 additions and 5 deletions

View File

@@ -17,6 +17,12 @@
line: "proxy=http://127.0.0.1:8888"
state: present
- name: clear proxy logs
shell: ': > /var/log/tinyproxy/tinyproxy.log'
changed_when: false
args:
executable: /usr/bin/bash
- name: install ninvaders with unauthenticated proxy
yum:
name: 'https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/yum/ninvaders-0.1.1-18.el7.x86_64.rpm'
@@ -29,6 +35,9 @@
- "'msg' in yum_proxy_result"
- "'rc' in yum_proxy_result"
- name: check that it install via unauthenticated proxy
command: grep -q Request /var/log/tinyproxy/tinyproxy.log
- name: uninstall ninvaders with unauthenticated proxy
yum:
name: ninvaders
@@ -67,6 +76,12 @@
line: "proxy=http://1testuser:1testpassword@127.0.0.1:8888"
state: present
- name: clear proxy logs
shell: ': > /var/log/tinyproxy/tinyproxy.log'
changed_when: false
args:
executable: /usr/bin/bash
- name: install ninvaders with authenticated proxy
yum:
name: 'https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/yum/ninvaders-0.1.1-18.el7.x86_64.rpm'
@@ -79,6 +94,9 @@
- "'msg' in yum_proxy_result"
- "'rc' in yum_proxy_result"
- name: check that it install via authenticated proxy
command: grep -q Request /var/log/tinyproxy/tinyproxy.log
- name: uninstall ninvaders with authenticated proxy
yum:
name: ninvaders
@@ -108,6 +126,12 @@
line: "proxy_password=1testpassword"
state: present
- name: clear proxy logs
shell: ': > /var/log/tinyproxy/tinyproxy.log'
changed_when: false
args:
executable: /usr/bin/bash
- name: install ninvaders with proxy, proxy_username, and proxy_password config in yum.conf
yum:
name: 'https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/yum/ninvaders-0.1.1-18.el7.x86_64.rpm'
@@ -120,6 +144,9 @@
- "'msg' in yum_proxy_result"
- "'rc' in yum_proxy_result"
- name: check that it install via proxy with proxy_username, proxy_password config in yum.conf
command: grep -q Request /var/log/tinyproxy/tinyproxy.log
always:
#cleanup
- name: uninstall tinyproxy