Compare commits
No commits in common. "master" and "v0.7" have entirely different histories.
@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: srv
|
|
||||||
remote_user: root
|
|
||||||
tasks:
|
|
||||||
- name: création de sioadm
|
|
||||||
user:
|
|
||||||
name: sioadm
|
|
||||||
state: present
|
|
||||||
generate_ssh_key: yes
|
|
||||||
password: "{{ 'sioadm' | password_hash('sha512') }}"
|
|
||||||
uid: 1200
|
|
||||||
groups: sudo
|
|
||||||
append: yes
|
|
||||||
register: mavar
|
|
||||||
- name: debug
|
|
||||||
debug:
|
|
||||||
msg: "{{ mavar }}"
|
|
||||||
- name: export clé publique
|
|
||||||
authorized_key:
|
|
||||||
user: "{{ sioadm }}"
|
|
||||||
key: /sioadm/.ssh/id_rsa.pub
|
|
||||||
state: present
|
|
||||||
- name: désinstaller paquets wpasupplicant
|
|
||||||
apt :
|
|
||||||
name : wpasupplicant
|
|
||||||
state: absent
|
|
||||||
- name: désinstaller paquets rpcbindd
|
|
||||||
apt :
|
|
||||||
name : rpcbind
|
|
||||||
state: absent
|
|
||||||
- name: copie fichier resolv.conf
|
|
||||||
copy:
|
|
||||||
src:resolv.conf
|
|
||||||
dest:/etc
|
|
||||||
- name: disable SSH access for root
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/ssh/sshd_config
|
|
||||||
regexp: '^(.*)#PermitRootLogin prohibit-password(.*)$"
|
|
||||||
replace: "PermitRootLogin prohibit-password"
|
|
||||||
- name: copie fichier sshd_config
|
|
||||||
copy:
|
|
||||||
src:sshd_config
|
|
||||||
dest:/etc/ssh/
|
|
@ -1,21 +0,0 @@
|
|||||||
Script démarré sur 2021-11-24 09:49:54+01:00 [TERM="xterm-256color" TTY="/dev/pts/0" COLUMNS="126" LINES="45"]
|
|
||||||
[?2004hroot@ansible:~# sed -i 's/srv/ansible/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cip -br a[Knano resolv.confsed -i 's/ansible/srv/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[27Papt install ansible -y
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[14Pip -br ased -i 's/test/ansible/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cpoweroff[Kapt update && apt upgrade -y
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Csed -i 's/bullseye/test/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[23Papt update && apt upgrade -y
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cpoweroff[Ksed -i 's/test/ansible/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cip -br a[Kapt install ansible -y
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Csed -i 's/ansible/srv/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cnano resolv.conf[K[8Pip -br ased -i 's/srv/ansible/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Ksed -i 's/srv/ansible/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cip -br a[Knano resolv.confsed -i 's/ansible/srv/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[27Papt install ansible -y
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[14Pip -br ased -i 's/test/ansible/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cpoweroff[Kapt update && apt upgrade -y
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Csed -i 's/bullseye/test/g' /etc/host{s,name};reboot
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cpoweroff[Knano /etc/ssh/sshd_config
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cls[K[Kpoweroff[4Pip rnlapoweroffapt autoremove[1Pcleaninstall vim curl mc sudo [K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[Kansible-playbook -i hi[Kosr[Kts confsrv.yml
|
|
||||||
[?2004l
[1;35m[WARNING]: Found both group and host with same name: srv[0m
|
|
||||||
[0;31mERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each:[0m
|
|
||||||
[0;31mJSON: Expecting value: line 1 column 1 (char 0)[0m
|
|
||||||
[0;31m[0m
|
|
||||||
[0;31mSyntax Error while loading YAML.[0m
|
|
||||||
[0;31m found unexpected end of stream[0m
|
|
||||||
[0;31m[0m
|
|
||||||
[0;31mThe error appears to be in '/root/confsrv.yml': line 44, column 1, but may[0m
|
|
||||||
[0;31mbe elsewhere in the file depending on the exact syntax problem.[0m
|
|
||||||
[0;31m[0m
|
|
||||||
[0;31mThe offending line appears to be:[0m
|
|
||||||
[0;31m[0m
|
|
||||||
[0;31m src:sshd_config[0m
|
|
||||||
[0;31m dest:/etc/ssh/[0m
|
|
||||||
[0;31m^ here[0m
|
|
||||||
[?2004hroot@ansible:~# [?2004l
|
|
||||||
exit
|
|
||||||
|
|
||||||
Script terminé sur 2021-11-24 09:50:32+01:00 [COMMAND_EXIT_CODE="4"]
|
|
@ -1,2 +0,0 @@
|
|||||||
[srv]
|
|
||||||
srv
|
|
@ -1,4 +0,0 @@
|
|||||||
search sio.lan
|
|
||||||
domain sio.lan
|
|
||||||
nameserver 10.121.38.7
|
|
||||||
nameserver 10.121.38.8
|
|
@ -1,124 +0,0 @@
|
|||||||
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
|
|
||||||
|
|
||||||
# This is the sshd server system-wide configuration file. See
|
|
||||||
# sshd_config(5) for more information.
|
|
||||||
|
|
||||||
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|
||||||
|
|
||||||
# The strategy used for options in the default sshd_config shipped with
|
|
||||||
# OpenSSH is to specify options with their default value where
|
|
||||||
# possible, but leave them commented. Uncommented options override the
|
|
||||||
# default value.
|
|
||||||
|
|
||||||
Include /etc/ssh/sshd_config.d/*.conf
|
|
||||||
|
|
||||||
#Port 22
|
|
||||||
#AddressFamily any
|
|
||||||
#ListenAddress 0.0.0.0
|
|
||||||
#ListenAddress ::
|
|
||||||
|
|
||||||
#HostKey /etc/ssh/ssh_host_rsa_key
|
|
||||||
#HostKey /etc/ssh/ssh_host_ecdsa_key
|
|
||||||
#HostKey /etc/ssh/ssh_host_ed25519_key
|
|
||||||
|
|
||||||
# Ciphers and keying
|
|
||||||
#RekeyLimit default none
|
|
||||||
|
|
||||||
# Logging
|
|
||||||
#SyslogFacility AUTH
|
|
||||||
#LogLevel INFO
|
|
||||||
|
|
||||||
# Authentication:
|
|
||||||
|
|
||||||
#LoginGraceTime 2m
|
|
||||||
#PermitRootLogin prohibit-password
|
|
||||||
#StrictModes yes
|
|
||||||
#MaxAuthTries 6
|
|
||||||
#MaxSessions 10
|
|
||||||
|
|
||||||
#PubkeyAuthentication yes
|
|
||||||
|
|
||||||
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
|
|
||||||
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
|
|
||||||
|
|
||||||
#AuthorizedPrincipalsFile none
|
|
||||||
|
|
||||||
#AuthorizedKeysCommand none
|
|
||||||
#AuthorizedKeysCommandUser nobody
|
|
||||||
|
|
||||||
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
|
|
||||||
#HostbasedAuthentication no
|
|
||||||
# Change to yes if you don't trust ~/.ssh/known_hosts for
|
|
||||||
# HostbasedAuthentication
|
|
||||||
#IgnoreUserKnownHosts no
|
|
||||||
# Don't read the user's ~/.rhosts and ~/.shosts files
|
|
||||||
#IgnoreRhosts yes
|
|
||||||
|
|
||||||
# To disable tunneled clear text passwords, change to no here!
|
|
||||||
#PasswordAuthentication yes
|
|
||||||
#PermitEmptyPasswords no
|
|
||||||
|
|
||||||
# Change to yes to enable challenge-response passwords (beware issues with
|
|
||||||
# some PAM modules and threads)
|
|
||||||
ChallengeResponseAuthentication no
|
|
||||||
|
|
||||||
# Kerberos options
|
|
||||||
#KerberosAuthentication no
|
|
||||||
#KerberosOrLocalPasswd yes
|
|
||||||
#KerberosTicketCleanup yes
|
|
||||||
#KerberosGetAFSToken no
|
|
||||||
|
|
||||||
# GSSAPI options
|
|
||||||
#GSSAPIAuthentication no
|
|
||||||
#GSSAPICleanupCredentials yes
|
|
||||||
#GSSAPIStrictAcceptorCheck yes
|
|
||||||
#GSSAPIKeyExchange no
|
|
||||||
|
|
||||||
# Set this to 'yes' to enable PAM authentication, account processing,
|
|
||||||
# and session processing. If this is enabled, PAM authentication will
|
|
||||||
# be allowed through the ChallengeResponseAuthentication and
|
|
||||||
# PasswordAuthentication. Depending on your PAM configuration,
|
|
||||||
# PAM authentication via ChallengeResponseAuthentication may bypass
|
|
||||||
# the setting of "PermitRootLogin without-password".
|
|
||||||
# If you just want the PAM account and session checks to run without
|
|
||||||
# PAM authentication, then enable this but set PasswordAuthentication
|
|
||||||
# and ChallengeResponseAuthentication to 'no'.
|
|
||||||
UsePAM yes
|
|
||||||
|
|
||||||
#AllowAgentForwarding yes
|
|
||||||
#AllowTcpForwarding yes
|
|
||||||
#GatewayPorts no
|
|
||||||
X11Forwarding yes
|
|
||||||
#X11DisplayOffset 10
|
|
||||||
#X11UseLocalhost yes
|
|
||||||
#PermitTTY yes
|
|
||||||
PrintMotd no
|
|
||||||
#PrintLastLog yes
|
|
||||||
#TCPKeepAlive yes
|
|
||||||
#PermitUserEnvironment no
|
|
||||||
#Compression delayed
|
|
||||||
#ClientAliveInterval 0
|
|
||||||
#ClientAliveCountMax 3
|
|
||||||
#UseDNS no
|
|
||||||
#PidFile /var/run/sshd.pid
|
|
||||||
#MaxStartups 10:30:100
|
|
||||||
#PermitTunnel no
|
|
||||||
#ChrootDirectory none
|
|
||||||
#VersionAddendum none
|
|
||||||
|
|
||||||
# no default banner path
|
|
||||||
#Banner none
|
|
||||||
|
|
||||||
# Allow client to pass locale environment variables
|
|
||||||
AcceptEnv LANG LC_*
|
|
||||||
|
|
||||||
# override default of no subsystems
|
|
||||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
|
||||||
|
|
||||||
# Example of overriding settings on a per-user basis
|
|
||||||
#Match User anoncvs
|
|
||||||
# X11Forwarding no
|
|
||||||
# AllowTcpForwarding no
|
|
||||||
# PermitTTY no
|
|
||||||
# ForceCommand cvs server
|
|
||||||
PermitRootLogin prohibit-password
|
|
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Installation de Docker Nextcloud et Traefik
|
|
||||||
hosts: test
|
|
||||||
become: yes
|
|
||||||
become_method: sudo
|
|
||||||
remote_user: root
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- docker
|
|
||||||
- nextcloud
|
|
||||||
- traefik
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Téléchargement get.docker
|
|
||||||
get_url:
|
|
||||||
url: http://s-adm/gsbstore/getdocker.sh
|
|
||||||
dest: /tmp
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Execution du script get_docker
|
|
||||||
script: /tmp/get_docker.sh
|
|
||||||
|
|
||||||
- name: Téléchargement docker-compose
|
|
||||||
get_url:
|
|
||||||
url: http://s-adm/gsbstore/docker-compose
|
|
||||||
dest: /usr/local/bin
|
|
||||||
mode: '0755'
|
|
@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Creation du repertoire nextcloud
|
|
||||||
file:
|
|
||||||
path: /root/nxc
|
|
||||||
state: directory
|
|
||||||
|
|
||||||
- name: Download foo.conf
|
|
||||||
get_url:
|
|
||||||
url: http://example.com/path/file.conf
|
|
||||||
dest: /etc/foo.conf
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Execution du script get_docker
|
|
||||||
script: /root/nextcloud/get_docker.sh
|
|
||||||
|
|
||||||
- name: Installation de docker-compose
|
|
||||||
shell: curl -L "https://github.com/docker/compose/releases/download/1.28.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
|
||||||
|
|
||||||
- name: Attribution des droits de docker compose
|
|
||||||
file:
|
|
||||||
path: /usr/local/bin/docker-compose
|
|
||||||
mode: '755'
|
|
||||||
|
|
||||||
- name: Copie de docker-compose.yml
|
|
||||||
copy:
|
|
||||||
src: /root/tools/ansible/gsb2021/roles/docker-nextcloud/files/docker-compose.yml
|
|
||||||
dest: /root/nextcloud
|
|
||||||
|
|
||||||
- name: Execution du fichier docker-compose.yml
|
|
||||||
shell: docker-compose up -d
|
|
||||||
args:
|
|
||||||
chdir: /root/nextcloud
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: all
|
|
||||||
roles:
|
|
||||||
- web
|
|
||||||
- doku
|
|
@ -1,10 +0,0 @@
|
|||||||
- name: installation apache2
|
|
||||||
apt:
|
|
||||||
name: apache2
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: installation php
|
|
||||||
apt:
|
|
||||||
name: php
|
|
||||||
state: present
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
[adm]
|
|
||||||
infra
|
|
||||||
|
|
||||||
[web]
|
|
||||||
web1
|
|
||||||
web2
|
|
@ -1 +0,0 @@
|
|||||||
On m'appelle l'ovni
|
|
File diff suppressed because it is too large
Load Diff
@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts:
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: install squid
|
|
||||||
apt :
|
|
||||||
name: squid
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: mise en place du fichier de conf
|
|
||||||
template:
|
|
||||||
src: squid.conf.j2
|
|
||||||
dest: /etc/squid/squid.conf
|
|
||||||
notify:
|
|
||||||
- restart squid
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
- hosts: web
|
|
||||||
tasks:
|
|
||||||
- name: on decommente l'option ForwardToSyslog=yes dans /etc/systemd/journald>
|
|
||||||
replace:
|
|
||||||
path: /etc/systemd/journald.conf
|
|
||||||
regexp: '^#ForwardToSyslog=yes'
|
|
||||||
replace: 'ForwardToSyslog=yes'
|
|
||||||
notify:
|
|
||||||
- restart journald
|
|
||||||
- name: Ajoute l'indication de serveur syslog distant
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/rsyslog.conf
|
|
||||||
line: '*.* @192.168.0.37:514'
|
|
||||||
create: yes
|
|
||||||
notify:
|
|
||||||
- restart rsyslog
|
|
||||||
handlers:
|
|
||||||
- name: restart journald
|
|
||||||
service:
|
|
||||||
name: systemd-journald.service
|
|
||||||
state: restarted
|
|
||||||
- name: restart rsyslog
|
|
||||||
service:
|
|
||||||
name: rsyslog
|
|
||||||
state: restarted
|
|
@ -1,22 +0,0 @@
|
|||||||
- hosts: adm
|
|
||||||
tasks:
|
|
||||||
- name: on active le module imudp dans /etc/rsyslog.conf
|
|
||||||
replace:
|
|
||||||
path: /etc/rsyslog.conf
|
|
||||||
regexp: '^#module\(load="imudp"\)'
|
|
||||||
replace: 'module(load="imudp")'
|
|
||||||
notify:
|
|
||||||
- restart rsyslog
|
|
||||||
- name: on decommente la ligne input type imudp port 514 dans /etc/rsyslog.conf
|
|
||||||
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,27 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: web
|
|
||||||
vars:
|
|
||||||
http_port: 80
|
|
||||||
max_clients: 200
|
|
||||||
remote_user: root
|
|
||||||
tasks:
|
|
||||||
- name: install apache2
|
|
||||||
apt :
|
|
||||||
name: apache2
|
|
||||||
state: present
|
|
||||||
- name: install php
|
|
||||||
apt :
|
|
||||||
name: php
|
|
||||||
state: present
|
|
||||||
- name: install php-mbstring
|
|
||||||
apt :
|
|
||||||
name: php-mbstring
|
|
||||||
state: present
|
|
||||||
- name: apache is running
|
|
||||||
service:
|
|
||||||
name: apache2
|
|
||||||
state: started
|
|
||||||
- name: copie fichier index.html
|
|
||||||
copy:
|
|
||||||
src: index.html
|
|
||||||
dest: /var/www/html/
|
|
Loading…
x
Reference in New Issue
Block a user