tp ansible

This commit is contained in:
root 2023-10-16 17:55:25 +02:00
parent d86d83103d
commit 365ac0717a
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,23 @@
---
- name: squid-j2.yml
hosts: infra
vars:
- proxy_port: 8080
- proxy_mem: 512
tasks:
- name: 1. assurer que squid est installe
service:
name: squid
state: started
- name: 2. Copie du squid.conf apres generation dynamique
template:
src: squid.conf.j2
dest: /etc/squid/squid.conf
notify: restart squid
handlers:
- name: restart squid
service:
name: squid
state: restarted

View File

@ -0,0 +1,22 @@
---
- name: squid.yml
hosts: infra
vars:
proxy_port: 8080
proxy_mem: 128
tasks:
- name: 1. installation de squid
apt:
name: squid
state: latest
- name: 2. recuperation de squid.conf avec fetch
ansible.builtin.fetch:
src: /etc/squid/squid.conf
dest: ./squid.conf
flat: yes