From 365ac0717aa56c1e5b084f76578f79d8ef2690af Mon Sep 17 00:00:00 2001 From: root Date: Mon, 16 Oct 2023 17:55:25 +0200 Subject: [PATCH] tp ansible --- sio2/CYBER/Ansible/squid-j2.yml | 23 +++++++++++++++++++++++ sio2/CYBER/Ansible/squid.yml | 22 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 sio2/CYBER/Ansible/squid-j2.yml create mode 100644 sio2/CYBER/Ansible/squid.yml diff --git a/sio2/CYBER/Ansible/squid-j2.yml b/sio2/CYBER/Ansible/squid-j2.yml new file mode 100644 index 0000000..c3af7b4 --- /dev/null +++ b/sio2/CYBER/Ansible/squid-j2.yml @@ -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 diff --git a/sio2/CYBER/Ansible/squid.yml b/sio2/CYBER/Ansible/squid.yml new file mode 100644 index 0000000..a99c927 --- /dev/null +++ b/sio2/CYBER/Ansible/squid.yml @@ -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 + + + +