mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-25 18:23:05 +01:00
**Added:** - Structured HTTP Proxy Configuration Block - Added a structured block in `http_proxy.yml` for managing HTTP proxy settings, aligning with Ansible's recommended practices. This includes creating directories and deploying configuration files in a clear, modular fashion. - Conditional Execution for Proxy Setup - Implemented conditional execution for the proxy setup in `http_proxy.yml`, utilizing `proxy_env` to adhere to Ansible's best practices for conditional tasks. - Improved PXE-Boot System Check Block - Introduced a more structured approach in `main.yml` for checking PXE-booted systems, enhancing readability and maintainability. **Changed:** - Adopted Ansible Builtin Modules - Transitioned existing tasks to use `ansible.builtin` modules, ensuring compatibility and future-proofing the role. - Refined Task Grouping - Reorganized tasks into logical blocks, improving the overall structure and readability, and showcasing Ansible's capabilities for efficient task management. - Updated K3s Service Configuration - Modified the K3s service configuration task in `main.yml` for a more streamlined approach using Ansible's template module, reflecting community-driven best practices. **Removed:** - Streamlined Task Definitions - Optimized task definitions to reduce redundancy, focusing on clarity and adherence to the evolving Ansible community standards.
20 lines
540 B
YAML
20 lines
540 B
YAML
---
|
|
- name: Manage K3s HTTP Proxy Configuration
|
|
when: proxy_env is defined
|
|
block:
|
|
- name: Create k3s.service.d directory
|
|
ansible.builtin.file:
|
|
path: '{{ systemd_dir }}/k3s.service.d'
|
|
owner: root
|
|
group: root
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Deploy the K3s http_proxy configuration file
|
|
ansible.builtin.template:
|
|
src: "http_proxy.conf.j2"
|
|
dest: "{{ systemd_dir }}/k3s.service.d/http_proxy.conf"
|
|
owner: root
|
|
group: root
|
|
mode: '0755'
|