2018-04-26 09:52:06 +00:00
|
|
|
---
|
2019-04-23 22:46:02 +00:00
|
|
|
# OpenSUSE ships with Python installed
|
2019-04-09 07:17:05 +00:00
|
|
|
|
2020-04-17 21:23:35 +00:00
|
|
|
- name: Check that /etc/sysconfig/proxy file exists
|
|
|
|
stat:
|
|
|
|
path: /etc/sysconfig/proxy
|
2021-02-10 13:36:59 +00:00
|
|
|
get_attributes: no
|
|
|
|
get_checksum: no
|
|
|
|
get_mime: no
|
2020-04-17 21:23:35 +00:00
|
|
|
register: stat_result
|
|
|
|
|
|
|
|
- name: Create the /etc/sysconfig/proxy empty file
|
2021-07-12 07:00:47 +00:00
|
|
|
file: # noqa risky-file-permissions
|
2020-04-17 21:23:35 +00:00
|
|
|
path: /etc/sysconfig/proxy
|
|
|
|
state: touch
|
|
|
|
when:
|
|
|
|
- http_proxy is defined or https_proxy is defined
|
|
|
|
- not stat_result.stat.exists
|
|
|
|
|
2019-05-02 19:28:22 +00:00
|
|
|
- name: Set the http_proxy in /etc/sysconfig/proxy
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/sysconfig/proxy
|
|
|
|
regexp: '^HTTP_PROXY='
|
|
|
|
line: 'HTTP_PROXY="{{ http_proxy }}"'
|
|
|
|
become: true
|
|
|
|
when:
|
|
|
|
- http_proxy is defined
|
|
|
|
|
|
|
|
- name: Set the https_proxy in /etc/sysconfig/proxy
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/sysconfig/proxy
|
|
|
|
regexp: '^HTTPS_PROXY='
|
|
|
|
line: 'HTTPS_PROXY="{{ https_proxy }}"'
|
|
|
|
become: true
|
|
|
|
when:
|
|
|
|
- https_proxy is defined
|
|
|
|
|
|
|
|
- name: Enable proxies
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/sysconfig/proxy
|
|
|
|
regexp: '^PROXY_ENABLED='
|
|
|
|
line: 'PROXY_ENABLED="yes"'
|
|
|
|
become: true
|
|
|
|
when:
|
|
|
|
- http_proxy is defined or https_proxy is defined
|
|
|
|
|
2020-04-08 14:37:44 +00:00
|
|
|
# Required for zypper module
|
|
|
|
- name: Install python-xml
|
|
|
|
shell: zypper refresh && zypper --non-interactive install python-xml
|
|
|
|
changed_when: false
|
|
|
|
become: true
|
|
|
|
tags:
|
|
|
|
- facts
|
|
|
|
|
2019-04-23 22:46:02 +00:00
|
|
|
# Without this package, the get_url module fails when trying to handle https
|
|
|
|
- name: Install python-cryptography
|
|
|
|
zypper:
|
|
|
|
name: python-cryptography
|
2018-04-26 09:52:06 +00:00
|
|
|
state: present
|
2019-04-23 22:46:02 +00:00
|
|
|
update_cache: true
|
2019-02-11 22:04:27 +00:00
|
|
|
become: true
|
2021-12-03 20:20:35 +00:00
|
|
|
|
|
|
|
# Nerdctl needs some basic packages to get an environment up
|
|
|
|
- name: Install basic dependencies
|
|
|
|
zypper:
|
|
|
|
name:
|
|
|
|
- iptables
|
|
|
|
- apparmor-parser
|
|
|
|
state: present
|
|
|
|
become: true
|