Failover for adding proxy when line exists in file (#5751)

The 'regexp' parameter matches last occurrence of a line starting with 'proxy=' and replaces it with the one defined in 'line' parameter. If no match - it works same way as before. This fixes resuming cluster deployments failed after that task (if there was no more than one line starting with 'proxy' in the yum.conf file - this condition should also be reassured with the change introduced here) eg. if they were initiated with Terraform.
This commit is contained in:
dymq 2020-03-12 23:08:39 +01:00 committed by GitHub
parent c47f441b13
commit e0b76b185a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,7 @@
- name: Add proxy to /etc/yum.conf if http_proxy is defined
lineinfile:
path: "/etc/yum.conf"
regexp: "^proxy=.*$"
line: "proxy={{ http_proxy }}"
create: true
state: present