2018-10-11 19:51:40 +02:00
|
|
|
- name: test yum proxy settings
|
|
|
|
block:
|
|
|
|
- yum:
|
|
|
|
name: 'https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/yum/tinyproxy-1.10.0-3.el7.x86_64.rpm'
|
|
|
|
state: installed
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/tinyproxy/tinyproxy.conf
|
2018-10-30 16:35:37 +01:00
|
|
|
line: "BasicAuth 1testuser 1testpassword"
|
2018-10-11 19:51:40 +02:00
|
|
|
state: present
|
|
|
|
|
|
|
|
# systemd doesn't play nice with this in a container for some reason
|
|
|
|
- shell: tinyproxy
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
2018-10-30 16:35:37 +01:00
|
|
|
line: "proxy=http://1testuser:1testpassword@127.0.0.1:8888"
|
2018-10-11 19:51:40 +02:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- yum:
|
|
|
|
name: 'https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/yum/ninvaders-0.1.1-18.el7.x86_64.rpm'
|
|
|
|
state: installed
|
|
|
|
register: yum_proxy_result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "yum_proxy_result.changed"
|
|
|
|
- "'msg' in yum_proxy_result"
|
|
|
|
- "'rc' in yum_proxy_result"
|
|
|
|
|
|
|
|
- yum:
|
|
|
|
name: ninvaders
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
2018-10-30 16:35:37 +01:00
|
|
|
line: "proxy=http://1testuser:1testpassword@127.0.0.1:8888"
|
2018-10-11 19:51:40 +02:00
|
|
|
state: absent
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
|
|
|
line: "proxy=http://127.0.0.1:8888"
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
2018-10-30 16:35:37 +01:00
|
|
|
line: "proxy_username=1testuser"
|
2018-10-11 19:51:40 +02:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
2018-10-30 16:35:37 +01:00
|
|
|
line: "proxy_password=1testpassword"
|
2018-10-11 19:51:40 +02:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- yum:
|
|
|
|
name: 'https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/yum/ninvaders-0.1.1-18.el7.x86_64.rpm'
|
|
|
|
state: installed
|
|
|
|
register: yum_proxy_result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "yum_proxy_result.changed"
|
|
|
|
- "'msg' in yum_proxy_result"
|
|
|
|
- "'rc' in yum_proxy_result"
|
|
|
|
|
|
|
|
always:
|
|
|
|
- yum:
|
|
|
|
name: tinyproxy
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- yum:
|
|
|
|
name: ninvaders
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
2018-10-30 16:35:37 +01:00
|
|
|
line: "proxy=http://1testuser:1testpassword@127.0.0.1:8888"
|
2018-10-11 19:51:40 +02:00
|
|
|
state: absent
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
|
|
|
line: "proxy=http://127.0.0.1:8888"
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
2018-10-30 16:35:37 +01:00
|
|
|
line: "proxy_username=1testuser"
|
2018-10-11 19:51:40 +02:00
|
|
|
state: absent
|
|
|
|
|
|
|
|
- lineinfile:
|
|
|
|
path: /etc/yum.conf
|
2018-10-30 16:35:37 +01:00
|
|
|
line: "proxy_password=1testpassword"
|
2018-10-11 19:51:40 +02:00
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- (ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and ansible_distribution_major_version|int == 7)
|