Private
Public Access
2
0
This commit is contained in:
2026-01-20 17:40:16 +03:00
parent cda556eec6
commit b78da80550
83 changed files with 108 additions and 82 deletions

View File

@@ -0,0 +1,2 @@
common_default_packages: []
common_proxy_server: null

View File

@@ -0,0 +1,7 @@
- name: Setup proxy client
when: "common_proxy_server != None"
ansible.builtin.include_tasks: "setup_proxy_client.yml"
- name: Setup packages
when: "common_default_packages | length > 0"
ansible.builtin.include_tasks: "setup_packages.yml"

View File

@@ -0,0 +1,9 @@
- name: Keep packages up to date
ansible.builtin.apt:
update_cache: true
upgrade: "safe"
- name: Install default packages
ansible.builtin.apt:
name: "{{ common_default_packages }}"
autoclean: true

View File

@@ -0,0 +1,24 @@
- name: Create 00proxy.conf file
ansible.builtin.template:
src: "templates/apt_proxy.conf"
dest: "/etc/apt/apt.conf.d/00proxy.conf"
mode: "644"
owner: "root"
group: "root"
- name: Add http_proxy and https_proxy variable to file /etc/environment
ansible.builtin.lineinfile:
path: "/etc/environment"
regexp: '^{{ item.key }}='
line: '{{ item.key }}="{{ item.value }}"'
create: true
mode: "644"
owner: "root"
group: "root"
with_items:
- key: 'http_proxy'
value: '{{ common_proxy_server }}'
- key: 'https_proxy'
value: '{{ common_proxy_server }}'
- key: 'no_proxy'
value: 'localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16'

View File

@@ -0,0 +1,2 @@
Acquire::http::Proxy "http://{{ common_proxy_server }}";
Acquire::https::Proxy "https://{{ common_proxy_server }}";