Compare commits
No commits in common. "master" and "v1.0.1a-em" have entirely different histories.
master
...
v1.0.1a-em
@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
|
|
||||||
volip={}
|
|
||||||
|
|
||||||
regexp = "^(\S+) (\S+) (\S+) \[([^]]+)\] \"(\w+) (\S+).*\" (\d+) (\S+)"
|
|
||||||
for line in sys.stdin: # on lit sur l’entrée standard
|
|
||||||
line = line.rstrip () # on enleve le retour ligne
|
|
||||||
res = re.match (regexp, line)
|
|
||||||
if res:
|
|
||||||
(host, rfc931, user, date, request, url, status, byte) = res.groups()
|
|
||||||
host = res.group (1)
|
|
||||||
byte = int(res.group (8))
|
|
||||||
#print ('host : ', host, ' byte : ', byte)
|
|
||||||
if host not in volip:
|
|
||||||
volip[host]=byte
|
|
||||||
else:
|
|
||||||
volip[host]=volip[host]+byte
|
|
||||||
|
|
||||||
for addr in sorted(volip.keys()):
|
|
||||||
print(addr, "", volip[addr])
|
|
@ -1,13 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
regexp = "^(\S+) (\S+) (\S+) \[([^]]+)\] \"(\w+) (\S+).*\" (\d+) (\S+)"
|
|
||||||
for line in sys.stdin: # on lit sur l’entrée standard
|
|
||||||
line = line.rstrip () # on enleve le retour ligne
|
|
||||||
res = re.match (regexp, line)
|
|
||||||
if res:
|
|
||||||
(host, rfc931, user, date, request, url, status, byte) = res.groups()
|
|
||||||
host = res.group (1)
|
|
||||||
byte = res.group (8)
|
|
||||||
print ('host : ', host, ' byte : ', byte)
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if len(sys.argv) != 2:
|
|
||||||
print("usage: ", sys.argv[0], "<fichier>")
|
|
||||||
sys.exit(1) # nombre de parametre invalide
|
|
||||||
|
|
||||||
filename = sys.argv[1]
|
|
||||||
|
|
||||||
try:
|
|
||||||
file = open(filename , "r")
|
|
||||||
|
|
||||||
except:
|
|
||||||
msg = "erreur ouverture fichier " + filename
|
|
||||||
print(msg, file=sys.stderr)
|
|
||||||
|
|
||||||
else:
|
|
||||||
line = file.readline()
|
|
||||||
maligne = line.rstrip()
|
|
||||||
|
|
||||||
while maligne:
|
|
||||||
(login, complet) = maligne.split(":")
|
|
||||||
print (login)
|
|
||||||
print (complet)
|
|
||||||
commande="useradd --create-home --home-dir /home/"+login+ " --shell /bin/bash --comment \"" + complet + "\" " + login
|
|
||||||
login = []
|
|
||||||
line = file.readline()
|
|
||||||
maligne = line.rstrip()
|
|
||||||
print(line)
|
|
||||||
file.close()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,4 +0,0 @@
|
|||||||
emonnot:Elam Monnot
|
|
||||||
pdubois:Paul Dubois
|
|
||||||
blennon:Bob Lennon
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
# become: true
|
|
||||||
vars_prompt:
|
|
||||||
- name: username
|
|
||||||
prompt: Votre nom?
|
|
||||||
private: false
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: cree utilisateurs...
|
|
||||||
shell: "curl depl.sio.lan/usr/mkusrlin-2024.sh|bash"
|
|
||||||
|
|
||||||
- name: mdp root verrouillage...
|
|
||||||
# avec mkpasswd -m SHA-512
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: root
|
|
||||||
password: '$6$Ga8KbEYAgCZYGeDB$7zlfBy1j4koFv.NYQEeZa/k7pwjNTEI7hrWUlrHWTwd1YsEqm.Sy2DZ1GAFYe2qe4ZccMQJAt7QxILY1sd9AV0'
|
|
||||||
|
|
||||||
- name: enleve sio de sudo...
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: sio
|
|
||||||
groups: ''
|
|
||||||
|
|
||||||
- name: met le user "{{ username }}" dans le groupe sudo...
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: "{{ username }}"
|
|
||||||
groups: sudo
|
|
||||||
append: yes
|
|
||||||
|
|
||||||
- name: installe journal-remote...
|
|
||||||
apt:
|
|
||||||
name: systemd-journal-remote
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: configure journal-remote...
|
|
||||||
replace:
|
|
||||||
path: /etc/systemd/journal-upload.conf
|
|
||||||
regexp: '^# URL='
|
|
||||||
replace: 'URL=http://192.168.0.1:19532'
|
|
||||||
|
|
||||||
- name: active journal-remote au démarrage...
|
|
||||||
service:
|
|
||||||
name: systemd-journal-upload
|
|
||||||
state: started
|
|
||||||
enabled: yes
|
|
@ -1,6 +0,0 @@
|
|||||||
[adm]
|
|
||||||
infra
|
|
||||||
|
|
||||||
[web]
|
|
||||||
web1
|
|
||||||
web2
|
|
@ -1,7 +0,0 @@
|
|||||||
[adm]
|
|
||||||
infra
|
|
||||||
|
|
||||||
[web]
|
|
||||||
web1
|
|
||||||
web2
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
<title>Bonjour</title>
|
|
File diff suppressed because it is too large
Load Diff
@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: adm
|
|
||||||
vars:
|
|
||||||
- proxy_port: 8080
|
|
||||||
- proxy_mem: 256
|
|
||||||
- proxy_localnet: 192.168.0.0/24
|
|
||||||
tasks:
|
|
||||||
- name: Installation de proxy squid...
|
|
||||||
apt:
|
|
||||||
name: squid
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: generation du fichier de configuration de squid...
|
|
||||||
template:
|
|
||||||
src: squid.conf.j2
|
|
||||||
dest: /etc/squid/squid.conf
|
|
||||||
mode: 0644
|
|
||||||
backup: true
|
|
||||||
notify: restart squid
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
- name: restart squid
|
|
||||||
service:
|
|
||||||
name: squid
|
|
||||||
state: restarted
|
|
||||||
|
|
||||||
# - name: Copie de squid.conf...
|
|
||||||
# fetch:
|
|
||||||
# src: /etc/squid/squid.conf
|
|
||||||
# dest: ./squid.conf.j2
|
|
||||||
# flat: yes
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: web
|
|
||||||
name: syslog-client-configure
|
|
||||||
tasks:
|
|
||||||
- name: editing journald.conf...
|
|
||||||
ansible.builtin.replace:
|
|
||||||
path: /etc/systemd/journald.conf
|
|
||||||
regexp: '^#ForwardToSyslog=yes'
|
|
||||||
replace: 'ForwardToSyslog=yes'
|
|
||||||
backup: yes
|
|
||||||
notify: restart journald
|
|
||||||
|
|
||||||
- name: editing rsyslog.conf...
|
|
||||||
ansible.builtin.lineinfile:
|
|
||||||
path: /etc/rsyslog.conf
|
|
||||||
line: '*.* @192.168.0.48:514'
|
|
||||||
create: yes
|
|
||||||
notify: restart rsyslog
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
- name: restart journald
|
|
||||||
service:
|
|
||||||
name: systemd-journald
|
|
||||||
state: restarted
|
|
||||||
|
|
||||||
- name: restart rsyslog
|
|
||||||
service:
|
|
||||||
name: rsyslog
|
|
||||||
state: restarted
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: adm
|
|
||||||
name: rsyslog-server-configure
|
|
||||||
tasks:
|
|
||||||
- name: activation du module imudp...
|
|
||||||
ansible.builtin.replace:
|
|
||||||
path: /etc/rsyslog.conf
|
|
||||||
regexp: '^#module\(load="imudp"\)'
|
|
||||||
replace: 'module(load="imudp")'
|
|
||||||
|
|
||||||
- name: ouverture du port 514...
|
|
||||||
ansible.builtin.replace:
|
|
||||||
path: /etc/rsyslog.conf
|
|
||||||
regexp: '^#input\(type="imudp" port="514"\)'
|
|
||||||
replace: 'input(type="imudp" port="514")'
|
|
||||||
notify: restart rsyslog
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
- name: restart rsyslog
|
|
||||||
service:
|
|
||||||
name: rsyslog
|
|
||||||
state: restarted
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: web
|
|
||||||
name: web
|
|
||||||
tasks:
|
|
||||||
- name: verifying apache installation
|
|
||||||
apt :
|
|
||||||
name: apache2
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: verifying php installation
|
|
||||||
apt :
|
|
||||||
name: php
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: verifying php-mbstring installation
|
|
||||||
apt :
|
|
||||||
name: php-mbstring
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: overwriting index.html...
|
|
||||||
copy:
|
|
||||||
src: index.html
|
|
||||||
dest: /var/www/html/index.html
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user